unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Daniel Martín" <mardani29@yahoo.es>
Cc: 45199@debbugs.gnu.org
Subject: bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default
Date: Sat, 12 Dec 2020 20:05:42 +0100	[thread overview]
Message-ID: <87o8iy975l.fsf@gnus.org> (raw)
In-Reply-To: <m1h7orj7uw.fsf@yahoo.es> ("Daniel Martín"'s message of "Sat, 12 Dec 2020 17:40:23 +0100")

Daniel Martín <mardani29@yahoo.es> 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?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2020-12-12 19:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1h7orj7uw.fsf.ref@yahoo.es>
2020-12-12 16:40 ` bug#45199: 28.0.50; [PATCH] Make goto-char offer the number at point as default Unknown
2020-12-12 19:05   ` Lars Ingebrigtsen [this message]
2020-12-13  1:23     ` Unknown
2020-12-13 13:14       ` Lars Ingebrigtsen
2020-12-13 18:01         ` Unknown
2020-12-14 10:16           ` Robert Pluim
2020-12-14 16:17           ` Lars Ingebrigtsen
2020-12-14 19:29           ` Juri Linkov
2020-12-15  6:30             ` Lars Ingebrigtsen
2020-12-20  8:55               ` Juri Linkov
2020-12-20 17:55                 ` Lars Ingebrigtsen
2020-12-20 20:06                   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8iy975l.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=45199@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).