[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/rfc-mode 8587416c21 40/52: Add prefix argument support
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/rfc-mode 8587416c21 40/52: Add prefix argument support to rfc-mode-read |
Date: |
Wed, 12 Oct 2022 16:29:20 -0400 (EDT) |
branch: scratch/rfc-mode
commit 8587416c2123dd4dd1a7c2bc9207205e47e9b54a
Author: Daniel Martín <mardani29@yahoo.es>
Commit: Nicolas Martyanoff <khaelin@gmail.com>
Add prefix argument support to rfc-mode-read
It's common for Emacs commands that prompt for a numeric argument in
the minibuffer to also support reading that numeric argument via a
prefix argument. (See `goto-char`, for example.).
* rfc-mode.el (rfc-mode-read): Read a prefix numeric argument and use
it as the "number" argument; prompt in the minibuffer if no prefix
argument was used.
* changelog.org (Features): Advertise the change.
---
changelog.org | 5 +++++
rfc-mode.el | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/changelog.org b/changelog.org
index d2199ad363..a4809a476c 100644
--- a/changelog.org
+++ b/changelog.org
@@ -2,6 +2,11 @@
* Next Version
+** Features
+
+- ~rfc-mode-read~ now supports a numeric prefix argument, so you can
+ simply type ~C-u 1 2 3 4 M-x rfc-mode-read~ to read RFC number 1234.
+
* 1.3.0
This release improves navigation and introduce section detection, thanks to
Daniel Martín.
diff --git a/rfc-mode.el b/rfc-mode.el
index 50d0030e5f..326dfe0761 100644
--- a/rfc-mode.el
+++ b/rfc-mode.el
@@ -199,7 +199,10 @@ Returns t if section is found, nil otherwise."
;;;###autoload
(defun rfc-mode-read (number)
"Read the RFC document NUMBER."
- (interactive "nRFC number: ")
+ (interactive
+ (if (and current-prefix-arg (not (consp current-prefix-arg)))
+ (list (prefix-numeric-value current-prefix-arg))
+ (list (read-number "RFC number: "))))
(display-buffer (rfc-mode--document-buffer number)))
(defun rfc-mode-reload-index ()
- [nongnu] scratch/rfc-mode 5a8a3a238e 29/52: Make the rfc-mode-map inherit from special-mode-map, (continued)
- [nongnu] scratch/rfc-mode 5a8a3a238e 29/52: Make the rfc-mode-map inherit from special-mode-map, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode f766c141ac 22/52: introduce a custom variable to use original buffer names, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 476bff817d 42/52: Don't turn the beginning of every page into a button, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 6e41dcd82f 43/52: Autoload rfc-mode-browse, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode e21fb7e134 05/52: fix comment, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode c550aa0530 03/52: v1.0.0, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode ff7a36b810 44/52: Offer number at point as default in rfc-mode-read, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 3a7afa19e7 08/52: make some functions private, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode ea349f3441 41/52: Improve doc-strings, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 0f95e3f79b 21/52: fix mode detection regexp, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 8587416c21 40/52: Add prefix argument support to rfc-mode-read,
Stefan Monnier <=
- [nongnu] scratch/rfc-mode 3ef663203b 51/52: Consistently use spaces for indentation, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode b885d6bd2b 50/52: Fix completing-read default argument, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 21c966a02c 47/52: update changelog, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 697158dc0f 45/52: Extract rfc-mode--integer-at-point from rfc-mode-read, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 5d0c8096b2 48/52: * rfc-mode.el: Explicitly load cl-lib dependency., Stefan Monnier, 2022/10/12