GNU bug report logs - #27056
25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number

Previous Next

Package: emacs;

Reported by: kwc3iywb <at> vfemail.net

Date: Wed, 24 May 2017 15:31:02 UTC

Severity: normal

Found in version 25.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27056 in the body.
You can then email your comments to 27056 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Wed, 24 May 2017 15:31:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to kwc3iywb <at> vfemail.net:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 24 May 2017 15:31:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: kwc3iywb <at> vfemail.net
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; goto-line doesn't default to current line when used
 interactively when the cursor isn't over a number
Date: Wed, 24 May 2017 11:19:37 +0000
[Message part 1 (text/plain, inline)]
In GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.10)
 of 2017-04-22 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe
 -fstack-protector-strong' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
  value of $LANG: C
  locale-coding-system: nil

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu
cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 86260 8956)
 (symbols 48 19773 0)
 (miscs 40 46 172)
 (strings 32 14306 4139)
 (string-bytes 1 409031)
 (vectors 16 11746)
 (vector-slots 8 430626 3614)
 (floats 8 166 79)
 (intervals 56 222 112)
 (buffers 976 18))

When I press M-x goto-line, it asks me for a line number.  There used to
be a default line number, which is the current line number before
a5dcc929862f6727c71db5e45d8750f8c322c53b.  It looks like he forgot to
remove the empty elements when calling `read-from-minibuffer' from
`read-number'.  I've included the patch I used to fix this problem.
It's not obvious that `read-number' should be responsible for removing
nil in DEFAULT, it's not documented, and I didn't find any code besides
`goto-line' that relies on this behavior after grepping all the lisp
files in emacs' source, so I rewrote `read-number', and made `goto-line'
responsible for removing nils.

By the way, when looking for uses of `read-number', I found in
lisp/tar-mode.el, in lines 1023 and 1051, conversion from integer to
string, which seemed unnecessary to me.

>(read-number
> "New UID number: "
> (format "%s" (tar-header-uid descriptor)))

>(read-number
> "New GID number: "
> (format "%s" (tar-header-gid descriptor)))
[0001-index-on-master-bf4f69ab6d-vc-hg.el-Silence-byte-com.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Wed, 24 May 2017 18:04:01 GMT) Full text and rfc822 format available.

Message #8 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: kwc3iywb <at> vfemail.net
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2;
 goto-line doesn't default to current line when used interactively
 when the cursor isn't over a number
Date: Wed, 24 May 2017 14:03:16 -0400
kwc3iywb <at> vfemail.net wrote:

> `read-number'.  I've included the patch I used to fix this problem.

It looks to me like you attached an empty file?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Thu, 25 May 2017 15:32:03 GMT) Full text and rfc822 format available.

Message #11 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: kwc3iywb <at> vfemail.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2; goto-line doesn't default to current line when
 used interactively when the cursor isn't over a number
Date: Thu, 25 May 2017 02:29:55 +0000
[Message part 1 (text/plain, inline)]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb <at> vfemail.net wrote:
>
> > `read-number'.  I've included the patch I used to fix this problem.
>
> It looks to me like you attached an empty file?
>

Sorry.  Here's the patch.
[0001-Make-goto-line-default-to-current-line-when-cursor-i.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Thu, 25 May 2017 15:32:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Thu, 25 May 2017 15:32:04 GMT) Full text and rfc822 format available.

Message #17 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: kwc3iywb <at> vfemail.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2; goto-line doesn't default to current line when
 used interactively when the cursor isn't over a number
Date: Thu, 25 May 2017 08:52:46 +0000
[Message part 1 (text/plain, inline)]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb <at> vfemail.net wrote:
>
> > `read-number'.  I've included the patch I used to fix this problem.
>
> It looks to me like you attached an empty file?
>

Sorry.  Here is the patch.
[0001-Make-goto-line-default-to-current-line-when-cursor-i.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Thu, 25 May 2017 15:32:05 GMT) Full text and rfc822 format available.

Message #20 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: kwc3iywb <at> vfemail.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2; goto-line doesn't default to current line when
 used interactively when the cursor isn't over a number
Date: Thu, 25 May 2017 09:41:36 +0000
[Message part 1 (text/plain, inline)]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb <at> vfemail.net wrote:
>
> > `read-number'.  I've included the patch I used to fix this problem.
>
> It looks to me like you attached an empty file?
>

Sorry.  Here is the patch.
[0001-Make-goto-line-default-to-current-line-when-cursor-i.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Thu, 25 May 2017 15:32:05 GMT) Full text and rfc822 format available.

Message #23 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: kwc3iywb <at> vfemail.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2; goto-line doesn't default to current line when
 used interactively when the cursor isn't over a number
Date: Thu, 25 May 2017 10:21:21 +0000
[Message part 1 (text/plain, inline)]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb <at> vfemail.net wrote:
>
> > `read-number'.  I've included the patch I used to fix this problem.
>
> It looks to me like you attached an empty file?
>

Sorry.  Here is the patch.
[0001-Make-goto-line-default-to-current-line-when-cursor-i.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Sat, 27 May 2017 02:39:01 GMT) Full text and rfc822 format available.

Message #26 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: kwc3iywb <at> vfemail.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2; goto-line doesn't default to current line when
 used interactively when the cursor isn't over a number
