From unknown Mon Aug 18 14:25:41 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#55234 <55234@debbugs.gnu.org> To: bug#55234 <55234@debbugs.gnu.org> Subject: Status: 28.1; replace-string in rectangle regio Reply-To: bug#55234 <55234@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:25:41 +0000 retitle 55234 28.1; replace-string in rectangle regio reassign 55234 emacs submitter 55234 Paulo Sousa severity 55234 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon May 02 19:33:51 2022 Received: (at submit) by debbugs.gnu.org; 2 May 2022 23:33:51 +0000 Received: from localhost ([127.0.0.1]:38294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlfY6-0003Ue-M7 for submit@debbugs.gnu.org; Mon, 02 May 2022 19:33:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:48166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlefT-000272-4F for submit@debbugs.gnu.org; Mon, 02 May 2022 18:37:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlefS-0008QE-UX for bug-gnu-emacs@gnu.org; Mon, 02 May 2022 18:37:22 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:34815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlefQ-0002N4-Fc for bug-gnu-emacs@gnu.org; Mon, 02 May 2022 18:37:22 -0400 Received: by mail-ej1-x633.google.com with SMTP id g6so30350530ejw.1 for ; Mon, 02 May 2022 15:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=gjzgQ8lMMrFmHaF+x1Jny9VGRhQk6KcKFGEXNBgCmMA=; b=NOuNO6haopjaDZcfCEfzR4gCwzp6JlrzXjTg14q14ULcCOzAPiqXpEiQepefZa+MAq Hjr8kpPQWVSSPp9b6Nb/cvV48vj38ttdnRqG3n4bznZOZ1SMUgbcOcQd+cRm/c7LCYFI vLn1wdA5s0pJO87eSISBX0dWZue1uI7ULAT87JXOzOYQSPru77B/d4h6yi41F4JnwgLR /+ucOkTKE3BU8ryUQ7Dr+E5dda0m3TB0IQQ/ZuBUvDAZnTmpCLtPF7GCe/p9y1BUFeoC YMJqrt35UUUxlwArIUDgbTRg5NDDFMdWiPKRuC78LdK6ZQYKuHlT0XBiP5xiB5MMy24J ZuRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gjzgQ8lMMrFmHaF+x1Jny9VGRhQk6KcKFGEXNBgCmMA=; b=c3MOEKC2cj7HJkJgJrmZVOpzuP0FBY1aXIXeAM/ldq/+Agbsa1XEgbHhk/9Y+s+H+X 030GwBjd3LPRMRUYOTTYmUJtERRE18PcEq6/Zbyv7L4LY6MM+NnWHADwuY8X8rVHQN9G RnOogYeulXZ1F4+XvjqRhJN+IXEm1820Rabg+5EYyoPMW1IapTkB/m/YwTc0WzW698hs gpwohd2oCi+KVSQIkiRSrxG7Mo96lAWIdrmkEGU7kcn8AZrk/FMdcUHqiWjjpqXssjuu 4wlhJbVnGBOCD7dl8ROw2DaELPAdsAQqjL9naT4zeGqZ6mnwHXvlsEtZBqndTUvABgsz 5Nhg== X-Gm-Message-State: AOAM530vyFA1F/P/7JE4VdgJXcvCyxHWg9dhT0qj9CqHoHCfZ6LVp5ZK WtHcj8PNMzmi3NWdsxPQcGqZH0JeKyiE127j/RY2i9+WhiM= X-Google-Smtp-Source: ABdhPJxZNT9SbvtXXC9mXHFYVpCOTS4IOi3vHzYgbjfPZP6yKF1wnR5m8Ip/Qlmje3+ZrJaZNnkjGtmuPmDbEYDPMHU= X-Received: by 2002:a17:907:3f86:b0:6df:ad43:583 with SMTP id hr6-20020a1709073f8600b006dfad430583mr13531143ejc.535.1651531038230; Mon, 02 May 2022 15:37:18 -0700 (PDT) MIME-Version: 1.0 From: Paulo Sousa Date: Mon, 2 May 2022 23:36:46 +0100 Message-ID: Subject: 28.1; replace-string in rectangle regio To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000de8ca105de0f0814" Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=de.sousa.paulus@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 02 May 2022 19:33:49 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000de8ca105de0f0814 Content-Type: text/plain; charset="UTF-8" (read text between "```" in monospaced font) I opened a rectangle region with `C-x SPC`. I traversed left and down (i.e. the rectangle was started in the top-right corner). Then I replaced region and not all the occurrences were replaced. Only the occurrences between the starting and ending position of the cursor and inside the region. I replaced `]` by `+1]` as: ``` xx]xx**xx]xx ``` and the result was ``` xx]xx xx+1]xx xx]xx ``` where I would expect it to be ``` xx+1]xx xx+1]xx xx+1]xx ``` In GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6) of 2022-04-20 built on frederik Windowing system distributor 'The X.Org Foundation', version 11.0.12101003 System Description: Arch Linux Configured using: 'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib --localstatedir=/var --with-cairo --with-harfbuzz --with-modules --with-wide-int --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug -flto=auto' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: C++//l Minor modes in effect: shell-dirtrack-mode: t smartparens-strict-mode: t smartparens-mode: t global-semantic-idle-scheduler-mode: t semantic-idle-scheduler-mode: t global-semanticdb-minor-mode: t semantic-mode: t delete-selection-mode: t global-display-line-numbers-mode: t display-line-numbers-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t abbrev-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug sendmail cl-print debug backtrace rect xref shortdoc help-fns radix-tree vc-git diff-mode vc-dispatcher flymake-cc flymake-proc flymake project warnings semantic/bovine/make semantic/bovine/make-by make-mode misearch multi-isearch mhtml-mode css-mode smie smartparens-javascript js smartparens-html sgml-mode facemenu ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda org-refile ox-html table ox-ascii ox-publish ox org-element avl-tree generator ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr wid-edit ol-docview doc-view jka-compr image-mode exif dired dired-loaddefs ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi smartparens-org org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol rx org-keys oc org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs cus-start cus-load semantic/tag-write novice dabbrev face-remap semantic/bovine/c hideif semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc semantic/bovine semantic/analyze/refs smartparens-c cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs semantic/imenu semantic/sb imenu semantic/edit semantic/tag-file semantic/db-file data-debug cedet-files semantic/wisent/python semantic/decorate/include semantic/db-find semantic/db-ref compile text-property-search cl-extra semantic/dep semantic/wisent/python-wy semantic/wisent semantic/wisent/wisent smartparens-python python tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp format-spec comint ring ansi-color edmacro kmacro smartparens-config smartparens-text smartparens advice help-mode thingatpt dash semantic/decorate/mode semantic/decorate pulse color semantic/idle semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/format semantic/tag-ls semantic/find semantic/ctxt semantic/db-mode semantic/db eieio-base semantic/util-modes semantic/util semantic pp semantic/tag semantic/lex semantic/fw mode-local find-func cedet delsel display-line-numbers speedbar ezimage dframe modus-vivendi-theme modus-themes pcase info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 456867 46490) (symbols 48 38376 4) (strings 32 131759 4269) (string-bytes 1 4455167) (vectors 16 65136) (vector-slots 8 721867 71564) (floats 8 500 134) (intervals 56 2845 0) (buffers 992 33)) --000000000000de8ca105de0f0814 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
(read text between "```" in monospaced font= )

