* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
@ 2017-05-24 11:19 kwc3iywb
2017-05-24 18:03 ` Glenn Morris
2017-05-27 13:13 ` Eli Zaretskii
0 siblings, 2 replies; 11+ messages in thread
From: kwc3iywb @ 2017-05-24 11:19 UTC (permalink / raw)
To: 27056
[-- Attachment #1.1: Type: text/plain, Size: 3770 bytes --]
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)))
[-- Attachment #1.2: 0001-index-on-master-bf4f69ab6d-vc-hg.el-Silence-byte-com.patch --]
[-- Type: text/x-diff, Size: 0 bytes --]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-24 11:19 bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number kwc3iywb
@ 2017-05-24 18:03 ` Glenn Morris
2017-05-25 2:29 ` kwc3iywb
` (4 more replies)
2017-05-27 13:13 ` Eli Zaretskii
1 sibling, 5 replies; 11+ messages in thread
From: Glenn Morris @ 2017-05-24 18:03 UTC (permalink / raw)
To: kwc3iywb; +Cc: 27056
kwc3iywb@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?
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-24 18:03 ` Glenn Morris
@ 2017-05-25 2:29 ` kwc3iywb
2017-05-25 8:52 ` kwc3iywb
` (3 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: kwc3iywb @ 2017-05-25 2:29 UTC (permalink / raw)
To: Glenn Morris; +Cc: 27056
[-- Attachment #1.1: Type: text/plain, Size: 247 bytes --]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb@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.
[-- Attachment #1.2: 0001-Make-goto-line-default-to-current-line-when-cursor-i.patch --]
[-- Type: text/x-diff, Size: 3077 bytes --]
From 0317935b8af1701de3feb8d0469e5aea17b4f38a Mon Sep 17 00:00:00 2001
From: kwc3iywb <kwc3iywb@vfemail.net>
Date: Thu, 25 May 2017 02:07:18 +0000
Subject: [PATCH] Make goto-line default to current line when cursor isn't over
a number
* lisp/simple.el (goto-line): When used interactively, default to
current line if the cursor isn't over a number, and remain defaulting
to the number under the cursor and putting the current line in the
history when the cursor is over a number.
* lisp/subr.el (read-number): Add in its description that it can accept
a list of default values.
---
lisp/simple.el | 4 +++-
lisp/subr.el | 28 +++++++++++++---------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index ea3a495fbc..bd865288b1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1157,7 +1157,9 @@ rather than line counts."
"")))
;; Read the argument, offering that number (if any) as default.
(list (read-number (format "Goto line%s: " buffer-prompt)
- (list default (line-number-at-pos)))
+ (if default
+ (list default (line-number-at-pos))
+ (line-number-at-pos)))
buffer))))
;; Switch to the desired buffer, one way or another.
(if buffer
diff --git a/lisp/subr.el b/lisp/subr.el
index 8d5d2a779c..d9cb62b2db 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2312,25 +2312,23 @@ by doing (clear-string STRING)."
(defun read-number (prompt &optional default)
"Read a numeric value in the minibuffer, prompting with PROMPT.
DEFAULT specifies a default value to return if the user just types RET.
-The value of DEFAULT is inserted into PROMPT.
+The value of DEFAULT is inserted into PROMPT. DEFAULT can also be a
+list of numbers, in which case all the numbers are available in the
+history, and the first is the default.
This function is used by the `interactive' code letter `n'."
+ (if (not (listp default))
+ (setq default (list default)))
(let ((n nil)
- (default1 (if (consp default) (car default) default)))
- (when default1
- (setq prompt
- (if (string-match "\\(\\):[ \t]*\\'" prompt)
- (replace-match (format " (default %s)" default1) t t prompt 1)
- (replace-regexp-in-string "[ \t]*\\'"
- (format " (default %s) " default1)
- prompt t t))))
+ (default1 (car default))
+ (default-str (mapcar 'number-to-string default)))
+ (when default
+ (cl-assert (string-match "\\(\\)\\(:[[:blank:]]*\\)?\\'" prompt))
+ (setq prompt (replace-match
+ (format " (default %s)" (car default-str))
+ t t prompt 1)))
(while
(progn
- (let ((str (read-from-minibuffer
- prompt nil nil nil nil
- (when default
- (if (consp default)
- (mapcar 'number-to-string (delq nil default))
- (number-to-string default))))))
+ (let ((str (read-string prompt nil nil default-str)))
(condition-case nil
(setq n (cond
((zerop (length str)) default1)
--
2.12.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-24 18:03 ` Glenn Morris
2017-05-25 2:29 ` kwc3iywb
@ 2017-05-25 8:52 ` kwc3iywb
2017-05-25 9:41 ` kwc3iywb
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: kwc3iywb @ 2017-05-25 8:52 UTC (permalink / raw)
To: Glenn Morris; +Cc: 27056
[-- Attachment #1.1: Type: text/plain, Size: 248 bytes --]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb@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.
[-- Attachment #1.2: 0001-Make-goto-line-default-to-current-line-when-cursor-i.patch --]
[-- Type: text/x-diff, Size: 3077 bytes --]
From 0317935b8af1701de3feb8d0469e5aea17b4f38a Mon Sep 17 00:00:00 2001
From: kwc3iywb <kwc3iywb@vfemail.net>
Date: Thu, 25 May 2017 02:07:18 +0000
Subject: [PATCH] Make goto-line default to current line when cursor isn't over
a number
* lisp/simple.el (goto-line): When used interactively, default to
current line if the cursor isn't over a number, and remain defaulting
to the number under the cursor and putting the current line in the
history when the cursor is over a number.
* lisp/subr.el (read-number): Add in its description that it can accept
a list of default values.
---
lisp/simple.el | 4 +++-
lisp/subr.el | 28 +++++++++++++---------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index ea3a495fbc..bd865288b1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1157,7 +1157,9 @@ rather than line counts."
"")))
;; Read the argument, offering that number (if any) as default.
(list (read-number (format "Goto line%s: " buffer-prompt)
- (list default (line-number-at-pos)))
+ (if default
+ (list default (line-number-at-pos))
+ (line-number-at-pos)))
buffer))))
;; Switch to the desired buffer, one way or another.
(if buffer
diff --git a/lisp/subr.el b/lisp/subr.el
index 8d5d2a779c..d9cb62b2db 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2312,25 +2312,23 @@ by doing (clear-string STRING)."
(defun read-number (prompt &optional default)
"Read a numeric value in the minibuffer, prompting with PROMPT.
DEFAULT specifies a default value to return if the user just types RET.
-The value of DEFAULT is inserted into PROMPT.
+The value of DEFAULT is inserted into PROMPT. DEFAULT can also be a
+list of numbers, in which case all the numbers are available in the
+history, and the first is the default.
This function is used by the `interactive' code letter `n'."
+ (if (not (listp default))
+ (setq default (list default)))
(let ((n nil)
- (default1 (if (consp default) (car default) default)))
- (when default1
- (setq prompt
- (if (string-match "\\(\\):[ \t]*\\'" prompt)
- (replace-match (format " (default %s)" default1) t t prompt 1)
- (replace-regexp-in-string "[ \t]*\\'"
- (format " (default %s) " default1)
- prompt t t))))
+ (default1 (car default))
+ (default-str (mapcar 'number-to-string default)))
+ (when default
+ (cl-assert (string-match "\\(\\)\\(:[[:blank:]]*\\)?\\'" prompt))
+ (setq prompt (replace-match
+ (format " (default %s)" (car default-str))
+ t t prompt 1)))
(while
(progn
- (let ((str (read-from-minibuffer
- prompt nil nil nil nil
- (when default
- (if (consp default)
- (mapcar 'number-to-string (delq nil default))
- (number-to-string default))))))
+ (let ((str (read-string prompt nil nil default-str)))
(condition-case nil
(setq n (cond
((zerop (length str)) default1)
--
2.12.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-24 18:03 ` Glenn Morris
2017-05-25 2:29 ` kwc3iywb
2017-05-25 8:52 ` kwc3iywb
@ 2017-05-25 9:41 ` kwc3iywb
2017-05-25 10:21 ` kwc3iywb
2017-05-27 2:38 ` kwc3iywb
4 siblings, 0 replies; 11+ messages in thread
From: kwc3iywb @ 2017-05-25 9:41 UTC (permalink / raw)
To: Glenn Morris; +Cc: 27056
[-- Attachment #1.1: Type: text/plain, Size: 248 bytes --]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb@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.
[-- Attachment #1.2: 0001-Make-goto-line-default-to-current-line-when-cursor-i.patch --]
[-- Type: text/x-diff, Size: 3077 bytes --]
From 0317935b8af1701de3feb8d0469e5aea17b4f38a Mon Sep 17 00:00:00 2001
From: kwc3iywb <kwc3iywb@vfemail.net>
Date: Thu, 25 May 2017 02:07:18 +0000
Subject: [PATCH] Make goto-line default to current line when cursor isn't over
a number
* lisp/simple.el (goto-line): When used interactively, default to
current line if the cursor isn't over a number, and remain defaulting
to the number under the cursor and putting the current line in the
history when the cursor is over a number.
* lisp/subr.el (read-number): Add in its description that it can accept
a list of default values.
---
lisp/simple.el | 4 +++-
lisp/subr.el | 28 +++++++++++++---------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index ea3a495fbc..bd865288b1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1157,7 +1157,9 @@ rather than line counts."
"")))
;; Read the argument, offering that number (if any) as default.
(list (read-number (format "Goto line%s: " buffer-prompt)
- (list default (line-number-at-pos)))
+ (if default
+ (list default (line-number-at-pos))
+ (line-number-at-pos)))
buffer))))
;; Switch to the desired buffer, one way or another.
(if buffer
diff --git a/lisp/subr.el b/lisp/subr.el
index 8d5d2a779c..d9cb62b2db 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2312,25 +2312,23 @@ by doing (clear-string STRING)."
(defun read-number (prompt &optional default)
"Read a numeric value in the minibuffer, prompting with PROMPT.
DEFAULT specifies a default value to return if the user just types RET.
-The value of DEFAULT is inserted into PROMPT.
+The value of DEFAULT is inserted into PROMPT. DEFAULT can also be a
+list of numbers, in which case all the numbers are available in the
+history, and the first is the default.
This function is used by the `interactive' code letter `n'."
+ (if (not (listp default))
+ (setq default (list default)))
(let ((n nil)
- (default1 (if (consp default) (car default) default)))
- (when default1
- (setq prompt
- (if (string-match "\\(\\):[ \t]*\\'" prompt)
- (replace-match (format " (default %s)" default1) t t prompt 1)
- (replace-regexp-in-string "[ \t]*\\'"
- (format " (default %s) " default1)
- prompt t t))))
+ (default1 (car default))
+ (default-str (mapcar 'number-to-string default)))
+ (when default
+ (cl-assert (string-match "\\(\\)\\(:[[:blank:]]*\\)?\\'" prompt))
+ (setq prompt (replace-match
+ (format " (default %s)" (car default-str))
+ t t prompt 1)))
(while
(progn
- (let ((str (read-from-minibuffer
- prompt nil nil nil nil
- (when default
- (if (consp default)
- (mapcar 'number-to-string (delq nil default))
- (number-to-string default))))))
+ (let ((str (read-string prompt nil nil default-str)))
(condition-case nil
(setq n (cond
((zerop (length str)) default1)
--
2.12.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-24 18:03 ` Glenn Morris
` (2 preceding siblings ...)
2017-05-25 9:41 ` kwc3iywb
@ 2017-05-25 10:21 ` kwc3iywb
2017-05-27 2:38 ` kwc3iywb
4 siblings, 0 replies; 11+ messages in thread
From: kwc3iywb @ 2017-05-25 10:21 UTC (permalink / raw)
To: Glenn Morris; +Cc: 27056
[-- Attachment #1.1: Type: text/plain, Size: 248 bytes --]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb@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.
[-- Attachment #1.2: 0001-Make-goto-line-default-to-current-line-when-cursor-i.patch --]
[-- Type: text/x-diff, Size: 3077 bytes --]
From 0317935b8af1701de3feb8d0469e5aea17b4f38a Mon Sep 17 00:00:00 2001
From: kwc3iywb <kwc3iywb@vfemail.net>
Date: Thu, 25 May 2017 02:07:18 +0000
Subject: [PATCH] Make goto-line default to current line when cursor isn't over
a number
* lisp/simple.el (goto-line): When used interactively, default to
current line if the cursor isn't over a number, and remain defaulting
to the number under the cursor and putting the current line in the
history when the cursor is over a number.
* lisp/subr.el (read-number): Add in its description that it can accept
a list of default values.
---
lisp/simple.el | 4 +++-
lisp/subr.el | 28 +++++++++++++---------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index ea3a495fbc..bd865288b1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1157,7 +1157,9 @@ rather than line counts."
"")))
;; Read the argument, offering that number (if any) as default.
(list (read-number (format "Goto line%s: " buffer-prompt)
- (list default (line-number-at-pos)))
+ (if default
+ (list default (line-number-at-pos))
+ (line-number-at-pos)))
buffer))))
;; Switch to the desired buffer, one way or another.
(if buffer
diff --git a/lisp/subr.el b/lisp/subr.el
index 8d5d2a779c..d9cb62b2db 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2312,25 +2312,23 @@ by doing (clear-string STRING)."
(defun read-number (prompt &optional default)
"Read a numeric value in the minibuffer, prompting with PROMPT.
DEFAULT specifies a default value to return if the user just types RET.
-The value of DEFAULT is inserted into PROMPT.
+The value of DEFAULT is inserted into PROMPT. DEFAULT can also be a
+list of numbers, in which case all the numbers are available in the
+history, and the first is the default.
This function is used by the `interactive' code letter `n'."
+ (if (not (listp default))
+ (setq default (list default)))
(let ((n nil)
- (default1 (if (consp default) (car default) default)))
- (when default1
- (setq prompt
- (if (string-match "\\(\\):[ \t]*\\'" prompt)
- (replace-match (format " (default %s)" default1) t t prompt 1)
- (replace-regexp-in-string "[ \t]*\\'"
- (format " (default %s) " default1)
- prompt t t))))
+ (default1 (car default))
+ (default-str (mapcar 'number-to-string default)))
+ (when default
+ (cl-assert (string-match "\\(\\)\\(:[[:blank:]]*\\)?\\'" prompt))
+ (setq prompt (replace-match
+ (format " (default %s)" (car default-str))
+ t t prompt 1)))
(while
(progn
- (let ((str (read-from-minibuffer
- prompt nil nil nil nil
- (when default
- (if (consp default)
- (mapcar 'number-to-string (delq nil default))
- (number-to-string default))))))
+ (let ((str (read-string prompt nil nil default-str)))
(condition-case nil
(setq n (cond
((zerop (length str)) default1)
--
2.12.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-24 18:03 ` Glenn Morris
` (3 preceding siblings ...)
2017-05-25 10:21 ` kwc3iywb
@ 2017-05-27 2:38 ` kwc3iywb
4 siblings, 0 replies; 11+ messages in thread
From: kwc3iywb @ 2017-05-27 2:38 UTC (permalink / raw)
To: Glenn Morris; +Cc: 27056
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
On Wed, May 24, 2017 at 02:03:16PM -0400, Glenn Morris wrote:
> kwc3iywb@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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-24 11:19 bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number kwc3iywb
2017-05-24 18:03 ` Glenn Morris
@ 2017-05-27 13:13 ` Eli Zaretskii
2017-05-28 8:11 ` kwc3iywb
2017-05-28 8:18 ` kwc3iywb
1 sibling, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2017-05-27 13:13 UTC (permalink / raw)
To: kwc3iywb; +Cc: 27056
> Date: Wed, 24 May 2017 11:19:37 +0000
> From: kwc3iywb@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?
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-27 13:13 ` Eli Zaretskii
@ 2017-05-28 8:11 ` kwc3iywb
2017-05-28 8:18 ` kwc3iywb
1 sibling, 0 replies; 11+ messages in thread
From: kwc3iywb @ 2017-05-28 8:11 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 27056
[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]
On Sat, May 27, 2017 at 04:13:34PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 24 May 2017 11:19:37 +0000
> > From: kwc3iywb@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>.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-27 13:13 ` Eli Zaretskii
2017-05-28 8:11 ` kwc3iywb
@ 2017-05-28 8:18 ` kwc3iywb
2017-05-28 15:03 ` Eli Zaretskii
1 sibling, 1 reply; 11+ messages in thread
From: kwc3iywb @ 2017-05-28 8:18 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 27056
[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]
On Sat, May 27, 2017 at 04:13:34PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 24 May 2017 11:19:37 +0000
> > From: kwc3iywb@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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number
2017-05-28 8:18 ` kwc3iywb
@ 2017-05-28 15:03 ` Eli Zaretskii
0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2017-05-28 15:03 UTC (permalink / raw)
To: kwc3iywb; +Cc: 27056-done
> Date: Sun, 28 May 2017 08:18:53 +0000
> From: kwc3iywb@vfemail.net
> Cc: 27056@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.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-05-28 15:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-24 11:19 bug#27056: 25.2; goto-line doesn't default to current line when used interactively when the cursor isn't over a number kwc3iywb
2017-05-24 18:03 ` Glenn Morris
2017-05-25 2:29 ` kwc3iywb
2017-05-25 8:52 ` kwc3iywb
2017-05-25 9:41 ` kwc3iywb
2017-05-25 10:21 ` kwc3iywb
2017-05-27 2:38 ` kwc3iywb
2017-05-27 13:13 ` Eli Zaretskii
2017-05-28 8:11 ` kwc3iywb
2017-05-28 8:18 ` kwc3iywb
2017-05-28 15:03 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.