From: Daniel Fleischer <danflscr@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] customizing initial sequence number in cua-rectangle
Date: Wed, 12 Jan 2022 21:28:01 +0200 [thread overview]
Message-ID: <m2o84ghhz2.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 118 bytes --]
I added a customization option to insert number sequence that can start
with any value by default. Patch attached.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch 1 --]
[-- Type: text/x-patch, Size: 1811 bytes --]
From 72bdf5eed1079e265dff8636f5d316b9c971cb2f Mon Sep 17 00:00:00 2001
From: Daniel Fleischer <danflscr@gmail.com>
Date: Wed, 12 Jan 2022 21:19:32 +0200
Subject: [PATCH] cua-rectangle initial sequence number customization
* lisp/emulation/cua-base.el: define `cua-rectangle-sequence-start'
* lisp/emulation/cua-rect.el (cua-sequence-rectangle): using the
customized variable.
---
lisp/emulation/cua-base.el | 4 ++++
lisp/emulation/cua-rect.el | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 162d1bb641..da2c4ce870 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -389,6 +389,10 @@ cua-auto-tabify-rectangles
(const :tag "Disabled" nil)
(other :tag "Enabled" t)))
+(defcustom cua-rectangle-sequence-start 0
+ "Initial number when inserting a numerical sequence."
+ :type 'integer)
+
(defvar cua-global-keymap) ; forward
(defvar cua--region-keymap) ; forward
(declare-function cua-clear-rectangle-mark "cua-rect" ())
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index e399fd0fbf..c90872e34b 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -1177,7 +1177,8 @@ cua-sequence-rectangle
(list (if current-prefix-arg
(prefix-numeric-value current-prefix-arg)
(string-to-number
- (read-string (format-prompt "Start value" 0) nil nil "0")))
+ (read-string (format-prompt "Start value" cua-rectangle-sequence-start)
+ nil nil (number-to-string cua-rectangle-sequence-start))))
(string-to-number
(read-string (format-prompt "Increment" 1) nil nil "1"))
(read-string (concat "Format: (" cua--rectangle-seq-format ") "))))
--
2.34.1
[-- Attachment #3: Type: text/plain, Size: 22 bytes --]
--
Daniel Fleischer
next reply other threads:[~2022-01-12 19:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 19:28 Daniel Fleischer [this message]
2022-01-13 6:00 ` [PATCH] customizing initial sequence number in cua-rectangle Lars Ingebrigtsen
2022-01-13 6:32 ` Daniel Fleischer
2022-01-13 7:04 ` Lars Ingebrigtsen
2022-01-13 7:17 ` Daniel Fleischer
2022-01-13 8:56 ` Eli Zaretskii
2022-01-13 10:15 ` Daniel Fleischer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2o84ghhz2.fsf@gmail.com \
--to=danflscr@gmail.com \
--cc=emacs-devel@gnu.org \
/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 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.