I opened a rectangle region with `C-x SPC`. I tr= aversed left and down
(i.e. the rectangle was started in the top-right c= orner). Then I
replaced region and not all the occurrences were replaced= . Only the
occurrences between the starting and ending position of the c= ursor and
inside the region.

I replaced `]` by `+1]` as:

`= ``
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= xx]xx*<Start of the region
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0xx]xx
End of the region>*xx]xx
```
a= nd the result was
```
xx]xx
xx+1]xx
xx]xx
```
where I wou= ld expect it to be
```
xx+1]xx
xx+1]xx
xx+1]xx
```

In GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, ca= iro version 1.17.6)
=C2=A0of 2022-04-20 built on frederik
Windowing s= ystem distributor 'The X.Org Foundation', version 11.0.12101003
= System Description: Arch Linux

Configured using:
=C2=A0'confi= gure --sysconfdir=3D/etc --prefix=3D/usr --libexecdir=3D/usr/lib
=C2=A0-= -localstatedir=3D/var --with-cairo --with-harfbuzz --with-modules
=C2=A0= --with-wide-int --with-x-toolkit=3Dgtk3 --with-xft 'CFLAGS=3D-march=3Dx= 86-64
=C2=A0-mtune=3Dgeneric -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORT= IFY_SOURCE=3D2
=C2=A0-Wformat -Werror=3Dformat-security -fstack-clash-pr= otection
=C2=A0-fcf-protection -g -ffile-prefix-map=3D/build/emacs/src= =3D/usr/src/debug
=C2=A0-flto=3Dauto' 'LDFLAGS=3D-Wl,-O1,--sort-= common,--as-needed,-z,relro,-z,now
=C2=A0-flto=3Dauto''

C= onfigured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSET= TINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULE= S NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCR= OLL_BARS X11 XDBE
XIM XPM GTK3 ZLIB

Important settings:
=C2=A0= value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-system: utf-8-unix
=
Major mode: C++//l

Minor modes in effect:
=C2=A0 shell-dirtra= ck-mode: t
=C2=A0 smartparens-strict-mode: t
=C2=A0 smartparens-mode:= t
=C2=A0 global-semantic-idle-scheduler-mode: t
=C2=A0 semantic-idle= -scheduler-mode: t
=C2=A0 global-semanticdb-minor-mode: t
=C2=A0 sema= ntic-mode: t
=C2=A0 delete-selection-mode: t
=C2=A0 global-display-li= ne-numbers-mode: t
=C2=A0 display-line-numbers-mode: t
=C2=A0 tooltip= -mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 show-paren-mode: t
=C2= =A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 menu-ba= r-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mod= e: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 a= uto-composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-co= mpression-mode: t
=C2=A0 line-number-mode: t
=C2=A0 indent-tabs-mode:= t
=C2=A0 transient-mark-mode: t
=C2=A0 abbrev-mode: t

Load-pa= th shadows:
None found.

Features:
(shadow sort mail-extr emacs= bug sendmail cl-print debug backtrace rect
xref shortdoc help-fns radix-= tree vc-git diff-mode vc-dispatcher
flymake-cc flymake-proc flymake proj= ect warnings semantic/bovine/make
semantic/bovine/make-by make-mode mise= arch multi-isearch mhtml-mode
css-mode smie smartparens-javascript js sm= artparens-html sgml-mode
facemenu ox-odt rng-loc rng-uri rng-parse rng-m= atch rng-dt rng-util
rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-u= til ox-latex
ox-icalendar org-agenda org-refile ox-html table ox-ascii o= x-publish ox
org-element avl-tree generator ol-eww eww xdg url-queue mm-= url ol-rmail
ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-op= t gnus-art
mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr kinsok= u svg dom
gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud = nnimap
nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range = message
rmc puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config m= m-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mai= lheader
gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rf= c2045
ietf-drums mail-utils mm-util mail-prsvr wid-edit ol-docview doc-v= iew
jka-compr image-mode exif dired dired-loaddefs ol-bibtex ol-bbdb ol-= w3m
ol-doi org-link-doi smartparens-org org ob ob-tangle ob-ref ob-lobob-table ob-exp org-macro org-footnote org-src ob-comint org-pcompleteorg-list org-faces org-entities noutline outline easy-mmode org-versionob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol rx org-keys
= oc org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs
cus-s= tart cus-load semantic/tag-write novice dabbrev face-remap
semantic/bovi= ne/c hideif semantic/bovine/c-by semantic/lex-spp
semantic/bovine/gcc se= mantic/bovine semantic/analyze/refs smartparens-c
cc-mode cc-fonts cc-gu= ess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs semant= ic/imenu semantic/sb imenu semantic/edit
semantic/tag-file semantic/db-f= ile data-debug cedet-files
semantic/wisent/python semantic/decorate/incl= ude semantic/db-find
semantic/db-ref compile text-property-search cl-ext= ra semantic/dep
semantic/wisent/python-wy semantic/wisent semantic/wisen= t/wisent
smartparens-python python tramp-sh tramp tramp-loaddefs trampve= r
tramp-integration files-x tramp-compat shell pcomplete parse-time
i= so8601 time-date ls-lisp format-spec comint ring ansi-color edmacro
kmac= ro smartparens-config smartparens-text smartparens advice help-mode
thin= gatpt dash semantic/decorate/mode semantic/decorate pulse color
semantic= /idle semantic/analyze semantic/sort semantic/scope
semantic/analyze/fcn= semantic/format semantic/tag-ls semantic/find
semantic/ctxt semantic/db= -mode semantic/db eieio-base
semantic/util-modes semantic/util semantic = pp semantic/tag semantic/lex
semantic/fw mode-local find-func cedet dels= el display-line-numbers
speedbar ezimage dframe modus-vivendi-theme modu= s-themes pcase info
package browse-url url url-proxy url-privacy url-exp= and url-methods
url-history url-cookie url-domsuf url-util mailcap url-h= andlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-load= defs
password-cache json subr-x map url-vars seq byte-opt gv bytecompbyte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren
el= ectric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
te= rm/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-o= pt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mod= e register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer sele= ct scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors = frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnames= e tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew gree= k romanian slovak czech european ethiopic indian
cyrillic chinese compos= ite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help= simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-fa= ce macroexp files window text-properties
overlay sha1 md5 base64 format = env code-pages mule custom widget
hashtable-print-readable backquote thr= eads dbusbind inotify lcms2
dynamic-setting system-font-setting font-ren= der-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-pr= ocess emacs)