Date: Sat, 27 May 2017 02:38:26 +0000
[Message part 1 (text/plain, inline)]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb <at> vfemail.net wrote:
>
> > `read-number'.  I've included the patch I used to fix this problem.
>
> It looks to me like you attached an empty file?
>

I sent the patch.  Does it work?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Sat, 27 May 2017 13:14:02 GMT) Full text and rfc822 format available.

Message #29 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kwc3iywb <at> vfemail.net
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2;
 goto-line doesn't default to current line when used interactively
 when the cursor isn't over a number
Date: Sat, 27 May 2017 16:13:34 +0300
> Date: Wed, 24 May 2017 11:19:37 +0000
> From: kwc3iywb <at> vfemail.net
> 
> When I press M-x goto-line, it asks me for a line number.  There used to
> be a default line number, which is the current line number before
> a5dcc929862f6727c71db5e45d8750f8c322c53b.  It looks like he forgot to
> remove the empty elements when calling `read-from-minibuffer' from
> `read-number'.

Sorry, I don't think I understand the problem.  AFAIU, the default was
taken from the number at point, if any, when the command is invoked.
So I tried this:

  emacs -Q
  Type "2" and then move point back so the cursor is on "2"
  M-g M-g

This prompts in the echo area:

  Goto line (default 2): 

OTOH, if cursor isn't over a number, I get no default at all, even if
I try Emacs versions before that change, like Emacs 23.1 and 23.2 (or
even 22.1).

So it looks like the feature works as expected.  What am I missing?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Sun, 28 May 2017 08:20:02 GMT) Full text and rfc822 format available.

Message #32 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: kwc3iywb <at> vfemail.net
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2; goto-line doesn't default to current line when
 used interactively when the cursor isn't over a number
Date: Sun, 28 May 2017 08:18:53 +0000
[Message part 1 (text/plain, inline)]
On Sat, May 27, 2017 at 04:13:34PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 24 May 2017 11:19:37 +0000
> > From: kwc3iywb <at> vfemail.net
> >
> > When I press M-x goto-line, it asks me for a line number.  There used to
> > be a default line number, which is the current line number before
> > a5dcc929862f6727c71db5e45d8750f8c322c53b.  It looks like he forgot to
> > remove the empty elements when calling `read-from-minibuffer' from
> > `read-number'.
>
> Sorry, I don't think I understand the problem.  AFAIU, the default was
> taken from the number at point, if any, when the command is invoked.
> So I tried this:
>
>   emacs -Q
>   Type "2" and then move point back so the cursor is on "2"
>   M-g M-g
>
> This prompts in the echo area:
>
>   Goto line (default 2):
>
> OTOH, if cursor isn't over a number, I get no default at all, even if
> I try Emacs versions before that change, like Emacs 23.1 and 23.2 (or
> even 22.1).
>
> So it looks like the feature works as expected.  What am I missing?
>

Now, I understand that it's not a bug.  Thanks for your patience and
sorry for wasting your time.  How do I close this bug report?

When the cursor isn't on a number, invoke `goto-line', press <down>,
you'll get the current line number in the minibuffer.  The problem is
that I thought I should press <up> instead of <down>, so I thought there
was a bug.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27056; Package emacs. (Sun, 28 May 2017 08:26:02 GMT) Full text and rfc822 format available.

Message #35 received at 27056 <at> debbugs.gnu.org (full text, mbox):

From: kwc3iywb <at> vfemail.net
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 27056 <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2; goto-line doesn't default to current line when
 used interactively when the cursor isn't over a number
Date: Sun, 28 May 2017 08:11:19 +0000
[Message part 1 (text/plain, inline)]
On Sat, May 27, 2017 at 04:13:34PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 24 May 2017 11:19:37 +0000
> > From: kwc3iywb <at> vfemail.net
> >
> > When I press M-x goto-line, it asks me for a line number.  There used to
> > be a default line number, which is the current line number before
> > a5dcc929862f6727c71db5e45d8750f8c322c53b.  It looks like he forgot to
> > remove the empty elements when calling `read-from-minibuffer' from
> > `read-number'.
>
> Sorry, I don't think I understand the problem.  AFAIU, the default was
> taken from the number at point, if any, when the command is invoked.
> So I tried this:
>
>   emacs -Q
>   Type "2" and then move point back so the cursor is on "2"
>   M-g M-g
>
> This prompts in the echo area:
>
>   Goto line (default 2):
>
> OTOH, if cursor isn't over a number, I get no default at all, even if
> I try Emacs versions before that change, like Emacs 23.1 and 23.2 (or
> even 22.1).
>
> So it looks like the feature works as expected.  What am I missing?
>

Now, I understand.  So there is no such bug.  Thanks for your patience
and sorry for wasting your time.  How do I close this bug report?

I tried again, the feature introduced in
a5dcc929862f6727c71db5e45d8750f8c322c53b works.  When the cursor isn't
on a number, invoke `goto-line', press <down>, you get the current line
number in the minibuffer.  I thought I was supposed to press <up>
instead of <down>, so I there was a bug.  And I know that I can use C-a
or <home>.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sun, 28 May 2017 15:04:02 GMT) Full text and rfc822 format available.

Notification sent to kwc3iywb <at> vfemail.net:
bug acknowledged by developer. (Sun, 28 May 2017 15:04:02 GMT) Full text and rfc822 format available.

Message #40 received at 27056-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kwc3iywb <at> vfemail.net
Cc: 27056-done <at> debbugs.gnu.org
Subject: Re: bug#27056: 25.2; goto-line doesn't default to current line when
 used interactively when the cursor isn't over a number
Date: Sun, 28 May 2017 18:03:22 +0300
> Date: Sun, 28 May 2017 08:18:53 +0000
> From: kwc3iywb <at> vfemail.net
> Cc: 27056 <at> debbugs.gnu.org
> 
> Now, I understand that it's not a bug.  Thanks for your patience and
> sorry for wasting your time.

No sweat, and thanks for confirming.

> How do I close this bug report?

When you reply, change the bug address to NNNNN-done.  Like I did now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 26 Jun 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 305 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.