diff options
author | Juri Linkov <juri@linkov.net> | 2020-12-20 22:05:51 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2020-12-20 22:05:51 +0200 |
commit | 1a7033f1f3de4ad8c1bfd68b54e6c9d8444a3bcc (patch) | |
tree | c00b75bf5a22e63f5ac7fa843a01bd66b7a9e231 /lisp/subr.el | |
parent | ecb5ebf156280be1859f181208306e4c55af3e80 (diff) | |
download | emacs-1a7033f1f3de4ad8c1bfd68b54e6c9d8444a3bcc.tar.gz emacs-1a7033f1f3de4ad8c1bfd68b54e6c9d8444a3bcc.tar.bz2 emacs-1a7033f1f3de4ad8c1bfd68b54e6c9d8444a3bcc.zip |
* lisp/simple.el (goto-line-read-args): Use number-at-point (bug#45199)
* lisp/subr.el (goto-char--read-natnum-interactive): Add the value of
point to the end of default values, and move function slightly higher.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index cb64b3f6e74..9527f7120aa 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2719,6 +2719,15 @@ floating point support." (push (cons t read) unread-command-events) nil)))))) +(defun goto-char--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 (list default (point))))))) + (defvar read-char-history nil "The default history for the `read-char-from-minibuffer' function.") @@ -2820,15 +2829,6 @@ There is no need to explicitly add `help-char' to CHARS; (message "%s%s" prompt (char-to-string char)) char)) -(defun goto-char--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)) |