Memory information:
((conses 16 456867 46490)
=C2= =A0(symbols 48 38376 4)
=C2=A0(strings 32 131759 4269)
=C2=A0(string-= bytes 1 4455167)
=C2=A0(vectors 16 65136)
=C2=A0(vector-slots 8 72186= 7 71564)
=C2=A0(floats 8 500 134)
=C2=A0(intervals 56 2845 0)
=C2= =A0(buffers 992 33))
--000000000000de8ca105de0f0814-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 03 02:58:58 2022 Received: (at 55234) by debbugs.gnu.org; 3 May 2022 06:58:58 +0000 Received: from localhost ([127.0.0.1]:38556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlmUs-00068z-DK for submit@debbugs.gnu.org; Tue, 03 May 2022 02:58:58 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:46739) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlmUq-00068j-NI for 55234@debbugs.gnu.org; Tue, 03 May 2022 02:58:57 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 77AD01C000F; Tue, 3 May 2022 06:58:48 +0000 (UTC) From: Juri Linkov To: Paulo Sousa Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: Date: Tue, 03 May 2022 09:57:32 +0300 In-Reply-To: (Paulo Sousa's message of "Mon, 2 May 2022 23:36:46 +0100") Message-ID: <868rrj6r37.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I opened a rectangle region with `C-x SPC`. I traversed left and down > (i.e. the rectangle was started in the top-right corner). Then I > replaced region and not all the occurrences were replaced. Only the > occurrences between the starting and ending position of the cursor and > inside the region. Thanks for the bug report. Actually this is a more fundamental problem. `replace-string` just uses `region-beginning` and `region-end`. So the question is why `region-beginning` and `region-end` don't return rectangular region boundaries. The second question is why `region-beginning` and `region-end` are implemented in C, so it's more tricky to fix them to use rectangular region boundaries. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 01 07:42:59 2022 Received: (at 55234) by debbugs.gnu.org; 1 Jun 2022 11:42:59 +0000 Received: from localhost ([127.0.0.1]:49852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwMkc-000657-VR for submit@debbugs.gnu.org; Wed, 01 Jun 2022 07:42:59 -0400 Received: from mout.web.de ([212.227.17.11]:59115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwMkX-00064m-Jf for 55234@debbugs.gnu.org; Wed, 01 Jun 2022 07:42:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1654083766; bh=25F5f6GeO5+XKe978+UkihYDvzkF8jDdM24ZJaVGC9k=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Jobc37ee1WjomUZpFhc2S8jIrcOZv8bd2aflxzHGgYP2ZdBTX0XesMWbuz6QZ98Fk ldVaz50BAfME5H9ecg1nYIkkH1GQPpjCg6gyTyTFt7m34e7YgIwK/4x2tupAO+/ZL4 9f/8/6/oTlJ3as0jPPSX2oxfsHLz22tEUHTxDzxc= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.246]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MqZMQ-1nRioY1LpA-00mlH4; Wed, 01 Jun 2022 13:42:46 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#55234: 28.1; replace-string in rectangle regio References: <868rrj6r37.fsf@mail.linkov.net> Date: Wed, 01 Jun 2022 13:42:45 +0200 In-Reply-To: <868rrj6r37.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 03 May 2022 09:57:32 +0300") Message-ID: <87bkvcboei.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:q2eRECMmu6+w+NDgaQk4pf2Xm0LGSvpr0dhOuijbU7NDmgHF3X4 +GpRWG69ccNpaA7L6orJQdvnVO9scuRvSh1d82+/WK/jeFM50mBzCmJYTCFI5mgdxdZJBSv IKmUsz8bm1d5pvUyMCJcKuLUVME0qEVHHda7VA8LmSnVTEGN1KrNaso6h0sETUOX5Pwq9ND RVOXvTYomdYMy941ojLBg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:6slMrD3GE0Y=:i7y2c4BxJc80WSrtvEixsi YGLNY97RRM9o6mbioTQQ6gD0Tn51NbGWgAE34n93nvRdTHVRagOyj44VVtzwmm3nRCGROknt9 qrbo4S0scUROe3z1hyhoqVCEyl7ViJedrBSiyaQA5kcwaChEOTZTDKv5HoPUgzIpoiNk4qwST Y0GA4+LIxbM2NCRQy9q2iQtUB0Twl/GD3l4zN/5xROHxfJRNY2L+DO6nOHT1+CEmDrbp9/bS3 1ny+iDeHlljdMyvnFdtu9wY6Exvul40IXOmwep7rxer3/lCRWfY82bMc4aU/JVXzVgvsbScMh 2v1Mf3sZ2fpXvwPQyiXrsVpYGtDG60/ZA26s3kc7khjegz+jRwNck7qkE5pU/EG8XdDLwpmZ9 ETHkxyCRuJ9ynd3pAo3STJnBZVzw0Lmt8Du2Goeykn93OldjfoG+xZvQFn882O8CrCvIdZVCz 0+mGuD86yoyXywFogjcqpuAE7IVcfyPTDnJe2aWVFjtn1z+ZiNuHxqaJyMAslL1z5wUjZYhdt 8LYhiZ5wPyDmrWk7F7sQ5x/sNwcETw2rLORlR1brSeIF3jmeCTQqxU/cb8Vz3tYxf0VFjZKxo sq4103I9dJAVWVUFLNj0rke4ge9koQo6MhYNkdB8t0dPUG1YsIDMmrxnHZT1RblbCd55OkfLU NQIrlOXcTtWPy78Z7qHRzDzWaY/K134wp/EAfUGEffbnWo/279f0TuEajDBBU8Hs7rlfVrQEf 307/htNxqnPCndiNDnqvZHhW97zNFVEVUE8wL4+TLLmK+I7PbTToCzptdJT9KpMngz56UoZOp orUa+w51VYbIwRDUBLoLZ11zM1qMeRkHC2YZGbNj9w1Cm+kJB9wVekrEmf4Y+rOpIY4Ztc3bp A5uVFwS44a52K06Pn+DCaMP9lAopVv2qop9/7cDz/NphIYl5TrKmNMemNrzOd2q0wwYqPMd41 CRgE9scNrK9VmUZYchjbipHTEtLBGSAx88/79OQySg9wK7wgj9dDpfbJE6OE4nVY01dTmVhOC xzds8QNeXwTs7OtTEyBPRhGrRRHJ8I962UTId3z0RN/HXRYHNDSZRwrFkuuLfzWDsEocbNUKP KDFEMcMuxedfMKeoXQONpatH1AEhwAEwFQggf+b6q8aDST8lNqUkCsGAQ== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > So the question is why `region-beginning` and `region-end` > don't return rectangular region boundaries. This is implemented with `rectangle--mark-crutches', right? Note that these positions can be purely "virtual" (i.e., not exist in the buffer). BTW, my solution to the original problem: I implemented a command that lets me edit a rectangular region in a separate buffer (similar to `string-edit'). Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 01 15:25:57 2022 Received: (at 55234) by debbugs.gnu.org; 1 Jun 2022 19:25:57 +0000 Received: from localhost ([127.0.0.1]:51862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwTyf-0003cI-LP for submit@debbugs.gnu.org; Wed, 01 Jun 2022 15:25:57 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:53603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwTyd-0003c4-K7 for 55234@debbugs.gnu.org; Wed, 01 Jun 2022 15:25:56 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id E166E240008; Wed, 1 Jun 2022 19:25:47 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> Date: Wed, 01 Jun 2022 22:23:29 +0300 In-Reply-To: <87bkvcboei.fsf@web.de> (Michael Heerdegen's message of "Wed, 01 Jun 2022 13:42:45 +0200") Message-ID: <86tu94193i.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> So the question is why `region-beginning` and `region-end` >> don't return rectangular region boundaries. > > This is implemented with `rectangle--mark-crutches', right? Note that > these positions can be purely "virtual" (i.e., not exist in the buffer). I thought that the implementation of region-beginning could be: (mapcar 'car (region-bounds)) or better for backward-compatibility: (caar (region-bounds)) and region-end: (cdar (last (region-bounds))) Please try these on the original bug report - they completely fix the problem. > BTW, my solution to the original problem: I implemented a command > that lets me edit a rectangular region in a separate buffer (similar to > `string-edit'). Isn't this a workaround? PS: I'll reply to your other posts after more testing of search/replace problems. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 02 08:20:52 2022 Received: (at 55234) by debbugs.gnu.org; 2 Jun 2022 12:20:52 +0000 Received: from localhost ([127.0.0.1]:53027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwjoq-0007Gt-NH for submit@debbugs.gnu.org; Thu, 02 Jun 2022 08:20:52 -0400 Received: from mout.web.de ([212.227.15.3]:57479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwjoo-0007Gd-SG for 55234@debbugs.gnu.org; Thu, 02 Jun 2022 08:20:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1654172443; bh=mHMR4o/41OxoOGCDxrtPJ+hlKUHbhcK0zHJUrjReLXc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=qdbmN4/buQgVhdDrgyuM8KHTJlfDeN9ANg38a3ZDGrrBOPUmooau4YapSTmT3gb9v pTN/HEPRKi2VpqGYsZ2NmLhVSIUaA0qUGmHVRrKnyJvBZ2YtHkzDxInCzdbsMMP0Tm QOpqQM0hKMz5bVlgA/IX+u4SMM+041oQO2/pESRA= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.246]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N6sBv-1njAg82wLH-017stL; Thu, 02 Jun 2022 14:20:43 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#55234: 28.1; replace-string in rectangle regio References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> Date: Thu, 02 Jun 2022 14:20:43 +0200 In-Reply-To: <86tu94193i.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 01 Jun 2022 22:23:29 +0300") Message-ID: <87zgivntno.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:iaInlPT1g8Co+jPq4wzrF+NEO1MLtW2oJnky6NBHI8ON53oFrf6 G4msUDpRrJ0L4eoAz/F/zUYEae+LOXIukdGSdaQJ23yVXwseaTI/730M8u8+/Byti03o7wF 1TXUWrn7p2OpHwzW1/Hn6FOfzSWhAqMW/rluDtc6tamSxntK/gXgXws09LNv0zsmPB6iP9S p5SAO5ERq7qeDbnWAPi6A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:NwYjs7HlLWA=:43P5i6bNnOWU4Z2jD5ISH/ xLygzxnN2RrzOdzipucvrBfXut3TikeAEZehnjMOXhhe8xLsPMoembXUzYOreKBZXWqeUToV7 oatYKHUs2iX6IkM3XXJ1GxKe/BfESuRbdN2jZWSo6Ol6JnDx6mMH+WDR4aktJcVKUIlGg+eEq HkzBKfr18O4Ox+WCoD89Ux6ha/qC6aMsOp2nfoKkjysg2K6cozKcLxkFVzKB5fiqXYMmE0g09 PhdVcA9uHiwXMv1WZex76ORZYp40vCwq2flzYreM3obplRVJGFba4jo5X6AEcg6HPh402M6IY SYq5n5p2tqSIlTwfSdsnPzaniGnFHqucdIYXGMU1JK0dd1ggJ3gsBFUv/+DDvlRiSED+pl4Wd n4Pe8SyMsBiRDe9zDoP4Hd1gkRlCDLYjop9KKj9WAmUqOtZb5p+WNOk6sIf1FP6koS2OkukTg WxqP/M5SwbenWmcci0l/arjgVNRaPTuvVe9aOA+UGa9pk0hWQhN5Uu6Kh23kIjnJ4VYPTKgIn RbKk5WJbV7hVj4NFlHshxN07d5vn6xETB4idkhEjuADcf3+rDvWyAkIyUbgEGt0+/q9C1W8Ts XEszJ8344uGtr8JEOJVXtxFIM5a7J12jg+z6OJDX4r+CpPDA5GPViM+JLhRK+gpi3kX3yzHh3 Rdj76fTSSFFPxiAA/p9Js8my126HOCGzQ51a7SIXRmm8MaezF+gOvRdWGxLTZN9fneMJY1Gqn gmENMSb8bU88o0Wvgchc31WDP8WnE5XcJCa5I2QYx3Dc0tIVJKU6TTeIlryU6Z2O/1pdGV9O4 JRVC9IJtwgkNJ4ex3/ybxZD6WseQIgXirHhd1AJAm7rkcu74r1+iDFZjmPLTf2az8KVSZ8RLf SoDh39l2O3J1rFzdKbYcn0kSzsJm9qhg0RqoJd7/XfALTTge0n3YZ0lDiHqtZCHonY86Uk4BD Kk/6qIZN+BvcPNXVenayjRK9/3gD5s0DmAmvChQtNLv1Q++EqGhhJhVCNjPS1xWXuoNx4PUSY Beg76PPslEk/OlNaROCKTpzl/T5znkzfZtUJT3rcAZByXEowVXw6RDDFmaOcYo3ZJaLcw+0+U KwQvRSWpZizPeCInC3LQGzq1pWgY3aJFBEntPryOLrt/FntPwa6BER+DQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > (mapcar 'car (region-bounds)) Sounds reasonable. > > BTW, my solution to the original problem: I implemented a command > > that lets me edit a rectangular region in a separate buffer (similar to > > `string-edit'). > > Isn't this a workaround? A different approach. Why I did this is: first, it's sometimes nice to have a separate buffer that is like the buffer "narrowed to the rectangular region". Second, depending on the text structure, in some cases the end result should be a proper rectangle again, or even a rectangle of exactly the same dimensions. But when you query replace, rectangle lines may become different lengths, some may be empty, some even longer than before etc. My commands asks me what to do in such a situation. Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 02 13:32:13 2022 Received: (at 55234) by debbugs.gnu.org; 2 Jun 2022 17:32:13 +0000 Received: from localhost ([127.0.0.1]:54555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwog9-0008F1-75 for submit@debbugs.gnu.org; Thu, 02 Jun 2022 13:32:13 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:43131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwog7-0008Ea-OU for 55234@debbugs.gnu.org; Thu, 02 Jun 2022 13:32:12 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 42FBD4000A; Thu, 2 Jun 2022 17:32:05 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> Date: Thu, 02 Jun 2022 20:19:53 +0300 In-Reply-To: <87zgivntno.fsf@web.de> (Michael Heerdegen's message of "Thu, 02 Jun 2022 14:20:43 +0200") Message-ID: <86czfrx9s6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> (mapcar 'car (region-bounds)) > > Sounds reasonable. Then here is the implementation that is more less in line with how other rectangular functions are implemented: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=rectangle--region-beginning.patch diff --git a/lisp/rect.el b/lisp/rect.el index 15d636f074..cb545f473a 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -754,17 +754,42 @@ rectangle-previous-line (rectangle--col-pos col 'point))) +(defun rectangle--region-beginning (orig) + "Like `region-beginning' but supports rectangular regions." + (cond + ((not rectangle-mark-mode) + (funcall orig)) + (t + (caar (region-bounds))))) + +(advice-add 'region-beginning :around #'rectangle--region-beginning) + +(defun rectangle--region-end (orig) + "Like `region-end' but supports rectangular regions." + (cond + ((not rectangle-mark-mode) + (funcall orig)) + (t + (cdar (last (region-bounds)))))) + +(advice-add 'region-end :around #'rectangle--region-end) + (defun rectangle--extract-region (orig &optional delete) (cond ((not rectangle-mark-mode) (funcall orig delete)) ((eq delete 'bounds) - (extract-rectangle-bounds (region-beginning) (region-end))) + (extract-rectangle-bounds + ;; Avoid recursive calls + (let (rectangle-mark-mode) (region-beginning)) + (let (rectangle-mark-mode) (region-end)))) (t (let* ((strs (funcall (if delete #'delete-extract-rectangle #'extract-rectangle) - (region-beginning) (region-end))) + ;; Avoid recursive calls + (let (rectangle-mark-mode) (region-beginning)) + (let (rectangle-mark-mode) (region-end)))) (str (mapconcat #'identity strs "\n"))) (when (eq last-command 'kill-region) ;; Try to prevent kill-region from appending this to some --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 02 13:32:17 2022 Received: (at 55234) by debbugs.gnu.org; 2 Jun 2022 17:32:17 +0000 Received: from localhost ([127.0.0.1]:54558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwogD-0008FJ-Ea for submit@debbugs.gnu.org; Thu, 02 Jun 2022 13:32:17 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:38211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwogB-0008Ef-K7 for 55234@debbugs.gnu.org; Thu, 02 Jun 2022 13:32:15 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6BDF6E0004; Thu, 2 Jun 2022 17:32:07 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> Date: Thu, 02 Jun 2022 20:23:24 +0300 In-Reply-To: <87zgivntno.fsf@web.de> (Michael Heerdegen's message of "Thu, 02 Jun 2022 14:20:43 +0200") Message-ID: <86zgivvv1v.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> > BTW, my solution to the original problem: I implemented a command >> > that lets me edit a rectangular region in a separate buffer (similar to >> > `string-edit'). >> >> Isn't this a workaround? > > A different approach. Why I did this is: first, it's sometimes nice to > have a separate buffer that is like the buffer "narrowed to the > rectangular region". Second, depending on the text structure, in some > cases the end result should be a proper rectangle again, or even a > rectangle of exactly the same dimensions. But when you query replace, > rectangle lines may become different lengths, some may be empty, some > even longer than before etc. My commands asks me what to do in such a > situation. Does this approach have more side-effects? It seems e.g. the undo history of replacements is not maintained: when copied back from the temporary buffer to the original buffer, the undo command will undo the whole rectangular region, not each replacement? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 03 03:57:21 2022 Received: (at 55234) by debbugs.gnu.org; 3 Jun 2022 07:57:21 +0000 Received: from localhost ([127.0.0.1]:55176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nx2BN-0006vm-JB for submit@debbugs.gnu.org; Fri, 03 Jun 2022 03:57:21 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:38351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nx2BM-0006vY-1l for 55234@debbugs.gnu.org; Fri, 03 Jun 2022 03:57:20 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 3FB366000F; Fri, 3 Jun 2022 07:57:11 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> <86czfrx9s6.fsf@mail.linkov.net> Date: Fri, 03 Jun 2022 10:46:32 +0300 In-Reply-To: <86czfrx9s6.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 02 Jun 2022 20:19:53 +0300") Message-ID: <86wndynq93.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> (mapcar 'car (region-bounds)) >> >> Sounds reasonable. > > Then here is the implementation that is more less in line with > how other rectangular functions are implemented: > > diff --git a/lisp/rect.el b/lisp/rect.el > +(advice-add 'region-beginning :around #'rectangle--region-beginning) This causes a strange compilation error: Loading lisp/mouse.el (source)... Eager macro-expansion failure: (void-function easy-menu-define) Eager macro-expansion failure: (void-function easy-menu-define) Error: void-function (easy-menu-define) debug-early(error (void-function easy-menu-define)) (easy-menu-define help-mode-menu help-mode-map "Menu for Help mode." ...) require(help-mode) require(cl-extra) require(comp) advice--add-function(:around ... rectangle--region-beginning nil) advice-add(region-beginning :around rectangle--region-beginning) require(rect) load("mouse") load("loadup.el") Symbol's function definition is void: easy-menu-define From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 03 05:37:42 2022 Received: (at 55234) by debbugs.gnu.org; 3 Jun 2022 09:37:42 +0000 Received: from localhost ([127.0.0.1]:55284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nx3kU-0000v6-C6 for submit@debbugs.gnu.org; Fri, 03 Jun 2022 05:37:42 -0400 Received: from mout.web.de ([217.72.192.78]:51917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nx3kS-0000ut-Cx for 55234@debbugs.gnu.org; Fri, 03 Jun 2022 05:37:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1654249052; bh=z1xvEU/xcMkRiuo31fiFF9fAOqCjzgT0taFNy2xZAs4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Jrn+OlVuTywx27T48lbNrbagKTpZZgHN9JK9zkYeCoMIcuE6Q7UE9yjfNNjMX5JAk 9xFz3Yk5D2+vUGPnhmnvbsmO8mdklesmW02mG/TGnPfxPElvboZGvJwdzi92fa7E7n ih5jh6HYfemMePeyp65PsLEOkaMal8uXkzaU5Qp8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.246]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MUlDP-1oN9Jt27t3-00QXWs; Fri, 03 Jun 2022 11:37:32 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#55234: 28.1; replace-string in rectangle regio References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> <86zgivvv1v.fsf@mail.linkov.net> Date: Fri, 03 Jun 2022 11:37:31 +0200 In-Reply-To: <86zgivvv1v.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 02 Jun 2022 20:23:24 +0300") Message-ID: <87tu92nl44.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:A/HKWl8Rkxs8W3hdWvEViXgwink6N/HfvbswyMk3XiRnx+lhmOX IIsjkq1O56JX2K5ZvG4ZJMwJlACE+w1YzvjT94qvEKUDdLFjAnOJ/NpjjD61bRPHJY/XlF9 pXrmFEInMrgfSpFA+GsERNPLfpypWBwxkNZZ4DtsSfLus15K8xYNwcnac+hszyO9jOpbgUh aZqAFIKnV4+sKtwmQM2xQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:BNF3DPcYYl4=:RJe33Y9pGYfRd0KdddyI08 fwlbRTTpj/Z4Gkd6clXaF4dNtSxedqCENB9FIiRMNxolmIqX5MjJq3Frs0RsXKY+1OJH5QTHh LoIaoCjGQLv13Ov9ZBTR0jnVyUcdeUTyIM0tixRkDD9YoeUjEDx/ps9g4rGK+UEaKIfu8OJlL QwFE2IIOg2wzrCKb/ulXaPWCY2Ft288BnmGCc4dXZ3vtX5kJXuxm86Zd37ECsOWOSaRkIa5sG +AFmm/NfqeaEUUnScG7Yh45L5YiM0NVl/bpaybdsFvhYaHVf/KT/FuFcuHO0HV8+2X2yx1jbD JYInIwxJJmdrcZs+P9aOJK3zQwAed/L7UgXQM9o+mVo+b+jGXLnKwpId0bnNHmMxvWpwNmErT eL6Aq6CcioHjTGiksebfagWdIu9wpDlYuPGu5Lu1xLScMV7eGscoB2CiDR2ndNg2xxlwbHlLp hGiKAeifq00p7WiT8smhu+dpdBGAkq1qMH7oD46J+YpK++FRYsrrngEbZHfLH7NsnF0t9rzq9 l0JUDrmzPHUKcKQwJefJvc9w12VoePAwQP4Uq4JwGR5vLytwLqBHJZjfoP2+/tmOvZvGKKUYK HjFNlCz+WOQBOCq65PdzyIYBUhEzrTbU8yl3Ihjtc+C2OvFHKZM4Yp1w9aJThcqBk2Gs/wmPL sTPn6o4wr4hF/MPSxjA0OsRIRrk4S5A1yDcBHYD93evXzM3GKa0AOaFY418+GADlmL+O/ihfE hDHz09xkdfxYuwwF4Qch5gucaewYTYIZRVPxo4Xgyms5oUPZpKpv3aRHEwT0DP/SUKcJKibim k/5HPM+jdaRLCA+kVlfN5/gM6n+uExVul4LuC3wVrafUFxUNer7k/+yMcWs9M5Qt+vLYjlGdN lrmImm/kD6pmrbOimBUt0zW4Mfg3Qp9GWrvq6Es00iVlkhwmAOit8oi43dXQqIIuRsWjCql/D q8IAq/zedb0eoc+241QQiupz2ZgtuUmtLqMvNnryh4uBHm5kdsGZz1fnuKIQ1z/GNObBvU/y9 TkmqLxkQnIQmF/sAQPBpR7aKY8GuHb8fmy/ZMzXMGCu7N0XzWGfDoUuo1vgB8OQVbEhDRhwYR ZLLMS/r+J3XjmsvlBlT1UbdZaPEDTu3Rvl+wO5IcmdUoBisfz0JXXTv1g== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > Does this approach have more side-effects? It seems e.g. the undo > history of replacements is not maintained: when copied back from the > temporary buffer to the original buffer, the undo command will undo > the whole rectangular region, not each replacement? Yes, that's how it works. Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 03 14:31:29 2022 Received: (at 55234) by debbugs.gnu.org; 3 Jun 2022 18:31:30 +0000 Received: from localhost ([127.0.0.1]:57008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxC53-0007C3-LJ for submit@debbugs.gnu.org; Fri, 03 Jun 2022 14:31:29 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:50169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxC50-00073o-9b for 55234@debbugs.gnu.org; Fri, 03 Jun 2022 14:31:28 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C34451BF209; Fri, 3 Jun 2022 18:31:18 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> <86czfrx9s6.fsf@mail.linkov.net> <86wndynq93.fsf@mail.linkov.net> Date: Fri, 03 Jun 2022 21:09:31 +0300 In-Reply-To: <86wndynq93.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 03 Jun 2022 10:46:32 +0300") Message-ID: <86wndxwqgk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >>>> (mapcar 'car (region-bounds)) >>> >>> Sounds reasonable. >> >> Then here is the implementation that is more less in line with >> how other rectangular functions are implemented: >> >> diff --git a/lisp/rect.el b/lisp/rect.el >> +(advice-add 'region-beginning :around #'rectangle--region-beginning) > > This causes a strange compilation error: > Symbol's function definition is void: easy-menu-define This patch avoids such problem: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=rectangle--region-beginning.patch diff --git a/lisp/rect.el b/lisp/rect.el index 15d636f074..334c6f59fd 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -656,6 +656,8 @@ rectangle-mark-mode :lighter nil (rectangle--reset-crutches) (when rectangle-mark-mode + (advice-add 'region-beginning :around #'rectangle--region-beginning) + (advice-add 'region-end :around #'rectangle--region-end) (add-hook 'deactivate-mark-hook (lambda () (rectangle-mark-mode -1))) (unless (region-active-p) @@ -754,17 +756,38 @@ rectangle-previous-line (rectangle--col-pos col 'point))) +(defun rectangle--region-beginning (orig) + "Like `region-beginning' but supports rectangular regions." + (cond + ((not rectangle-mark-mode) + (funcall orig)) + (t + (caar (region-bounds))))) + +(defun rectangle--region-end (orig) + "Like `region-end' but supports rectangular regions." + (cond + ((not rectangle-mark-mode) + (funcall orig)) + (t + (cdar (last (region-bounds)))))) + (defun rectangle--extract-region (orig &optional delete) (cond ((not rectangle-mark-mode) (funcall orig delete)) ((eq delete 'bounds) - (extract-rectangle-bounds (region-beginning) (region-end))) + (extract-rectangle-bounds + ;; Avoid recursive calls + (let (rectangle-mark-mode) (region-beginning)) + (let (rectangle-mark-mode) (region-end)))) (t (let* ((strs (funcall (if delete #'delete-extract-rectangle #'extract-rectangle) - (region-beginning) (region-end))) + ;; Avoid recursive calls + (let (rectangle-mark-mode) (region-beginning)) + (let (rectangle-mark-mode) (region-end)))) (str (mapconcat #'identity strs "\n"))) (when (eq last-command 'kill-region) ;; Try to prevent kill-region from appending this to some --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 04 09:20:56 2022 Received: (at 55234) by debbugs.gnu.org; 4 Jun 2022 13:20:56 +0000 Received: from localhost ([127.0.0.1]:57894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxTi4-0007Gd-0E for submit@debbugs.gnu.org; Sat, 04 Jun 2022 09:20:56 -0400 Received: from mout.web.de ([212.227.17.12]:58697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxTi1-0007GO-V9 for 55234@debbugs.gnu.org; Sat, 04 Jun 2022 09:20:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1654348846; bh=NdUgBz6EPtCiK0XIRedU0QS6kGDtFXGroL1dqcuudhc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=O5kVCSdBdEfv++IuCvzJlUxwf+b23jmAem7J1PyC3M4Iuz7C2oLpt85GiVftV72mZ Gv+W4E4+QN7DBqVgdBjpk0vI0y4ltX6pTPx413dO48IjtSRLcJPc8kM0PteRYIOW6s RUv9Q1dUn0GQjq8KlbvBtgfzfHKDu0U4ZW7Uen7M= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.246]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N3Xjd-1nnxd83zbH-010g4k; Sat, 04 Jun 2022 15:20:46 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#55234: 28.1; replace-string in rectangle regio References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> <86czfrx9s6.fsf@mail.linkov.net> <86wndynq93.fsf@mail.linkov.net> <86wndxwqgk.fsf@mail.linkov.net> Date: Sat, 04 Jun 2022 15:20:45 +0200 In-Reply-To: <86wndxwqgk.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 03 Jun 2022 21:09:31 +0300") Message-ID: <87h750va36.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:iylhlnpu1YEox9KNx4Lnr9/r2r4ylKFN109UVoVaIjrNQLs/8/S vChggD5LSWYdxes3jRIz0t1ij+VvwG0V2zxAVqwtzdpUBR9DoS268ZahjYjAWBTsd/6sB1m 8YeegG8Bf3IyPcylexA1leShloX3j1ry/QkxcWiBOESnDd/5DDwa5Phxem1CEbTRkCxSHBb UbGISV+/fb2lDBBfMU4Eg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:mvvUMNp5mXw=:sXKxIW/z3t91/jLQutdA1R JU25czUWYmnqnup8NpyVIz3o58f2Z9SqSatIRbUTzIL1j2R+8tO4SMWDlQ9Jntvpm2XWmccdn 27N3C0M5/joBussrpwL2sP4oHoVLweTl9PEYYpufWUfGnOhkOKWEwumoQP1fAFV9c9qQcrZds 7FtRepgULr1LtOr5LQaS3X1qJtFHnsgWkMxrFFdeAowo4PwyyR8z5kMMnAIth+qMPk7Skokip vcp5YnKEsbLWQNT+dTyuyc2EZsFbG1E8UboaER3WCtnVx36GbAh/nFmUXcSpwHx3DhMILcY1h 1Z8gOWjoXgbhDlTu/z5gm5OzKXJ6+Ja//vb9JrsIGm9YB9wyfLNWgH15C8ztFsbE5HB7XU2as /Dx2Bwjmp6Y800K1a5r5v0J04api+j2Si003nl0pSFRKk9YaZxEncaYPwZOkvAE/1+mBWFQtz yEFhG6qreGL8yyq1iiHlwS0aIP19DBkVaBqpAs049iAI4dMDF/NtNWRTRJHeIXX98stcGMxeP f8uKHZv3DHNFqliYx7oUAOPFTSwSc4ze1Fpd2nUy94HivUtVyABs0SqtLFQ59x4BuTh96vYQq l+Sxn9H09aKluevHv8oBpZECQSiCma8t7lSi47pIdJB0ABlJH5sd68wsQDRZ9hJblDjto7ZMq +gSYXE9x3Rly9/GPCaW7WB2CZoGqepzfEw9wo+5jvOacnO+5is2Nk9wRspVpK2RC0s9sXykRT 1WvHmVj2BQxN8PYf5ejaOgGcDVoQeN8zA5jIJsPJDEJp0ZIsfpC8bQ+PvdTQWKZrDBFJF0rqt atsnI/sc/Lnejk8xrEN0YmoYK1ZGsJfvDolnFSY+Fe/KI8pKRy/og/CEauzjrnt2pR/xYI8Dh qohiCqYkXm37FQchd4yWx4YYWHFKpIs9oz4qQf8mmwiEIwdqITqx0U6n67NBK40EPqYSg+znl YISdC/3/HKEl/+tF4hOAAA9T9inTxgsZOoXLY1yyZ4fLJeCd57dav6BWCP1g6tqVC6CYIqHUX jeZQNnpx7CjfD0OdySxu8xoDt1+XiafHQEqp36JHuBl6BO56lpK1xx+jTdbJJr/bP98Lq5eox qH8y4VzwI/VSEyDw237+xs948zuKilpFj6M/FpgY+XKf3sMShpXsxVkUQ== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > (defun rectangle--extract-region (orig &optional delete) > (cond > ((not rectangle-mark-mode) > (funcall orig delete)) > ((eq delete 'bounds) > - (extract-rectangle-bounds (region-beginning) (region-end))) > + (extract-rectangle-bounds > + ;; Avoid recursive calls > + (let (rectangle-mark-mode) (region-beginning)) > + (let (rectangle-mark-mode) (region-end)))) > (t > (let* ((strs (funcall (if delete > #'delete-extract-rectangle > #'extract-rectangle) > - (region-beginning) (region-end))) > + ;; Avoid recursive calls > + (let (rectangle-mark-mode) (region-beginning)) > + (let (rectangle-mark-mode) (region-end)))) > (str (mapconcat #'identity strs "\n"))) > (when (eq last-command 'kill-region) > ;; Try to prevent kill-region from appending this to some Is it intended to - at the end - call the original functions here? TIA, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 06 03:49:02 2022 Received: (at 55234) by debbugs.gnu.org; 6 Jun 2022 07:49:02 +0000 Received: from localhost ([127.0.0.1]:34317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ny7Ty-0002DP-8o for submit@debbugs.gnu.org; Mon, 06 Jun 2022 03:49:02 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:36507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ny7Tw-0002Cv-UX for 55234@debbugs.gnu.org; Mon, 06 Jun 2022 03:49:01 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id D2B46E0002; Mon, 6 Jun 2022 07:48:53 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> <86czfrx9s6.fsf@mail.linkov.net> <86wndynq93.fsf@mail.linkov.net> <86wndxwqgk.fsf@mail.linkov.net> <87h750va36.fsf@web.de> Date: Mon, 06 Jun 2022 10:43:20 +0300 In-Reply-To: <87h750va36.fsf@web.de> (Michael Heerdegen's message of "Sat, 04 Jun 2022 15:20:45 +0200") Message-ID: <86pmjmtexz.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> (defun rectangle--extract-region (orig &optional delete) >> ... >> (let* ((strs (funcall (if delete >> #'delete-extract-rectangle >> #'extract-rectangle) >> - (region-beginning) (region-end))) >> + ;; Avoid recursive calls >> + (let (rectangle-mark-mode) (region-beginning)) >> + (let (rectangle-mark-mode) (region-end)))) >> (str (mapconcat #'identity strs "\n"))) >> (when (eq last-command 'kill-region) >> ;; Try to prevent kill-region from appending this to some > > Is it intended to - at the end - call the original functions here? Wouldn't it go to infinite recursion when the advice on region-beginning will call region-bounds that calls rectangle--extract-region again? From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 08 13:11:21 2022 Received: (at 55234) by debbugs.gnu.org; 8 Jun 2022 17:11:21 +0000 Received: from localhost ([127.0.0.1]:44175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyzDF-0003NU-JA for submit@debbugs.gnu.org; Wed, 08 Jun 2022 13:11:21 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:49247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyzDE-0003NA-R8; Wed, 08 Jun 2022 13:11:21 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id F02A6E000E; Wed, 8 Jun 2022 17:11:12 +0000 (UTC) From: Juri Linkov To: Paulo Sousa Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: Date: Wed, 08 Jun 2022 20:10:20 +0300 In-Reply-To: (Paulo Sousa's message of "Mon, 2 May 2022 23:36:46 +0100") Message-ID: <86fskfhyir.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 55234 29.0.50 thanks > I opened a rectangle region with `C-x SPC`. I traversed left and down > (i.e. the rectangle was started in the top-right corner). Then I > replaced region and not all the occurrences were replaced. Only the > occurrences between the starting and ending position of the cursor and > inside the region. This is fixed now in 29.0. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 09 07:13:06 2022 Received: (at 55234) by debbugs.gnu.org; 9 Jun 2022 11:13:06 +0000 Received: from localhost ([127.0.0.1]:45259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzG66-0003JO-5F for submit@debbugs.gnu.org; Thu, 09 Jun 2022 07:13:06 -0400 Received: from mout.web.de ([212.227.15.3]:52579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzG64-0003It-9H for 55234@debbugs.gnu.org; Thu, 09 Jun 2022 07:13:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1654773177; bh=Bl/2GhMVqIu/NUJ7k69CaC1UWv+tUVT+I+TrcQSguoc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=lRvvaKY46qwFt6bSE5mFRYXfyJG27qc3ww+5olkFoXILAd3RePzOP/N7cmcbBkNuR 0x5lPhxELbsY2RDwLIgZI3Ml/nWtpGJ/9K63mARGnwHwne7AGc1FBBHNA/Dvu2Atjm hF/uI3dATcRHpdCYwCeAKiiZ62OCwDACfHm0BYyU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.246]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MIc7N-1nvhBE1KrN-00EmX2; Thu, 09 Jun 2022 13:12:57 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#55234: 28.1; replace-string in rectangle regio References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> <86czfrx9s6.fsf@mail.linkov.net> <86wndynq93.fsf@mail.linkov.net> <86wndxwqgk.fsf@mail.linkov.net> <87h750va36.fsf@web.de> <86pmjmtexz.fsf@mail.linkov.net> Date: Thu, 09 Jun 2022 13:12:56 +0200 In-Reply-To: <86pmjmtexz.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 06 Jun 2022 10:43:20 +0300") Message-ID: <87edzyxf7r.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:yejQ9XNr0Vs26sOePx7i+4IeYV2bxgit0K0p/bHZ5IaFcH7v338 YPT6wtV2vhbUs5LTnPLG3t+S0ZveAX4ilGiOGihcQffzf4NvoKRo4BqG5TiG90I1ibNfrUo dl4x9EujkAWFAbdTsPmOJchmZXqTeSBru+NnFjkGVydz/tSs8SfFUNCL7Zo+I4uoEJq07S+ 7gVBZmiT9vl4UoHEhJGXA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+Fpa7GLT7zA=:OeiObzLtylrbzd9SkpkgaA 1UIKX/SHGTzWF3hzjmn6s++PcaU7Uu/6nuEaOFA5aqaOwsSJ2Wf34wUySXN/Ta8i4ryP8c0x2 Go3RGlg8Gsf8QcRhlDBUa804Ui4fvrOScuIbZDfq3U0EPPTTyPymJt5CjHweN5hmyBS0q098F icV8A6kXPUZrImF2jjSDtYiDuq8mJfhYvWQvSfT5fM14Ve1vj7NqQ3C4Tabuv8j0eXsi2VH8g v6whFB7BJ/57nzHKC+TxE6NbowCw8RHBFPUV8cpqTiM535j/O3cAY35TPMivVcXzXCkds8MsG tJkPhSQcMSbJvCzCOx4dPSPO9tL1v5nMXRTGYoBsef0tAhx9YtBecBDMeMzMnU8cTwRKNq7d8 cUX6BQDgwDzcFxNz9YPN+2QC2C46OJFqNlATwWN4eAY4jkjdLbKdbkqzRe52K85mhc1nyaFYC kD4qnlsqntQz329ed+celTYJWouFDtbWk5g1YOdX+HLQj2x7UbJqvq7kOWPbM4tGWpqtnkKjS MT5hzshktUrt/V9i2oD489tyQa99XZwcQnjnCGpmtEqIp96LPMV9+06y/QTI/U1iTQ7/aIq0V j4UE7VGZ9fm7mg3ZTFF1dklWmshiR/ieRyJXh3c5Q7IantXPCSAvyCVTw6FxRGBqfZnwvcFUM wcX4/DceIA3eAP5Q2Yy3Nb2xguxcPthTh4eWZcGXN0Th5J4ctyxYDZhO1SA/FblnxpPbY+m+W v84LNxqWC3OHrUq8UMfI0XQtYCC8DY6mur/c6r+WgDkvgbwyGYJzNg62T7CvQ0kfq1cpDP+3O yiL6wIRzr3wiKL1/HZVg7xmUXbLa6CNF8X77JfHu/iJhvOV31W3FNydDV4fkIjseq8Iedj9/w Y2z4xBqgLomUsWmOYghvXR0qrPo/K1CiDteWzz6l3BtJvk2EkK4JCVVklbBOnWXvPku2Zq89l 9jUg1eVW6O4OYU7vfOjwNVLzFCJ59nMEWrFn1dZpJZ3WO0WRv1N3ohLSXrjYXjlKlBuEFtSND LQSiuC+WluKAa+TFvmWLmdS1eazOdxLOTXrayZXhFcLshL1vrqJdtkimqx9n69fDtGZACDOSE QbW6zWckceazk4h1Qcsf90a/r5+SmfK+h41xhT+DsMR2TN49S0xwrjCxw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > Wouldn't it go to infinite recursion when the advice on > region-beginning will call region-bounds that calls > rectangle--extract-region again? I must admit that I haven't checked when which calls are made (and there are a lot). But I would expect that a binding to avoid the infinite recursion would be made in the advice itself, not outside. Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 09 13:25:40 2022 Received: (at 55234) by debbugs.gnu.org; 9 Jun 2022 17:25:40 +0000 Received: from localhost ([127.0.0.1]:47639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzLue-0006Sk-IN for submit@debbugs.gnu.org; Thu, 09 Jun 2022 13:25:40 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:38123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzLud-0006S7-0P for 55234@debbugs.gnu.org; Thu, 09 Jun 2022 13:25:39 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 35FC6C0006; Thu, 9 Jun 2022 17:25:31 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#55234: 28.1; replace-string in rectangle regio Organization: LINKOV.NET References: <868rrj6r37.fsf@mail.linkov.net> <87bkvcboei.fsf@web.de> <86tu94193i.fsf@mail.linkov.net> <87zgivntno.fsf@web.de> <86czfrx9s6.fsf@mail.linkov.net> <86wndynq93.fsf@mail.linkov.net> <86wndxwqgk.fsf@mail.linkov.net> <87h750va36.fsf@web.de> <86pmjmtexz.fsf@mail.linkov.net> <87edzyxf7r.fsf@web.de> Date: Thu, 09 Jun 2022 20:05:21 +0300 In-Reply-To: <87edzyxf7r.fsf@web.de> (Michael Heerdegen's message of "Thu, 09 Jun 2022 13:12:56 +0200") Message-ID: <86y1y5day6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55234 Cc: Paulo Sousa , 55234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Wouldn't it go to infinite recursion when the advice on >> region-beginning will call region-bounds that calls >> rectangle--extract-region again? > > I must admit that I haven't checked when which calls are made (and there > are a lot). But I would expect that a binding to avoid the infinite > recursion would be made in the advice itself, not outside. The advice needs to get rectangular region boundaries using rectangle--extract-region. From unknown Mon Aug 18 14:25:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 08 Jul 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator