From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11028 invoked from network); 14 Oct 2022 17:18:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Oct 2022 17:18:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665767918; b=ojkvvzFvA+W5UuWtW+6IJLXVUEArIAU9gM/wDvQl0z5Dtti5fj6S/5Q+km/op+OZ/amDLJtJDq dLFqnywiJqhN9zvA7AXavgrbLsNaD8ez8newEUZ7LipfDycex6qOa+XDr3fy8qDwwfWa2AoGNp ZDb0sHLVXm3mS7oQrotUmsKWh4QOYfVT9Xz/Rf3JEiuKfVwETzaupVH9L85aGMKU40VIhb+ah5 MG8CelO+ZVuqwtVjGSgXCJAVAwzV8k/UuF/1ByBHbgQzXWYEkbsm+dS+qBX7og0dAIw7yW5Gn9 nW+ySpPbsO7GoCW/UoUnbcy4n4RpwXoFwtwyCcSipJYAMw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.15.15; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.a=rsa-sha256; dmarc=none header.from=gmx.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1665767918; bh=XkMOaA2p0SephFfe1uqYz/TPprp1FsgSxRGF2U8b1Vg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:To:From:Date:DKIM-Signature:DKIM-Signature; b=MbAnVo/Ne8vdWUMzzAEk7PHd8vxhkVLj+F+NhI7L7/4pZeyXVcwp9m/PKzzIsd8UB9Im2CbG+Y VZRgHPKTWwVA9W2LrIPEvZDM9zhOeuiM5bQPBB9eGarO/VFjgIVvmop4pYCwEn5fJ7YOEUkCFj jitWMOfNO2E4gyzcQ8r9SdqPdCqtvkmOVEMcsAEIXKdwbGygBsjVuP65p8DQ++g8/SRWpDrN/I 0JQrDBgg8kyr091pI7iP+Ul/UQwScRQVJQN42U9VQHBW0D46VZ3H/hVx2tvDjJv0WQv2KfKqZQ ely1+82NQt6qxuZmrPrWsDZjMkZ8MUHRGwvy8NviL62opw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Reply-To:Message-ID:Subject:To:From:Date:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=abuMT6DlrDjRzyBN8C7gpEYWEygVFo203jfwHAS0IoI=; b=nieq1hOPHmz9lttzJK3MxSFeMz cli9qZbzIK2m95lZ9KriIZ7m0jdI8l9g05ypCSepy3vazrsOpvXRw48rEVCdkS0tuvpAHl9gKYOPi Kyb8q/3Tw8+XDgPAQ9Cf9bN6Axok14amwBPUBUdIkysu5DDE+s8o6BrQfjsRH4UOJnhNOSaSPeqrw ZYL8bmrMCwpGIPBDSMyqAsdEOyGXVAamTK5sQlDJZ2nj2sgALB/x3subeO7X/EZkTJZXOv5gi/Sy5 2M9ST2kS69wYgHCbezRG9ie9najL95c1QbQL/HBgJFMq4n7DOtIorJ4qo9uFjy1UfbefbRXZeA0Oc 6AnVMbFQ==; Received: by zero.zsh.org with local id 1ojOKU-000PJu-4M; Fri, 14 Oct 2022 17:18:38 +0000 Authentication-Results: zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.15.15; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.a=rsa-sha256; dmarc=none header.from=gmx.de; arc=none Received: from mout.gmx.net ([212.227.15.15]:53955) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ojOH8-000NSJ-2e; Fri, 14 Oct 2022 17:15:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1665767709; bh=XkMOaA2p0SephFfe1uqYz/TPprp1FsgSxRGF2U8b1Vg=; h=X-UI-Sender-Class:Date:From:To:Subject:Reply-To:References: In-Reply-To; b=HGzzqXkCHRG7GiS0/D1TKD2bxMQO9+ka7ibm2lpElle8wgheUeAneqWg35cZvL13Z iiDeuQpSKBhcjwREcybCwg7G8jjG+r4d8abCJGkXNfMkaif1uuAkNba0AlB5YOJVWs pw87/aMGHO7Gi0D+ZG7IQxE8jEECPPyNpyLT04sg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from zitrone.obstwiese ([46.223.163.191]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M4JmN-1oj79w1dIH-000LGX for ; Fri, 14 Oct 2022 19:15:09 +0200 Received: from luthien by zitrone.obstwiese with local (Exim 4.94.2) (envelope-from ) id 1ojOH3-0001I5-LU; Fri, 14 Oct 2022 18:15:05 +0100 Date: Fri, 14 Oct 2022 18:15:05 +0100 From: Dominik Vogt To: zsh-users@zsh.org Subject: Re: line continuation with sed Message-ID: Reply-To: dominik.vogt@gmx.de Mail-Followup-To: zsh-users@zsh.org References: <9184bbff-9e68-7b02-2595-3474b016dfff@eastlink.ca> <2038562980.2864233.1665746341406@mail.virginmedia.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="advwLOJ3mBebAgPz" Content-Disposition: inline In-Reply-To: <2038562980.2864233.1665746341406@mail.virginmedia.com> X-Provags-ID: V03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R9A3L91IALCx SrJ0I6CtA2JVmp7/muI8CJylOQbVupdwr848Zv9puFCSBKU5wv6tRHOMeZaa60e4QmUKR0tkc jWzNQKU4ke2N8CWQ59qXd4XHOP2kCEqkhDPncM0fEdnkf4lQXsbMBblj6yAPWqoXzuiYCGb6K Rzg/Uhb6v3ARPnBXV6mdr3KwMwsIlDYSWZRFdzsgrkRh3cHB/ah2HC1bVNxtlTejGkL8cb39j 2p7vFptfF11I4PViax3UYSOkcbCRxAAriSTtLdAY9Y1d2tx3l2MhePWZWttm9ZR41A7nKCumO 7yNS0uOqGAinzg2SPD0w5f9re0kIMC18DUNgzAGifZUVpxtrIoJuToEElg8Td8+cBWVJvkl0A yEwkLzNvVWKYs8f9jE8Dow33Owi2FtjjFk1LTo2ZkiMJhDNJNoMqc8/uJElaCNlMuD9kM015c fHv0hoEm87ICkEBsXw7uwTPcG+84vT1PauXLaK4Kv2WVNEhrN5GOmGAwpOc35CkEtYsdFk5aC K8SuGF7yfGZ8TOm3v6Fwcym/WKUuRPxhEQ15AaFfmJnBkkbF/qKbALad2FtXFtbzqFafkv01O yZAnhAW1teL95n3zYje9WXQ6aZ+tca4lvBPOq1Low+WH2xVDKmBlnyIIAflqBOzzkJNzxq/sG snf3LrhKh1JRrQFhfi0jb0WPsMIzT9TuxIgBVGN55DlStcZJ6lp06pIDyiPMn9bn+UahVyWdP jbom83eRJkuNyoRGcy3z5uJnVElc4hBL0lTaaeQAhdARI X-Seq: 28208 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --advwLOJ3mBebAgPz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 14, 2022 at 12:19:01PM +0100, Peter Stephenson wrote: > You can configure a number of editors to show this up. In emacs, > for example, I use: > > (setq-default show-trailing-whitespace t) > > to show it for all modes, since it's often useful and at worst > a minor distraction. Decades ago Paul D. Smith posted the attached script "rm-tspaces.el" to the fvwm-workers mailing list: When you try to save a buffer with trailing whitespace, it asks you whether you want to remove them before saving. Very handy. (Can also be configured to do this automatically.) My configuration: =2D- ~/.emacs -- ;; Removes all trailing whitespace at the end of all lines--this setting ;; makes it ask you by default. ;; (require 'rm-tspaces) (setq-default rm-trailing-spaces 1) ;; Turn it on unconditionally for various programming modes ;; (add-hook 'emacs-lisp-mode-hook 'rm-trailing-spaces-always) (add-hook 'cperl-mode-hook 'rm-trailing-spaces-always) (add-hook 'c-mode-common-hook 'rm-trailing-spaces-always) (add-hook 'makefile-mode-hook 'rm-trailing-spaces-always) ;; Turn it off unconditionally in other places ;; (add-hook 'message-mode-hook 'rm-trailing-spaces-never) (add-hook 'nnfolder-save-buffer-hook 'rm-trailing-spaces-never) =2D- snip -- Ciao Dominik ^_^ ^_^ =2D- Dominik Vogt --advwLOJ3mBebAgPz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rm-tspaces.el" ;; rm-tspaces.el: Automatically clean trailing whitespace from buffers. ;; ;; Copyright (C) 1995 Paul D. Smith ;; ;; This file requires Emacs 19 or above. It should work with both Emacs ;; and XEmacs. Use (require 'rm-tspaces) to load this file (don't ;; autoload it). ;; ;; For user-invoked whitespace cleanup, the function rm-trailing-spaces ;; can be bound to a key or invoked via M-x. ;; ;; The variable rm-trailing-spaces controls behavior when the buffer is ;; saved. By default nothing is done. See the documentation of this ;; variable for details. ;; ;; The variable rm-trailing-spaces is buffer-local. Use setq-default to ;; set the default value for all buffers. Use setq to override the ;; default value for a particular buffer. If you're going to put the ;; setq in a hook, use the handy hook functions at the end of this file ;; to avoid having to write your own. ;; ;; For example, to be asked about removal for all buffers, except ;; automatically remove spaces in C files, try something like this: ;; ;; (require 'rm-tspaces) ;; (setq-default rm-trailing-spaces 1) ; any non-nil, non-t value ;; ;; (add-hook 'c-mode-hook 'rm-trailing-spaces-always) ;; ;; Note the user is only queried when there is actually trailing ;; whitespace in the buffer (e.g., the buffer would be modified). ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; ;; Changes: ;; 1.2 - Add version info. ;; Add simple functions to make installing in hooks simpler. (defvar rm-trailing-spaces nil "*Value of t says silently remove all trailing spaces when a file is saved. Non-nil but not t says ask user whether to remove trailing spaces or not. nil means don't remove trailing spaces.") (make-variable-buffer-local 'rm-trailing-spaces) ;; What are we? ;; ;(defconst rm-tspaces-version (substring "$Revision$" 11 -2) ; "$Id$") (defun rm-trailing-spaces-internal () "Deletes trailing whitespace from all lines in the current buffer." (if (and (not buffer-read-only) rm-trailing-spaces) (save-excursion (goto-char (point-min)) (if (or (eq rm-trailing-spaces t) (and (re-search-forward "[ \t]$" nil 1) (y-or-n-p (format "Remove trailing spaces in buffer %s? " (buffer-name))))) (list (while (< (point) (point-max)) (end-of-line nil) (delete-horizontal-space) (forward-line 1)) (end-of-line nil) (delete-horizontal-space)) ))) nil) ; indicates buffer-not-saved for write-file-hooks (defun rm-trailing-spaces () "Deletes trailing whitespace from all lines in the current buffer." (interactive "*") (message "Deleting trailing spaces... ") (let ((rm-trailing-spaces t)) (rm-trailing-spaces-internal)) (message "Deleting trailing spaces... done")) ;; Apply this function automatically to all buffers before they're saved. ;; (add-hook 'write-file-hooks 'rm-trailing-spaces-internal) ;; Provide some simple functions for inclusion in hooks variables ;; (defun rm-trailing-spaces-never () "Don't automatically delete trailing whitespace in this buffer." (setq rm-trailing-spaces nil)) (defun rm-trailing-spaces-ask () "Ask before deleting trailing whitespace in this buffer." (setq rm-trailing-spaces 1)) (defun rm-trailing-spaces-always () "Always automatically delete trailing whitespace in this buffer." (setq rm-trailing-spaces t)) (provide 'rm-tspaces) ;; rm-tspaces.el ends here --advwLOJ3mBebAgPz--