From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6Mh7KB2KHmWQOAEA9RJhRA:P1 (envelope-from ) for ; Thu, 05 Oct 2023 12:04:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6Mh7KB2KHmWQOAEA9RJhRA (envelope-from ) for ; Thu, 05 Oct 2023 12:04:13 +0200 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 3DB09398A7 for ; Thu, 5 Oct 2023 12:04:13 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=R0ZmL0fA; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696500253; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=cEagetoihVoGBpPa5W0Q2qkWn4Y1QTccxaBGnTwhmLM=; b=Hwd3h6QrkqfS/kcOrFJ/Ekm7oBJTUCy1XYSe8T+eUReNXoWNUFNkqwen2HbJZlDqjH2b24 8xcqfW0ar3nxPoBbqYo4OMxIqi6UF7dh81CYMZoDs+6NtIzMg5pmBifxNKVDWf9c0rVoE+ dx2WLtrf7MGI/3aDEkVOYlBEbz3dVjr7eFgcXIa/GxZHdWyBqtefcP4JXrOwKVM37rzi4P jkZgVlkFWRPnc5LVhGPOvAFyXRcugmF3VF3rg2abPpjmGCsNrsiIrxRY/RUYTHsoVZaIhL HZEYu5L1kZjqjHwolgXoZ9nEtL6b3jyXCq0gVpn2pyUG+UG0NWmyYNVjteZT8A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696500253; a=rsa-sha256; cv=none; b=fgBWCK8d5RCjrchsidUvRITzLUupHPM0cHGeQE2u0Y6Z00mXFFwsGpPbKPOlekDoLT9wv8 8GMCVz8o2DVTWuOCR6CmBCkzy+lGCWQFKi+Xftw4NgfYXpmKnXepCqGvYx/9BQgpWfZA8q Uvlo/bc1DZp0KcjhwFDJtIr1r2+uPHD6noU8Ibd/t7ZFbKlUrbqNnUNHtkWcig/NM5eQ9m nL3GJPxLudim0UMs2lj9vsGsYshyU5meytgD9/Jlc/F47y6jMhXpZ6CuxlRrj4yg9SJTgb kqAXpSNK9w4ePaslLzFgeDHCM71KvsV6//V6TBp0UgmVjpwAkF4FDaCJByZHAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=R0ZmL0fA; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoLCZ-0004IZ-Pe; Thu, 05 Oct 2023 06:03:27 -0400 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 ) id 1qoLCY-0004IQ-Cx for emacs-orgmode@gnu.org; Thu, 05 Oct 2023 06:03:26 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoLCV-0005L0-TN for emacs-orgmode@gnu.org; Thu, 05 Oct 2023 06:03:26 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A6590240101 for ; Thu, 5 Oct 2023 12:03:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1696500200; bh=rwJiFv+UKvnkZlroChj+TFxWW08cnVjyTie26wTdRLk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=R0ZmL0fAyaehBUy5oWFw0Ew1YqVyEIR7DBz429AQg1Xhj4v+nzCIZvxeYAiclrG9N 2tiua1ltb3t5CqyQyq+N3aykhoBkD7JUsJr7m/274NWOVyIN8+ETucqGy6t1jlE4kq rQjF1RMvgltV7XJ9ocF6OhtlUg5VuhHQCVEZXeMQ76rTLamrw9hwf5XUJIQiGHGfZU flx5pRVJI5r24yFUULfAHVo/CJe4bz1qmG3TnvbJe3KLyESmKCUwCBhUXgOVPl1PTY 4IU+aw3M59pYDYuVOQdym6IiYddJR3I9Kn93CMs624n9CyfEi1TBE2HbY4sayE9tpk wy8PAO/Wdrhzg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S1Rvq3n98z6tsg; Thu, 5 Oct 2023 12:03:19 +0200 (CEST) From: Ihor Radchenko To: =?utf-8?B?5YCJ5oiQ5pm65LmF?= Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Fix org-[beginning|end]-of-line with arguments In-Reply-To: References: Date: Thu, 05 Oct 2023 10:04:54 +0000 Message-ID: <87edi9jsft.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -6.47 X-Migadu-Spam-Score: -6.47 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 3DB09398A7 X-TUID: HQVF9kbQUrxY =E5=80=89=E6=88=90=E6=99=BA=E4=B9=85 writes: > In the current implementation, org-special-ctrl-a/e may not operate as ex= pected. > For example, executing (org-beginning-of-line 2) relocates the cursor > to the start of the line, rather than after the heading symbols even > if org-special-ctrl-a/e is t. > (Movements to prior lines, such as (org-beginning-of-line 0), function > correctly.) > This is my first patch submission. If there are any shortcomings or > additional requirements needed, please do not hesitate to inform me. I > am open to feedback and willing to make any necessary adjustments. Thanks for the patch, and especially for providing tests! See my comments below. > Subject: [PATCH] lisp/org.el: Fix the issue with argumented function calls The above message is not very clear. It would be better if you summarize the commit purpose more precisely. For example, "org-beginning/end-of-line: Fix when moving to different line" > * lisp/org.el (org-beginning-of-line, org-end-of-line): Fix issue with or= g-special-ctrl-a/e not working correctly when moving with arguments Please, quote Elisp symbols like `org-special-ctrl-a/e'. Also, we usually limit the line width to default `fill-column'. > - (when (or (> origin refpos) (=3D origin bol)) > + (when (or (> origin refpos) > + (=3D origin bol) > + (/=3D (line-number-at-pos origin) (line-number-at-pos bol))) This will work, but I am not a big fan of using `line-number-at-pos' - it is rather slow. May simply check (< origin bol) > - (when (or (> origin after-bullet) (=3D (point) origin)) > + (when (or (> origin after-bullet) > + (=3D (point) origin) > + (/=3D (line-number-at-pos origin) (line-number-at-pos (point)))) Same here - (< origin (point)) > - (if (or (< origin tags) (=3D origin (line-end-position))) > + (if (or (< origin tags) > + (=3D origin (line-end-position)) > + (/=3D (line-number-at-pos origin) (line-number-at-pos (point)))) (> origin (line-end-position)) Finally, your patch is on the edge of legally allowed contribution we are allowed to accept without copyright assignment. You may consider signing the copyright form as described in https://orgmode.org/worg/org-contribute.html#copyright. Or you can add "TINYCHANGE" to the commit message (see https://orgmode.org/worg/org-contribute.html#first-patch) --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at