From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#64185: proposal for new function: copy-line Date: Sat, 24 Jun 2023 13:29:36 +0200 Message-ID: <8494C1C8-435A-4817-9FA0-7D0A5F8DEC96@gmail.com> References: <4C83E2DA-FE5F-4191-88CD-7E70008C9892@gmail.com> <86o7l66rw8.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23372"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64185@debbugs.gnu.org, Eli Zaretskii , me@eshelyaron.com, zkanfer@gmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 24 13:30:54 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qD1Th-0005s9-3l for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Jun 2023 13:30:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qD1Su-00047o-0B; Sat, 24 Jun 2023 07:30:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qD1Ss-00047W-De for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 07:30:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qD1Sr-00024o-WE for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 07:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qD1Sr-0002X3-RK for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 07:30:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Jun 2023 11:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64185 X-GNU-PR-Package: emacs Original-Received: via spool by 64185-submit@debbugs.gnu.org id=B64185.16876061869694 (code B ref 64185); Sat, 24 Jun 2023 11:30:01 +0000 Original-Received: (at 64185) by debbugs.gnu.org; 24 Jun 2023 11:29:46 +0000 Original-Received: from localhost ([127.0.0.1]:39995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qD1Sc-0002WI-DV for submit@debbugs.gnu.org; Sat, 24 Jun 2023 07:29:46 -0400 Original-Received: from mail-lf1-f53.google.com ([209.85.167.53]:60450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qD1Sa-0002W4-92 for 64185@debbugs.gnu.org; Sat, 24 Jun 2023 07:29:45 -0400 Original-Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-4f96d680399so1988331e87.0 for <64185@debbugs.gnu.org>; Sat, 24 Jun 2023 04:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687606178; x=1690198178; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=fmNo5aU5ksRZVCyLTGrph+e9G+KYiWxkI/tbrC2hLE8=; b=dhKoq2TjHm+zT92sugr6X1WzHjGbtLOyE708ub2IMhGDA4KlzpHB3gbRLF3qscKmnm w/g30UEQAvPRXPafJGlq2OVn/5dZHaChunRyahH9843rg/uTgeFHNYuvi+xwFJXgb21E chW8GqJg29+aHnttyR9Vd8MNFHoaOHclQovFarPFFAsyYsz23fukNXQ0UpqiAIv0dNvs 3wz+H94Oj4TRjfe9gHgR4pGANjhU19Po4F0RrXmWDxrChlreCZNGavSLeMTe/S8tCfZm ctDLXnQfI3q3txly9wqo665f6BhQLfcMz2GXuCFhq6c7cUWeSX0iuSu0VxOrDf1rKWDQ OmwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687606178; x=1690198178; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=fmNo5aU5ksRZVCyLTGrph+e9G+KYiWxkI/tbrC2hLE8=; b=laOgMLulcUAVQzFS+XqDRDZGK96c5ezZ5VQd7IIZxIgr/6FkW696Rzb8BjhPSbH0fb 9QP1pk1ik+64JCIL2ZClAygWeD9ricXZqBoeW40Q2uwHnMkzzvtYOngbhGzNPlO6SShP VOzMTW4v5MlvEqY+qA/cT0+LnUbsip0k6vUXc69cAKmHlRUFaT0WnvCsb51K4wbbOAsP 5IB0lAnxt9aRH1UlJuFLZDo+aR7WH2Eml6H03GOrr44E5QbdbjvFC4SwAAnzr9QFSHzu Q3aoQglxDSHlDUCVKTzRD7SXqKppjoHl+l4AR8q4e1kwNWjaf4bqPIiPRXNu0bzlNoPS 2LAg== X-Gm-Message-State: AC+VfDzP0Wl87esAEJq9PlCB60fPVvNC/R12WY5C57+suor4vFMPMpMX ic0TWnEEpU/ygA/zQoNx5hM= X-Google-Smtp-Source: ACHHUZ6Qr4R6RNee5bBd6R4d9SHfAmBpeVuDxWZtbx1XjAZlDKNpONw/pHDYz/Mhp5AOkm3aPJMcbg== X-Received: by 2002:a05:6512:3c88:b0:4f9:6a7b:b8de with SMTP id h8-20020a0565123c8800b004f96a7bb8demr5374044lfv.3.1687606177668; Sat, 24 Jun 2023 04:29:37 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id d1-20020a05651221c100b004f84226f0bfsm165688lft.26.2023.06.24.04.29.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jun 2023 04:29:37 -0700 (PDT) In-Reply-To: <86o7l66rw8.fsf@mail.linkov.net> X-Mailer: Apple Mail (2.3654.120.0.1.15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263984 Archived-At: 23 juni 2023 kl. 18.45 skrev Juri Linkov : > It would be a major undertaking to design > a similar option for `duplicate-dwim` for consistency with = `duplicate-line` > because of more decisions necessary to make: whether to move point > to the beginning or the end of the copied regions, whether to select > all the copied regions or only one of them, etc. Actually we are helped by some constraints: duplicate-dwim must keep the = region active afterwards, so that the user can run the same command = immediately and get another copy. This is important for usability. It seems reasonable to assume that a user wants the same behaviour in = `duplicate-dwim` whether it is lines or columns being duplicated, and = have a single variable controlling both. This assumption may be wrong: = perhaps a user prefers to stay when copying a line, but move when = copying columns? If we use separate settings they should naturally work the same way, or = users will wonder who is running the asylum. A perhaps more intuitive way of describing the behaviour is not where to = put point afterwards, but whether copies are inserted before or after = the original. That will generalise to duplication of regions, = rectangular or contiguous, a little better. It's also easy to describe: (defcustom duplicate-direction 'after "Where to insert the copies made by `duplicate-line' and = `duplicate-dwim'. Valid values are `after' and `before' (the original text). :group 'editing :type '(choice (const :tag "After original" after) (const :tag "Before original" before))) What do you think? Should we have a single setting for lines and = regions, or individual settings for lines and regions, or for lines, = rectangles and contiguous regions? > For users who know Emacs Lisp and like to write plain values in = ~/.emacs, > the values 0, 1, -1 are more intuitive and familiar due to functions > like `substring`, etc. I suppose I'm one of those who don't know Emacs Lisp then! > to my surprise the shortdoc of `substring` has no examples > of a negative argument. I don't know whether this omission > is intentional to make the string section shorter. Thank you for noticing this. I doubt it was intentional. The examples have now been extended a bit. I'm sure we could do better with examples in general if we were to make = an effort.