From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tpeplt Newsgroups: gmane.emacs.help Subject: Re: delete all whitespace (space) in a region Date: Wed, 08 Nov 2023 21:24:53 -0500 Message-ID: <87zfzn4qa2.fsf@gmail.com> References: <878r78jfms.fsf@mat.ucm.es> <874jhwhx9i.fsf@ledu-giraud.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40411"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) Cc: Manuel Giraud , Uwe Brauer To: Manuel Giraud via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 09 03:25:41 2023 Return-path: Envelope-to: geh-help-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 1r0ujk-000AGv-Sh for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 09 Nov 2023 03:25:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0uj6-0007Vh-9T; Wed, 08 Nov 2023 21:25:00 -0500 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 1r0uj4-0007VY-Df for help-gnu-emacs@gnu.org; Wed, 08 Nov 2023 21:24:58 -0500 Original-Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0uj2-0007Pc-PT for help-gnu-emacs@gnu.org; Wed, 08 Nov 2023 21:24:58 -0500 Original-Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7781bc3783fso23002185a.1 for ; Wed, 08 Nov 2023 18:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699496695; x=1700101495; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=/Wi+e8ndH8at6yeIxaJXMFrrTXPWkGm2Xpd/3ltAzPU=; b=XQI8LcxRXcK5s9v76pP/dPqqHfWQO9HCcdMGixsYjXR/ztRiX2VjfTuzHDhnL3oppp CcUS8Hyqmy06Q6eKw7pZHZj46MyknO0bINPKBt8Diw43H/uHU2/lmcyv3F6g4d1Pb3Mw 98JZ0zhGAI9/AgrkN1S7TOF065kb8lTXEMcR7QcOvSWeR6lzYeOv5EtoVikc3+SUba8g PVrc2mi1bKEVA2UL8gKdnvQxvFX/k6VRwXJy0+4rtCiwsALMoYBBQPkqc7OPl4UmD70W WxMU0BRKFH8ThX0gKrHItxl66Rw205FAs/EkbkSBOasdTK6wLlHwu6yQC8omdQ0nCyyM FiAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699496695; x=1700101495; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/Wi+e8ndH8at6yeIxaJXMFrrTXPWkGm2Xpd/3ltAzPU=; b=TmkZNckgZF8ierDMLzLWCT1WfpbgkyCdvqTe2/vE3fp2KVd6gi9+y9SyYGjMPYX6R9 LDzrTmS28t4TMHc6oxM+6oNejSPWYQtAlAjzhy5061aKbCFsJQkc9DT3PCii3C38nMXe KZI8xiLmHKVonrn1bjhcahRmB27oB0wvKpu+42lbs5yDG+SOARcH7i00jyysnEjszpf9 3+H8+iqP2jSi+ApxXdvNfBsbFl9Cd87zmh7bW67V4jlRQFc9GNLuOBwaKU3Jb0GDwoMl PWdtmrtLaSlrH5iFjuLBoyuejtm1mi9Q8TO+SD2VpUlfy1tzEpiNHk40eSrS3que4xsG 8Xhw== X-Gm-Message-State: AOJu0YxUAymMm9KS+SF57Q6e63FzysF9PhmyvolcORgup7vraQVMWcPm crop4VduWZsX/enMAYDtIBw= X-Google-Smtp-Source: AGHT+IF9NL1zM23P4Nt/752XPWuQREJ7IixByqfwNX48UBGx/63Qse56wHvNBhSYU53KN8A5yQ5ZUg== X-Received: by 2002:a05:620a:f0d:b0:76f:839:6bdd with SMTP id v13-20020a05620a0f0d00b0076f08396bddmr3645409qkl.3.1699496695312; Wed, 08 Nov 2023 18:24:55 -0800 (PST) Original-Received: from t530.local ([2600:8806:a821:2b00::adf6]) by smtp.gmail.com with ESMTPSA id o4-20020a05620a228400b007678973eaa1sm1630051qkh.127.2023.11.08.18.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 18:24:54 -0800 (PST) In-Reply-To: <874jhwhx9i.fsf@ledu-giraud.fr> (Manuel Giraud via Users list for the's message of "Wed, 08 Nov 2023 20:15:37 +0100") Received-SPF: pass client-ip=2607:f8b0:4864:20::736; envelope-from=tpeplt@gmail.com; helo=mail-qk1-x736.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, 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-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145467 Archived-At: Manuel Giraud via Users list for the GNU Emacs text editor writes: > > If you don't want to confirm for the replacements, you could instead do > this: > > (defun my-delete-all-whitespace-region (beg end) > (interactive "r") > (save-excursion > (goto-char beg) > (while (re-search-forward " " end t) > (replace-match "")))) Emacs 28 added the function =E2=80=98replace-string-in-region=E2=80=99. (defun my-delete-all-whitespace-region (beg end) (interactive "r") (save-excursion (replace-string-in-region " " "" beg end))) --