all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] customizing initial sequence number in cua-rectangle
@ 2022-01-12 19:28 Daniel Fleischer
  2022-01-13  6:00 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Fleischer @ 2022-01-12 19:28 UTC (permalink / raw)
  To: emacs-devel

[-- 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-13 10:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-12 19:28 [PATCH] customizing initial sequence number in cua-rectangle Daniel Fleischer
2022-01-13  6:00 ` 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

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.