From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Dec 2020 18:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 45199@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1607797244517 (code B ref -1); Sat, 12 Dec 2020 18:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Dec 2020 18:20:44 +0000 Received: from localhost ([127.0.0.1]:46392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ko9Vc-00008G-9N for submit@debbugs.gnu.org; Sat, 12 Dec 2020 13:20:44 -0500 Received: from lists.gnu.org ([209.51.188.17]:33806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ko9Va-000089-N7 for submit@debbugs.gnu.org; Sat, 12 Dec 2020 13:20:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ko9Va-0002Uf-C4 for bug-gnu-emacs@gnu.org; Sat, 12 Dec 2020 13:20:42 -0500 Received: from sonic306-20.consmr.mail.ir2.yahoo.com ([77.238.176.206]:38345) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ko9VX-0002cU-2Z for bug-gnu-emacs@gnu.org; Sat, 12 Dec 2020 13:20:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1607797233; bh=xleqTiTnLxgvYZaeyMrCAmDhC6x5CWyRJ5Q1hQm3Tpc=; h=From:To:Subject:Date:References:From:Subject; b=P8c51orRSfi7ApE+MWliaRVoxJ4rkOOajHgktWI766q9/pY0IgTjherB7SU9CXM/5QPjsuNMCArCMIU5d7w1sX1Zh3doVY4tm4gvZDR81JYub1TFBThmNd+9lp4Y3hlmTP8V2sfWF1OvhqSECyMfPfBjdpzQWRiVG8sPQmDxyP7qfqIw6XSQ+rbJMTM30v0QZ99SmJ6DYuj69wL+56AZunoYT4TJEN37OK4Y5UmPkq/xemPm2gzjmXBNTH1GK6+dy3qOp7jE+8UckAjITUyLqVwc4kMPpbQwUW4z/ZVoyv7x3Dz6fI5dn7hjl/ztyCDFNEcnGTCYFfNsaUG4c9F3AA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1607797233; bh=6dyK9Y+F+kIDmN8Om+2cSUIuc5Su7S9lmUGFmzTJSBj=; h=From:To:Subject:Date:From:Subject; b=c3fVAdMvxKYjP0CpGbLNKbJDDOI6G7opYkO+9wMVp9MOPHSVDKDTjtQzjhu9ebeQXX8KA4y6IbIBIGqYriDpv2lQJQkzzjqWcklxe6V4G5ezxipFs+wJc7OC5XN6QYa8adhnRmbFWRP+4ijqUlc7+xf7KiA7TsoWeHJYNEhWdsm9dUxH4nIhvlYvOHo9j5/OuOFUKZTmDZCg1LqwHcsH+FKD9tDfiI0SDTu4ki5u9WFIRkyrBkfRO6Royc+HXkY7MSHbDm4q2rBzY/yyM/TsF0Qqcta0PPKmwLE3ik0OManJw5KQJsy3iUjdjBeaGYKeUSbBWVX7t8AkWbAHw8dxyA== X-YMail-OSG: apG8nywVM1nCKTjcxfIvIzSRxCxQIDuRC5D0cQ3iMN3np.8z8z7_AWU9KvPicOr uLsGzgrQe4O3nF4qoV9GKb3BpEsqEQPNf_QkHg7Dt.8muiPZIpOheQKbIiToDBZ2_qxDl37XLweb I_wwB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w3Jk.FLKb6v40i5lbGZz8QuLzK8GaraMzK1ysNgnFUP71OO4mCwM LJjo9nTUyQXkTlgavv44D54kcT2McXaqPtrQPbYQnbbrBeeFkXSOjGKej_7UqZvnmm1NXqCuwSwZ 3p4bc6iibLfpxE0Db8XRD2SeQQ5u.gQgKuj1mjdEH47lSj6VUvMLk1w-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Sat, 12 Dec 2020 18:20:33 +0000 Received: by smtp410.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 4ed5c7e20ffa05448367fe56910aa949; Sat, 12 Dec 2020 16:40:24 +0000 (UTC) From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Date: Sat, 12 Dec 2020 17:40:23 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" References: X-Mailer: WebService/1.1.17111 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.8) Content-Length: 4212 Received-SPF: pass client-ip=77.238.176.206; envelope-from=mardani29@yahoo.es; helo=sonic306-20.consmr.mail.ir2.yahoo.com 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, 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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain My use case (there may be many) comes from working with PDFs at a low level. If you open a PDF file in fundamental-mode, towards the end of the file you'll see text that resembles the following: xref 0 26 0000000000 65535 f 0000006459 00000 n This is a table where the first column contains file offsets that point to where the PDF objects are defined. I wanted to place the point on the "0000006459", do M-g c, and easily go to file offset 6459 to see the definition of the PDF object number 1 ("1 0 obj"). goto-char is useful here because PDF files are open as unibyte in Emacs. If you also find the behavior generally useful, feel free to install it for Emacs 28. Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Make-goto-char-offer-the-number-at-point-as-default.patch >From 92e0a5c1b7482c4399f86eee9d4d41732457d081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 12 Dec 2020 17:10:05 +0100 Subject: [PATCH] Make goto-char offer the number at point as default * src/editfns.c (Fgoto_char): Expand the interactive definition of goto-char to offer the number at point as default. Note that only numbers that make sense as character positions will be offered. Also expand the docstring to document this new interactive behavior. * doc/emacs/basic.texi (Moving Point): Expand the Emacs manual to document this new behavior. * etc/NEWS: And announce it. --- doc/emacs/basic.texi | 5 ++++- etc/NEWS | 4 ++++ src/editfns.c | 20 ++++++++++++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index cd1ffbebd7..77c8054746 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -310,7 +310,10 @@ Moving Point @kindex M-g c @findex goto-char Read a number @var{n} and move point to buffer position @var{n}. -Position 1 is the beginning of the buffer. +Position 1 is the beginning of the buffer. If point is on or just +after a number in the buffer, that is the default for @var{n}. Just +type @key{RET} in the minibuffer to use it. You can also specify +@var{n} by giving @kbd{M-g c} a numeric prefix argument. @item M-g M-g @itemx M-g g diff --git a/etc/NEWS b/etc/NEWS index 514209516d..13ff0bb171 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -257,6 +257,10 @@ When 'widen-automatically' is non-nil, 'goto-line' widens the narrowed buffer to be able to move point to the inaccessible portion. 'goto-line-relative' is bound to 'C-x n g'. ++++ +** When called interactively, 'goto-char' now offers the number at + point as default. + +++ ** When 'suggest-key-bindings' is non-nil, the completion list of 'M-x' shows equivalent key bindings for all commands that have them. diff --git a/src/editfns.c b/src/editfns.c index 4104edd77f..cd6ed90ee5 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -188,11 +188,27 @@ DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0, return build_marker (current_buffer, PT, PT_BYTE); } -DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ", +DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, + "(if (and current-prefix-arg (not (consp current-prefix-arg)))\ + (list (prefix-numeric-value current-prefix-arg))\ + (let* ((default\ + (save-excursion\ + (skip-chars-backward \"0-9\")\ + (if (looking-at-p \"[0-9]\")\ + (string-to-number\ + (buffer-substring-no-properties\ + (point)\ + (progn (skip-chars-forward \"0-9\")\ + (point))))))))\ + (list (read-number \"Goto char: \" default))))", doc: /* Set point to POSITION, a number or marker. Beginning of buffer is position (point-min), end is (point-max). -The return value is POSITION. */) +The return value is POSITION. + +If called interactively, a numeric prefix argument specifies +POSITION; without a numeric prefix argument, read POSITION from the +minibuffer. */) (register Lisp_Object position) { if (MARKERP (position)) -- 2.28.0 --=-=-=-- From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Dec 2020 19:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Cc: 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.160779996013874 (code B ref 45199); Sat, 12 Dec 2020 19:06:02 +0000 Received: (at 45199) by debbugs.gnu.org; 12 Dec 2020 19:06:00 +0000 Received: from localhost ([127.0.0.1]:46550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koADN-0003bd-5J for submit@debbugs.gnu.org; Sat, 12 Dec 2020 14:06:00 -0500 Received: from quimby.gnus.org ([95.216.78.240]:50170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koADL-0003bJ-AK for 45199@debbugs.gnu.org; Sat, 12 Dec 2020 14:05:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=aOzT4DZe06YrXisg0AUm7l2wZ7bTL7oZQ6NzmGM3sgo=; b=nmPZy8NawI+Z3psxH9oDx6Loi+ zmNyemDZNDRR0Lnw7eKeompzcjomMwOmDqS/b+fZgo+SSD217GwwwQs3zkkt2N91N2H9uu8PWwvAl 78Sg6ywcqOno13F9old0/lb2NZ5CRjGczjwyHDAEDjCpToYnd737Uy7CwTMu/GrcQYuw=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koAD9-0001dc-K2; Sat, 12 Dec 2020 20:05:48 +0100 From: Lars Ingebrigtsen References: X-Now-Playing: Weather Report's _Heavy Weather_: "Palladium" Date: Sat, 12 Dec 2020 20:05:42 +0100 In-Reply-To: ("Daniel =?UTF-8?Q?Mart=C3=ADn?="'s message of "Sat, 12 Dec 2020 17:40:23 +0100") Message-ID: <87o8iy975l.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Daniel =?UTF-8?Q?Mart=C3=ADn?= writes: > * src/editfns.c (Fgoto_char): Expand the interactive definition of > goto-char to offer the number at point as default. I think this makes sense, but: Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Daniel Mart=C3=ADn writes: > * src/editfns.c (Fgoto_char): Expand the interactive definition of > goto-char to offer the number at point as default. I think this makes sense, but: > -DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ", > +DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, > + "(if (and current-prefix-arg (not (consp current-prefix-arg)))\ > + (list (prefix-numeric-value current-prefix-arg))\ > + (let* ((default\ > + (save-excursion\ > + (skip-chars-backward \"0-9\")\ > + (if (looking-at-p \"[0-9]\")\ > + (string-to-number\ > + (buffer-substring-no-properties\ > + (point)\ > + (progn (skip-chars-forward \"0-9\")\ > + (point))))))))\ > + (list (read-number \"Goto char: \" default))))", I think it would be better to put this in a helper function in subr.el, for instance. And there's also `number-at-point', could perhaps be used here? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Dec 2020 01:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.160782261420793 (code B ref 45199); Sun, 13 Dec 2020 01:24:02 +0000 Received: (at 45199) by debbugs.gnu.org; 13 Dec 2020 01:23:34 +0000 Received: from localhost ([127.0.0.1]:47175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koG6o-0005PI-6J for submit@debbugs.gnu.org; Sat, 12 Dec 2020 20:23:34 -0500 Received: from sonic303-21.consmr.mail.ir2.yahoo.com ([77.238.178.202]:39066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koG6h-0005Oq-69 for 45199@debbugs.gnu.org; Sat, 12 Dec 2020 20:23:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1607822598; bh=XKBxksztnDeJGrvzwbstprr3qVTFsz8PfzOTybu0Bw0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject; b=eD1AjlNLWSbXE4rlh41HNMsfu/5tikjBrWIChxS8QkuG6kuCTTf1JtfE2HLLMyNpsnBmgFIokpKEDPvs4KrOrbYhn6qFuAfFGQ/sj3WjLt3I2ZXtkQMVBZ+V+uIF39wsQJHruKhkEeCQOhJSAscL5KSdeaEfvx3vdjXIgtAM0lrZKjToAc5mPYAEuNNqn3TQsK4ySSqdLYvvaEC8V1IopY0ehA1YmrqNBfXVr/KYasGs1n5TFi+TBQLKEnniF1A1E5swDGHmkqBInkPG/ACkz4pDgnkNo5dgSkgVoWyCodWT/s8C9mT8azxLLELi8UsMtq8McGzsA9xB+G1Msk70rQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1607822598; bh=Q4DR1Ft/tt8uFlTKTKc32YsAwNA5FHY11zpoL8oTeH+=; h=From:To:Subject:Date:From:Subject; b=dqeCfqQ8A/63YADkXHVX49BBO3pTozrvBBudaxXh9R2e5aFD/OM8t07d9u86ZfTWiSYdO7hGNWBegyotcWM0FyVV7VZ1xLEOnbbLorBgGv0i0oim+zn3z7p2n6w+5lgh5OsCHd8BEhKMy5VdxkbsnmyoaLp3ojgnhZNmF+FdL2AkJ3sSYS0CJW7m35rSo14pWU1yFJtzANp2nnayNsdVEEa8taUx6ZUTXzUFyNTtNz8xC8CJUHv3mNjH/Dkk6RPKk/XQvRN2fHQDHY8Iw93P9E6MjeMuW9LkaUujI2DgOJSN8pKkQUr8niucogNqMbbpRn3+HEa0dRy60x30FqMHRw== X-YMail-OSG: mAdlOa8VM1lYRpVdeS6XQp6Wdabs17dn23_xw7oSfcx3TLIN6i8gthgxZrSoF7K XjVHaecwtCl20ZqeIHynr8PxNYjzAukLAHUqIgkxhmqzHVnwqu1xm8Y8pIv_83TT0rWXAZoNKO.V 0v_VwBOgyLlHecumi_d_BYcPwG0c2MUVbQ2yNug_pV.kfK23y05b.ApOxhqOgJXnXnfJwhMAPLRA WZTvggFoaEFZnhVvfHiaVpnz8IVluZ9bMU6k4QfJP4wQMGZfXfjOUW7N6nS5btQv91kP568Xwof6 6y8B_lzLmwHxB.zt7_jY4zeIClpXx1iegfmWGjv5J4cCqlqx.EmIKf7W6veZNYC43Uto_.42VzGq EW8hD6zenrI8Ajeof90ue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lPmx8UNReqKKs3CgqKqweEraSIFGPq9agw- - Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Sun, 13 Dec 2020 01:23:18 +0000 Received: by smtp415.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 2e0316d90f463f3736a6af530bdb6fed; Sun, 13 Dec 2020 01:23:14 +0000 (UTC) From: Daniel =?UTF-8?Q?Mart=C3=ADn?= References: <87o8iy975l.fsf@gnus.org> Date: Sun, 13 Dec 2020 02:23:13 +0100 In-Reply-To: <87o8iy975l.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 12 Dec 2020 20:05:42 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Mailer: WebService/1.1.17278 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.8) Content-Length: 3724 X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > > I think it would be better to put this in a helper function in subr.el, > for instance. > > And there's also `number-at-point', could perhaps be used here? Oh, I forgot about number-at-point. It extracts numbers that don't make sense here (like floating point or negative numbers), but we can easily filter them with natnump. I've attached a new patch; do you feel it's still necessary to extract the logic in a helper? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Make-goto-char-offer-the-number-at-point-as-default.patch >From 499618f25e78cb1ab9803e44123b249b40b9d4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 12 Dec 2020 17:10:05 +0100 Subject: [PATCH] Make goto-char offer the number at point as default * src/editfns.c (Fgoto_char): Expand the interactive definition of goto-char to offer the number at point as default. Note that only numbers that make sense as character positions will be offered. Also expand the docstring to document this new interactive behavior. * doc/emacs/basic.texi (Moving Point): Expand the Emacs manual to document this new behavior. * etc/NEWS: And announce it. --- doc/emacs/basic.texi | 5 ++++- etc/NEWS | 4 ++++ src/editfns.c | 13 +++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index cd1ffbebd7..77c8054746 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -310,7 +310,10 @@ Moving Point @kindex M-g c @findex goto-char Read a number @var{n} and move point to buffer position @var{n}. -Position 1 is the beginning of the buffer. +Position 1 is the beginning of the buffer. If point is on or just +after a number in the buffer, that is the default for @var{n}. Just +type @key{RET} in the minibuffer to use it. You can also specify +@var{n} by giving @kbd{M-g c} a numeric prefix argument. @item M-g M-g @itemx M-g g diff --git a/etc/NEWS b/etc/NEWS index 514209516d..13ff0bb171 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -257,6 +257,10 @@ When 'widen-automatically' is non-nil, 'goto-line' widens the narrowed buffer to be able to move point to the inaccessible portion. 'goto-line-relative' is bound to 'C-x n g'. ++++ +** When called interactively, 'goto-char' now offers the number at + point as default. + +++ ** When 'suggest-key-bindings' is non-nil, the completion list of 'M-x' shows equivalent key bindings for all commands that have them. diff --git a/src/editfns.c b/src/editfns.c index 4104edd77f..a6f9d30a7c 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -188,11 +188,20 @@ DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0, return build_marker (current_buffer, PT, PT_BYTE); } -DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ", +DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, + "(if (and current-prefix-arg (not (consp current-prefix-arg)))\ + (list (prefix-numeric-value current-prefix-arg))\ + (let* ((number (number-at-point))\ + (default (and (natnump number) number)))\ + (list (read-number \"Goto char: \" default))))", doc: /* Set point to POSITION, a number or marker. Beginning of buffer is position (point-min), end is (point-max). -The return value is POSITION. */) +The return value is POSITION. + +If called interactively, a numeric prefix argument specifies +POSITION; without a numeric prefix argument, read POSITION from the +minibuffer. */) (register Lisp_Object position) { if (MARKERP (position)) -- 2.28.0 --=-=-=-- From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Dec 2020 13:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Cc: 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.160786527330559 (code B ref 45199); Sun, 13 Dec 2020 13:15:02 +0000 Received: (at 45199) by debbugs.gnu.org; 13 Dec 2020 13:14:33 +0000 Received: from localhost ([127.0.0.1]:47719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koRCr-0007wo-0B for submit@debbugs.gnu.org; Sun, 13 Dec 2020 08:14:33 -0500 Received: from quimby.gnus.org ([95.216.78.240]:58404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koRCn-0007wF-N0 for 45199@debbugs.gnu.org; Sun, 13 Dec 2020 08:14:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=DxUy6sJnkAAD9Y8od6LCSr9N1tH9YJM/9bpatXBU5e4=; b=H5u3KEId2BmPmpryU3s3msRPf5 RNVRzG+WEoE8MycKnDU5fWwMTsmQoVAhhAsN9t8wWHI+wYLVKONCpKr82ZvJ4q7E41VT8zISlkkCj WfQGpVl0e2FWmPq0v3C6h0OcR2F+7vbw/KcyOuk5SfboelGGbvTC6k5+CDo+F3BBiCPM=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koRCf-0005Il-1P; Sun, 13 Dec 2020 14:14:24 +0100 From: Lars Ingebrigtsen References: <87o8iy975l.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEUCAQQSDAgVExA0 LiQmGxBzZEdjUikzJxS0lkKKcS2hjFZFNh6LdkvPx6n////4bZDmAAAAAWJLR0QOb70wTwAAAAd0 SU1FB+QMDQ0NEaFdCwQAAAE8SURBVDjLY2CAAEZBIFAUZEACzGBxASB2YEABrAFAwjSBgYG9HchQ A6pgsCwAy6wGMYESjClAxq5ABga2NgGwhBsQs4CYCkBcCdRfWQC1F9lgkIpyBQbsgJFh4EHVBpCH QY7ZCOIiwsVnIpDYAeSztYAC6BBCC8jT7KBABGlliwZ6ciY2zxUCVU0baO/hArBksRnD2QwMVncY GLg7gB7kBiUGNgOgB0+DJdStgcw0oBj3dCAhCfQ+ezoiFh1RzHFB2IHT8gGREGJgYAoB0swbMCXA qd92AVTAtAAY7wvAEmDP3QUGCfsBIGNHAAMDDxArQRUmAjETyDh2BUj2UsJl+aCV0EgA0twgDPQX wzYg1lYAS0hOALKlHIB4MZAxE+i5msVgCZA/wXEvth1IlIPMUUG1A6wCYQeOGFECAIj5KsgiIEKG AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTEyLTEzVDEzOjEzOjE3KzAwOjAwsFDznwAAACV0RVh0 ZGF0ZTptb2RpZnkAMjAyMC0xMi0xM1QxMzoxMzoxNyswMDowMMENSyMAAAAASUVORK5CYII= X-Now-Playing: clipping.'s _Visions of Bodies Being Burned_: "96 Neve Campbell (featuring Cam & China)" Date: Sun, 13 Dec 2020 14:14:19 +0100 In-Reply-To: ("Daniel =?UTF-8?Q?Mart=C3=ADn?="'s message of "Sun, 13 Dec 2020 02:23:13 +0100") Message-ID: <87k0tl4zmc.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Daniel =?UTF-8?Q?Mart=C3=ADn?= writes: > Oh, I forgot about number-at-point. It extracts numbers that don't make > sense here (like floating point or negative numbers), but we can easily > filter them with natnump. I've attached a new patc [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Daniel Mart=C3=ADn writes: > Oh, I forgot about number-at-point. It extracts numbers that don't make > sense here (like floating point or negative numbers), but we can easily > filter them with natnump. I've attached a new patch; do you feel it's > still necessary to extract the logic in a helper? Yeah, I'd still rather have a helper function -- putting several lines of Lisp code in a string in C isn't optimal. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Dec 2020 18:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.16078824999779 (code B ref 45199); Sun, 13 Dec 2020 18:02:01 +0000 Received: (at 45199) by debbugs.gnu.org; 13 Dec 2020 18:01:39 +0000 Received: from localhost ([127.0.0.1]:50062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koVgh-0002Xf-61 for submit@debbugs.gnu.org; Sun, 13 Dec 2020 13:01:39 -0500 Received: from sonic304-22.consmr.mail.ir2.yahoo.com ([77.238.179.147]:38901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koVgd-0002XN-Ss for 45199@debbugs.gnu.org; Sun, 13 Dec 2020 13:01:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1607882486; bh=OThvixHriKoNFfu3N1k8TDqUBMhtCQdGXquAsl4U9cI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject; b=n+w510AIOdv/9+5ZeLXpBcaFnLChe+Hy8BYOcpE0C7RMzblcV5NOCU1PnO29nEW9ayBT2Ek3qL8SixjdLwOalb9I4a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yrVLEKH.SIZMmeP7684hOLuJZXyRYH9FzsAZ6zZHdPavtQlPJ05EHg_LR6e6.n1VGKg RwVuQAUwmFw85aU0rl72Cxf1YlthtrUUGPqqMUTJAL9a1roFeYcZo5jPVQLIP8wRQLOaY8S5AYA- - Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ir2.yahoo.com with HTTP; Sun, 13 Dec 2020 18:01:26 +0000 Received: by smtp414.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ad38b85bccaded2be746bdf447d40bcb; Sun, 13 Dec 2020 18:01:25 +0000 (UTC) From: Daniel =?UTF-8?Q?Mart=C3=ADn?= References: <87o8iy975l.fsf@gnus.org> <87k0tl4zmc.fsf@gnus.org> Date: Sun, 13 Dec 2020 19:01:24 +0100 In-Reply-To: <87k0tl4zmc.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 13 Dec 2020 14:14:19 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Mailer: WebService/1.1.17278 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.8) Content-Length: 4038 X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > > Yeah, I'd still rather have a helper function -- putting several lines > of Lisp code in a string in C isn't optimal. OK, done. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Make-goto-char-offer-the-number-at-point-as-default.patch >From 62dffb016c1b95923e654f516f52780aa2eb966d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 12 Dec 2020 17:10:05 +0100 Subject: [PATCH] Make goto-char offer the number at point as default * lisp/subr.el (read-natnum-interactive): New function to read natural numbers for interactive functions. * src/editfns.c (Fgoto_char): Call read-natnum-interactive from the interactive definition of goto-char to offer the number at point as default. Also expand the docstring to document this new interactive behavior. * doc/emacs/basic.texi (Moving Point): Expand the Emacs manual to document this new behavior. * etc/NEWS: And announce it. --- doc/emacs/basic.texi | 5 ++++- etc/NEWS | 4 ++++ lisp/subr.el | 9 +++++++++ src/editfns.c | 9 +++++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index cd1ffbebd7..77c8054746 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -310,7 +310,10 @@ Moving Point @kindex M-g c @findex goto-char Read a number @var{n} and move point to buffer position @var{n}. -Position 1 is the beginning of the buffer. +Position 1 is the beginning of the buffer. If point is on or just +after a number in the buffer, that is the default for @var{n}. Just +type @key{RET} in the minibuffer to use it. You can also specify +@var{n} by giving @kbd{M-g c} a numeric prefix argument. @item M-g M-g @itemx M-g g diff --git a/etc/NEWS b/etc/NEWS index 514209516d..13ff0bb171 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -257,6 +257,10 @@ When 'widen-automatically' is non-nil, 'goto-line' widens the narrowed buffer to be able to move point to the inaccessible portion. 'goto-line-relative' is bound to 'C-x n g'. ++++ +** When called interactively, 'goto-char' now offers the number at + point as default. + +++ ** When 'suggest-key-bindings' is non-nil, the completion list of 'M-x' shows equivalent key bindings for all commands that have them. diff --git a/lisp/subr.el b/lisp/subr.el index ed235ee1f7..5e4f7dec7d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2820,6 +2820,15 @@ read-char-from-minibuffer (message "%s%s" prompt (char-to-string char)) char)) +(defun read-natnum-interactive (prompt) + "Get a natural number argument, optionally prompting with PROMPT. +If there is a natural number at point, use it as default." + (if (and current-prefix-arg (not (consp current-prefix-arg))) + (list (prefix-numeric-value current-prefix-arg)) + (let* ((number (number-at-point)) + (default (and (natnump number) number))) + (list (read-number prompt default))))) + ;; Behind display-popup-menus-p test. (declare-function x-popup-dialog "menu.c" (position contents &optional header)) diff --git a/src/editfns.c b/src/editfns.c index 4104edd77f..4723660b43 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -188,11 +188,16 @@ DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0, return build_marker (current_buffer, PT, PT_BYTE); } -DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ", +DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, + "(read-natnum-interactive \"Go to char: \")", doc: /* Set point to POSITION, a number or marker. Beginning of buffer is position (point-min), end is (point-max). -The return value is POSITION. */) +The return value is POSITION. + +If called interactively, a numeric prefix argument specifies +POSITION; without a numeric prefix argument, read POSITION from the +minibuffer. */) (register Lisp_Object position) { if (MARKERP (position)) -- 2.28.0 --=-=-=-- From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Dec 2020 10:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Cc: Lars Ingebrigtsen , 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.160794100027432 (code B ref 45199); Mon, 14 Dec 2020 10:17:02 +0000 Received: (at 45199) by debbugs.gnu.org; 14 Dec 2020 10:16:40 +0000 Received: from localhost ([127.0.0.1]:51268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kokuG-00078N-0N for submit@debbugs.gnu.org; Mon, 14 Dec 2020 05:16:40 -0500 Received: from mail-wr1-f52.google.com ([209.85.221.52]:42995) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kokuD-000786-1p for 45199@debbugs.gnu.org; Mon, 14 Dec 2020 05:16:38 -0500 Received: by mail-wr1-f52.google.com with SMTP id m5so15854598wrx.9 for <45199@debbugs.gnu.org>; Mon, 14 Dec 2020 02:16:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=oGgZfpsMBeIP56BA/ohzBRH+Z6uLJVf8RzlKv1rUFKU=; b=s0P5trMZMpF9rwsGV3Enhm7/2z2ds9hr0N5M3X1M6vkijZqLjd7zK01Hu/hqI6jmUf u6tlvTdftQ05TjROZ2hOo4hsFjDwnRzO3OOXafAN3u5uYhZlVMbtv8mL3BtS6SEsUgoF 96NBNBQRuVTwlZiTQM8Ss1WGam3ze5XQ461BRuh2iRYVYkL1c8ENowEB1dQd/lnlVl/B VBeeeBS3rQpi1p0GiJsVlsX5JaGSeAYslzbU+pHCc09Z0y7nGw34pz6hgrIbOFTnDNih PJv2hVEBNGCLwdXlvCRsYHpGCNE3jJGoaamfVQaB1gqMitVZCJNdtYAiSTMUWy8wbTuV 6ssw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=oGgZfpsMBeIP56BA/ohzBRH+Z6uLJVf8RzlKv1rUFKU=; b=khkB8TMZP7U/o54gZLJzqwC3LfTcP1peNAoAZliXh2DfkXLGkLh3I80i651oaIDBma vP9OE1w1jKyNtnhT0/syF+6J46oVHLtMSdBDn/YUkDvCHZ4Nn6N6UAlwuahDFC5/N/tY 8UWbhrSS5ClKVInSHgAGunimPKyOFtsKEZMJu87RQYnl5sRMXyqAADg24SFJ2guig42Y DwbzHZKHaVDzV7Lc+NhJO+zvbZjPsAVFdzVNrkzi+6LjNzKtb2T4ynlfg/3xgO2luVPx MyT/Mhv2DiSgK4r1+PnoOKQKTsq0forymoIZxWDygqToeTC40+mul/ntwppNgK2A0q8l LIIQ== X-Gm-Message-State: AOAM532VLu6v0cZkFw0s9Nt98uMYsLzSq2r2P8cEOFKwSRIiBlJTJ8Gd h7SyPePAR764XCwZlzZtbfVUmZ02mDk= X-Google-Smtp-Source: ABdhPJymyy0lPCdek0oHsaYt8vL5IwxACN77sYZKT7Ob1ytdEQyvF0yqgbHvKm8N/22kgWo0sWqUng== X-Received: by 2002:adf:e705:: with SMTP id c5mr27374198wrm.303.1607940990754; Mon, 14 Dec 2020 02:16:30 -0800 (PST) Received: from rltb ([2a01:e34:ecfc:a860:8bd:8b66:4245:1572]) by smtp.gmail.com with ESMTPSA id r2sm31305111wrn.83.2020.12.14.02.16.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 02:16:29 -0800 (PST) From: Robert Pluim References: <87o8iy975l.fsf@gnus.org> <87k0tl4zmc.fsf@gnus.org> Mail-Copies-To: never Gmane-Reply-To-List: yes Date: Mon, 14 Dec 2020 11:16:29 +0100 In-Reply-To: (unknown@unknown.invalid's message of "Sun, 13 Dec 2020 19:01:24 +0100") Message-ID: <87blewd75u.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Daniel Mart=C3=ADn writes: > Lars Ingebrigtsen writes: >> >> Yeah, I'd still rather have a helper function -- putting several lines >> of Lisp code in a string in C isn't optimal. > > OK, done. > The docstring for the function needs to mention the new behaviour as well. Robert From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Dec 2020 16:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Cc: 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.16079626718752 (code B ref 45199); Mon, 14 Dec 2020 16:18:02 +0000 Received: (at 45199) by debbugs.gnu.org; 14 Dec 2020 16:17:51 +0000 Received: from localhost ([127.0.0.1]:53949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koqXm-0002H5-Mk for submit@debbugs.gnu.org; Mon, 14 Dec 2020 11:17:50 -0500 Received: from quimby.gnus.org ([95.216.78.240]:44552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koqXk-0002Go-1Z for 45199@debbugs.gnu.org; Mon, 14 Dec 2020 11:17:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qjhbfaVhJ3Q3dg6mOxbZp8L6HNRpuX5GyPRVUsKAOS0=; b=P0f1j9IJhveLqNsGKivdJsr1yP bTFdIfROvyehLPrTvzWlcz3hMxz+BN+8f5g1u1JfSlE4x0i92XQa9TDliZ/kDrzsOK1lU1uMUnXnF yHF7961SDJ8w6+kBLh8J/mlXC+nzkKc8FWr95v2JSu7zw526JuZmjQPU0uM2vw+EKZcs=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koqXT-0004FD-GJ; Mon, 14 Dec 2020 17:17:41 +0100 From: Lars Ingebrigtsen References: <87o8iy975l.fsf@gnus.org> <87k0tl4zmc.fsf@gnus.org> X-Now-Playing: Laurie Freelove's _Songs From The Nineline_: "I Don't Care Anymore" Date: Mon, 14 Dec 2020 17:17:29 +0100 In-Reply-To: ("Daniel =?UTF-8?Q?Mart=C3=ADn?="'s message of "Sun, 13 Dec 2020 19:01:24 +0100") Message-ID: <87czzc1hwm.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Daniel =?UTF-8?Q?Mart=C3=ADn?= writes: > Lars Ingebrigtsen writes: >> >> Yeah, I'd still rather have a helper function -- putting several lines >> of Lisp code in a string in C isn't optimal. > > OK, done. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Daniel Mart=C3=ADn writes: > Lars Ingebrigtsen writes: >> >> Yeah, I'd still rather have a helper function -- putting several lines >> of Lisp code in a string in C isn't optimal. > > OK, done. Great; I've now applied this to Emacs 28 (but made the helper function an internal function, and altered the doc string like Robert suggested). --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 14 11:17:58 2020 Received: (at control) by debbugs.gnu.org; 14 Dec 2020 16:17:58 +0000 Received: from localhost ([127.0.0.1]:53952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koqXt-0002HT-Vh for submit@debbugs.gnu.org; Mon, 14 Dec 2020 11:17:58 -0500 Received: from quimby.gnus.org ([95.216.78.240]:44566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koqXs-0002HD-H3 for control@debbugs.gnu.org; Mon, 14 Dec 2020 11:17:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=htBrYDmSyr5HAorEw8/MPxjffVjr++k7fyHLK9gjzWQ=; b=o1+DpEj/4zrT5Si9xJsOJXEUMA 9wV2d3dQPA4hCx49KSurnrF+qB9TqkhGCVrITqmH3/bEpGRcHnPZcCSeDMwRFAmr8SdgOiG7VVfBt dk1EPbQWag0Zj2UJJotECmYiF6wn8HrERLld0WVoxPPVkywZwj4W1YEzv1WLWeSVgR9I=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koqXl-0004FT-0Q for control@debbugs.gnu.org; Mon, 14 Dec 2020 17:17:51 +0100 Date: Mon, 14 Dec 2020 17:17:47 +0100 Message-Id: <87blew1hw4.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #45199 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 45199 + confirmed quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 45199 + confirmed quit From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 14 11:18:03 2020 Received: (at control) by debbugs.gnu.org; 14 Dec 2020 16:18:03 +0000 Received: from localhost ([127.0.0.1]:53959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koqXz-0002ID-73 for submit@debbugs.gnu.org; Mon, 14 Dec 2020 11:18:03 -0500 Received: from quimby.gnus.org ([95.216.78.240]:44578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koqXw-0002HJ-W3 for control@debbugs.gnu.org; Mon, 14 Dec 2020 11:18:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cbDZgNfS/d93204IqRygYcmwU+djaB5x092YL5TgNko=; b=VXu/6BZKtN7dYQHV7W/GoxfQ5M Zljvaol+6iPzo2kYrAit6Ouyos3pfvMZ9NXe5eAhT1TzvEbs5SYUTys3tojBoOm7OHj+FfoGw70Xv NOW8Y5iN1cdiBnj57DWeqomjuQ34dG+ZVNgcC+DG3rHZF+DRmpH6VvBNa28L7rViXF/w=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koqXp-0004Fd-Gp for control@debbugs.gnu.org; Mon, 14 Dec 2020 17:17:55 +0100 Date: Mon, 14 Dec 2020 17:17:52 +0100 Message-Id: <87a6ug1hvz.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #45199 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 45199 fixed close 45199 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 45199 fixed close 45199 28.1 quit From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Dec 2020 19:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed fixed To: 45199@debbugs.gnu.org Cc: larsi@gnus.org, mardani29@yahoo.es X-Debbugs-Original-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Lars Ingebrigtsen , 45199@debbugs.gnu.org, Daniel =?UTF-8?Q?Mart=C3=ADn?= Received: via spool by submit@debbugs.gnu.org id=B.16079758307190 (code B ref -1); Mon, 14 Dec 2020 19:58:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Dec 2020 19:57:10 +0000 Received: from localhost ([127.0.0.1]:54606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koty2-0001rt-Dj for submit@debbugs.gnu.org; Mon, 14 Dec 2020 14:57:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:55964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koty1-0001rh-Jc for submit@debbugs.gnu.org; Mon, 14 Dec 2020 14:57:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koty1-0003r6-Ai for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2020 14:57:09 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:47647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kotxz-0002he-5h for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2020 14:57:08 -0500 Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 1E56920000B; Mon, 14 Dec 2020 19:57:01 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <87o8iy975l.fsf@gnus.org> <87k0tl4zmc.fsf@gnus.org> Date: Mon, 14 Dec 2020 21:29:08 +0200 In-Reply-To: ("Daniel =?UTF-8?Q?Mart=C3=ADn?= via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\""'s message of "Sun, 13 Dec 2020 19:01:24 +0100") Message-ID: <874kko72pn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.178.232; envelope-from=juri@linkov.net; helo=relay12.mail.gandi.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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) >> Yeah, I'd still rather have a helper function -- putting several lines >> of Lisp code in a string in C isn't optimal. > > OK, done. Shouldn't goto-line use the same function to read a number? The first version of your patch used the code similar to goto-line-read-args, so wouldn't it make sense to use the new function in goto-line-read-args as well? From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Dec 2020 06:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed fixed To: Juri Linkov Cc: 45199@debbugs.gnu.org, mardani29@yahoo.es X-Debbugs-Original-Cc: "Daniel =?UTF-8?Q?Mart=C3=ADn?= via Bug reports for GNU Emacs, the Swiss army knife of text editors" , 45199@debbugs.gnu.org, Daniel =?UTF-8?Q?Mart=C3=ADn?= Received: via spool by submit@debbugs.gnu.org id=B.160801387922506 (code B ref -1); Tue, 15 Dec 2020 06:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Dec 2020 06:31:19 +0000 Received: from localhost ([127.0.0.1]:55122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kp3rj-0005qr-1o for submit@debbugs.gnu.org; Tue, 15 Dec 2020 01:31:19 -0500 Received: from lists.gnu.org ([209.51.188.17]:44506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kp3rg-0005qc-U2 for submit@debbugs.gnu.org; Tue, 15 Dec 2020 01:31:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kp3rg-0008GS-LS for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2020 01:31:16 -0500 Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:41880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kp3re-0000PB-T1 for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2020 01:31:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=y4H//dnLbH6fQr4s9SVYiP21szxH2pgyLKMnM1ew3Qw=; b=mMedNbB6MucSaIuHRKFulmPYvc IedVhwuD9D805Po0zJlg/ykzbOEQ9PfxjDtvk0cv1k9/H4wxLTN7xzXJ1PyozIP4Tvkn8Sl1q0ObK 5UmHENlQmIDri2E6Ovn1pr6c4yzxbRvg4Evncq/CdksvfGyJYRWbFglGuDDg94uMVv2c=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kp3rP-0005vY-2N; Tue, 15 Dec 2020 07:31:09 +0100 From: Lars Ingebrigtsen References: <87o8iy975l.fsf@gnus.org> <87k0tl4zmc.fsf@gnus.org> <874kko72pn.fsf@mail.linkov.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEUoM2RORmJXIyWS Rz0pFhcgFBQhK1n///8YXJYjAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+QMDwYSBz6Pl6EAAAG6SURB VDjLbZNNjtwgEIWZTa3jG0RlvI/MBUakyLqFwGtW3P8IeQXYxiPTalri49Ufr435+sWr3R2vzu3M f8y0/LoxiwLh3zMQ5mgVWPEDFNI9CwcW75hDPBVVtxD9Frck3oY0ADWQk+W0ZREFZQ6VxYcckCfk f6aR2vagJOccUs4HdUULJUrw1XWUObno9QHaEY3k53WsDxkEo6FIPZjiz+iDevKEYHIqbiBYZ7Bj blC0zqb6EaoHWR2HG5TeOVZ0zvEFmoBuEB6hOvDcAd2dd7DyujcFTWMfAGNXsCzLOavQinLe2iuH 6UMUgUl2z9uzD4yDG9hD/p7fPEdYQYGVq49WVYIL/qIme3Xex04Jdos7XIUavodAH4XgqGBZXcen olZ1it9t9gIPsU3HDQx5FgAPIHBJKcVUBUR6wOy5ARzh/qkIaEQVCfbB/TuUTQynw9R42jLnYPgW Inj0U5tvq/4gB3pTgU3hU2o71HIr4zKnuGILRx1LVWw9UsddFRMohAxemkxmYBQAWdQb8gyMKmzr /Amovi0F5XzjJyD8I8qyfOFDD1CpvIbC0MwrqPqHe0/+XtbPMFe+/2td6gjK62nSAAAAJXRFWHRk YXRlOmNyZWF0ZQAyMDIwLTEyLTE1VDA2OjE4OjA3KzAwOjAwV6szdwAAACV0RVh0ZGF0ZTptb2Rp ZnkAMjAyMC0xMi0xNVQwNjoxODowNyswMDowMCb2i8sAAAAASUVORK5CYII= X-Now-Playing: Anne Pigalle's _Everything Could Be So Perfect..._: "He! Stranger..." Date: Tue, 15 Dec 2020 07:30:57 +0100 In-Reply-To: <874kko72pn.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 14 Dec 2020 21:29:08 +0200") Message-ID: <87eejr1sym.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: >>> Yeah, I'd still rather have a helper function -- putting several lines >>> of Lisp code in a string in C isn't optimal. >> >> OK, done. > > Shouldn't goto-line use the same function to read a numb [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org 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, 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-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Juri Linkov writes: >>> Yeah, I'd still rather have a helper function -- putting several lines >>> of Lisp code in a string in C isn't optimal. >> >> OK, done. > > Shouldn't goto-line use the same function to read a number? > The first version of your patch used the code similar to > goto-line-read-args, so wouldn't it make sense to use the > new function in goto-line-read-args as well? Reusing it directly would be awkward, but goto-line-read-args could indeed use number-at-point. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Dec 2020 08:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed fixed To: Lars Ingebrigtsen Cc: 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.160845471413908 (code B ref 45199); Sun, 20 Dec 2020 08:59:01 +0000 Received: (at 45199) by debbugs.gnu.org; 20 Dec 2020 08:58:34 +0000 Received: from localhost ([127.0.0.1]:43677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kquXy-0003cE-DK for submit@debbugs.gnu.org; Sun, 20 Dec 2020 03:58:34 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kquXt-0003bw-Lw for 45199@debbugs.gnu.org; Sun, 20 Dec 2020 03:58:33 -0500 X-Originating-IP: 91.129.99.98 Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 6DD091C0005; Sun, 20 Dec 2020 08:58:21 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <87o8iy975l.fsf@gnus.org> <87k0tl4zmc.fsf@gnus.org> <874kko72pn.fsf@mail.linkov.net> <87eejr1sym.fsf@gnus.org> Date: Sun, 20 Dec 2020 10:55:33 +0200 In-Reply-To: <87eejr1sym.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 15 Dec 2020 07:30:57 +0100") Message-ID: <87o8iorh4q.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> Shouldn't goto-line use the same function to read a number? >> The first version of your patch used the code similar to >> goto-line-read-args, so wouldn't it make sense to use the >> new function in goto-line-read-args as well? > > Reusing it directly would be awkward, but goto-line-read-args could > indeed use number-at-point. Here's a patch where it uses number-at-point: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=goto-line-read-args-number-at-point.patch diff --git a/lisp/simple.el b/lisp/simple.el index f79543058b..e17f2b0fc2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1276,15 +1276,8 @@ goto-line-read-args (if (and current-prefix-arg (not (consp current-prefix-arg))) (list (prefix-numeric-value current-prefix-arg)) ;; Look for a default, a number in the buffer at point. - (let* ((default - (save-excursion - (skip-chars-backward "0-9") - (if (looking-at "[0-9]") - (string-to-number - (buffer-substring-no-properties - (point) - (progn (skip-chars-forward "0-9") - (point))))))) + (let* ((number (number-at-point)) + (default (and (natnump number) number)) ;; Decide if we're switching buffers. (buffer (if (consp current-prefix-arg) --=-=-= Content-Type: text/plain Also this patch adds the same useful property from goto-line to goto-char. When there is no number at point, then M-n gets the current char position number for editing, so the user can decrease or increase it relative to the current position: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=goto-char-default-point.patch diff --git a/lisp/subr.el b/lisp/subr.el index 275e224b55..c7b7ac6444 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2828,7 +2828,7 @@ goto-char--read-natnum-interactive (list (prefix-numeric-value current-prefix-arg)) (let* ((number (number-at-point)) (default (and (natnump number) number))) - (list (read-number prompt default))))) + (list (read-number prompt (list default (point))))))) ;; Behind display-popup-menus-p test. --=-=-=-- From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Dec 2020 17:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed fixed To: Juri Linkov Cc: 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.160848692117715 (code B ref 45199); Sun, 20 Dec 2020 17:56:02 +0000 Received: (at 45199) by debbugs.gnu.org; 20 Dec 2020 17:55:21 +0000 Received: from localhost ([127.0.0.1]:45554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr2vR-0004bf-I9 for submit@debbugs.gnu.org; Sun, 20 Dec 2020 12:55:21 -0500 Received: from quimby.gnus.org ([95.216.78.240]:60524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr2vQ-0004bQ-1p for 45199@debbugs.gnu.org; Sun, 20 Dec 2020 12:55:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=J9jrfY7f1Qy570JDNPdb2f/obBUresn/wXZYybhlgn4=; b=oDRYMQ9KrYojDgfthsnF3wOuHW sGeUo3YFQlj0boM1LXUpfJUBvsA2RmDkCGKKVkuWEnK5xDl9GMuc2tfpBK1A/zghGTk5C2dbaCx9b TuXNwbcsrEh8sViFK2CHbf69aqHx0HMYFgjr2izI405M4EtqmBOkbpm8QZuIA6sFthxs=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kr2vH-0002rU-GW; Sun, 20 Dec 2020 18:55:14 +0100 From: Lars Ingebrigtsen References: <87o8iy975l.fsf@gnus.org> <87k0tl4zmc.fsf@gnus.org> <874kko72pn.fsf@mail.linkov.net> <87eejr1sym.fsf@gnus.org> <87o8iorh4q.fsf@mail.linkov.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUgCA9THyGdZ1Zq S0jTvbf///8dkPdbAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+QMFBEZJOFtWnMAAAG2SURBVDjLdZRr FuMgCIXhZAMSN1AxC/DRDYx1/2sawGhq54w/mlO+IHC9BuBrnc4BOCDQ5/c6ggUEUN0J2S8qWTE/ w0C1pLziWGRv+4ucgcY7RORZAFYtgefnTkbytfQrCldAhcMA5C/m3jtncijFSsgwuitX19U4G+AX gFUj7mO1bDU4zUavG3SuWv79L/ggJektOvR5z3DS11EJ8MANtExLlB1EP2WRJz6g8wS1ahpvAJfM WL5ABhTRKBs5x1589aZAkshqAF7WUYlX88nEtgxJPSUuUnbWDAGi99321SOdfLV2io4royZ4S1kX ubdC4NMRLANLENAKNykuolA4E6ks5BVIzDrjUGrOuhXqSa7ZQ3aivFaRc+npAUmPHW0OLM0t8IHh BxuwRFjgpVONFBEkPCANCW1qQJFnljCbLHPCfwA8oNUfMGsoSFsGTzPADo55gBmO/ZIR1QnSXoS8 uTqMAb+KkJ1ufIkP0+HrfWtF+bfuFEWSI3HJZiu14mzKFEw6yugBHw1Xn+MxHffnF3i+L9sPQLmo g9in5PGuxNd53IOoe0is1h8wXjanlucavGwDp+AvqG13L9fgKPcAAAAldEVYdGRhdGU6Y3JlYXRl ADIwMjAtMTItMjBUMTc6MjU6MzYrMDA6MDB6FWzwAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTEy LTIwVDE3OjI1OjM2KzAwOjAwC0jUTAAAAABJRU5ErkJggg== X-Now-Playing: Jane Siberry's _When I Was A Boy_: "The Gospel According To Darkness" Date: Sun, 20 Dec 2020 18:55:09 +0100 In-Reply-To: <87o8iorh4q.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 20 Dec 2020 10:55:33 +0200") Message-ID: <878s9scqgy.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > Here's a patch where it uses number-at-point: Looks good to me. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > Here's a patch where it uses number-at-point: Looks good to me. > Also this patch adds the same useful property from goto-line to goto-char. > When there is no number at point, then M-n gets the current char position > number for editing, so the user can decrease or increase it > relative to the current position: Yeah, that sounds useful. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Aug 16 16:17:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Dec 2020 20:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed fixed To: Lars Ingebrigtsen Cc: 45199@debbugs.gnu.org Received: via spool by 45199-submit@debbugs.gnu.org id=B45199.160849487713717 (code B ref 45199); Sun, 20 Dec 2020 20:08:02 +0000 Received: (at 45199) by debbugs.gnu.org; 20 Dec 2020 20:07:57 +0000 Received: from localhost ([127.0.0.1]:45669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr4zl-0003ZB-5h for submit@debbugs.gnu.org; Sun, 20 Dec 2020 15:07:57 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:46073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr4zi-0003Yk-Os for 45199@debbugs.gnu.org; Sun, 20 Dec 2020 15:07:55 -0500 X-Originating-IP: 91.129.99.98 Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 8844D1C0002; Sun, 20 Dec 2020 20:07:47 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <87o8iy975l.fsf@gnus.org> <87k0tl4zmc.fsf@gnus.org> <874kko72pn.fsf@mail.linkov.net> <87eejr1sym.fsf@gnus.org> <87o8iorh4q.fsf@mail.linkov.net> <878s9scqgy.fsf@gnus.org> Date: Sun, 20 Dec 2020 22:06:13 +0200 In-Reply-To: <878s9scqgy.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 20 Dec 2020 18:55:09 +0100") Message-ID: <87zh28nsy2.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Here's a patch where it uses number-at-point: > > Looks good to me. > >> Also this patch adds the same useful property from goto-line to goto-char. >> When there is no number at point, then M-n gets the current char position >> number for editing, so the user can decrease or increase it >> relative to the current position: > > Yeah, that sounds useful. Now pushed to master.