From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Fleischer Newsgroups: gmane.emacs.devel Subject: [PATCH] customizing initial sequence number in cua-rectangle Date: Wed, 12 Jan 2022 21:28:01 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35100"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) To: emacs-devel@gnu.org Cancel-Lock: sha1:KbO1NhYcckYCGlN/a8ym8V+3c1A= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 12 20:31:44 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7jLS-00091J-SM for ged-emacs-devel@m.gmane-mx.org; Wed, 12 Jan 2022 20:31:42 +0100 Original-Received: from localhost ([::1]:35762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7jLR-00015c-Td for ged-emacs-devel@m.gmane-mx.org; Wed, 12 Jan 2022 14:31:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7jI3-0006iB-KZ for emacs-devel@gnu.org; Wed, 12 Jan 2022 14:28:14 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:60828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7jI2-0002Bq-67 for emacs-devel@gnu.org; Wed, 12 Jan 2022 14:28:11 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1n7jHz-0004dj-DZ for emacs-devel@gnu.org; Wed, 12 Jan 2022 20:28:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284663 Archived-At: --=-=-= Content-Type: text/plain I added a customization option to insert number sequence that can start with any value by default. Patch attached. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-cua-rectangle-initial-sequence-number-customization.patch Content-Description: Patch 1 >From 72bdf5eed1079e265dff8636f5d316b9c971cb2f Mon Sep 17 00:00:00 2001 From: Daniel Fleischer 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 --=-=-= Content-Type: text/plain -- Daniel Fleischer --=-=-=--