From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Davin Pearson Newsgroups: gmane.emacs.help Subject: 2 different initialization strategies Date: Wed, 18 Jan 2023 12:46:56 +1300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1540"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 18 00:48:08 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 1pHvgU-0000FK-WC for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 18 Jan 2023 00:48:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHvfv-0002cW-Qe; Tue, 17 Jan 2023 18:47:31 -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 1pHvfh-0002bv-G9 for help-gnu-emacs@gnu.org; Tue, 17 Jan 2023 18:47:29 -0500 Original-Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHvff-0006lt-O5 for help-gnu-emacs@gnu.org; Tue, 17 Jan 2023 18:47:17 -0500 Original-Received: by mail-pg1-x533.google.com with SMTP id r18so23230803pgr.12 for ; Tue, 17 Jan 2023 15:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=8WVJlNwZHH8ikXA+kjQ5yjwjmoNzr12M2Q0AWxt8kvw=; b=m9bfe7oaFRknHnAjjofMbEGDgHmOd9qz+9bTqJqWCwoFnueRBcUqoLEpDpQtlp2ShC IUlQL1P5V6/VFxBMvjLtjvP0mh52dQ0RI34ND5FJoQQzGUO1pvuOm53vSUVMo6xugE8O 3GL1Hs9p6LuuSQl3UKno+bJACenisMShh/uFnn/bXCBKuLeOQiFWHakq6d3PozLNGrEk GOS+i3riht7GKZxNIb0586dd/87Y/BdEmUCgM4e2c3VKquE6j2W5KOVhcQRUNRxwWYx2 jGt9c+Sezc+XRlTUBDNfsdMS1+r0jt9niSZZtxt90XAh+RbOzKV+QpwzYLb5NtTEUInl Y7Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8WVJlNwZHH8ikXA+kjQ5yjwjmoNzr12M2Q0AWxt8kvw=; b=tgPtv8bkBlfQhZwhGnsn2b1xai5N9GzfgXpN2yjuErHRDRHNQ40XN0fS6yXTJcKUPY cg8I/oOK6LQiQ86oOUF49eHAGKdEfUycWV24ut7hKdEGnKQxMnR4X6A1IaJhClzQYS2y vRv34fNDHXHVIDThaqdkY4B05IBoRsZGeRK00Cmqi+CzLDMbmFnFjpur+i2ykIgEIYL7 xEYUsu8RaaKUf6fohKi7qqzPXrjgm7QqUvPVhrPlhwWyGCyyXC0r3Bc5xfeYoUxihkXu 01iKbB7jPJnLkpuZGB5qtn0VtndWrvz4CBTX5H5lZtQVTPSfjT48n2cQl8mhvaBeN7bL GYQA== X-Gm-Message-State: AFqh2kpIWUBMEpKyirOJ0ZnLTfiHgl3436E5DlC4N3JaXpHjiAXLZRfq ZjSZcE1lbUX0WCKKGROLdXLKXCD+6t1GXgoZHtEqY/Sz3NA= X-Google-Smtp-Source: AMrXdXvvhnhujMHaV70pvp+shpd8Ioib6l917QG4u8ypYuVhR9DrAZ4FadXMRoRWoUO71gXHuAeAefptS0D9vZxgXXQ= X-Received: by 2002:a63:da12:0:b0:470:8e8a:e7fe with SMTP id c18-20020a63da12000000b004708e8ae7femr337282pgh.215.1673999233688; Tue, 17 Jan 2023 15:47:13 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=davin.pearson@gmail.com; helo=mail-pg1-x533.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:142344 Archived-At: I have the following hook defined. (defun dmp-php-hook () (when (eq major-mode 'html-mode) (save-excursion (goto-char (point-min)) (while (re-search-forward "\\([ \t]+$\\)" nil t) (delete-region (match-beginning 1) (match-end 1)) )) nil)) I have two different initialisation strategies: (1) (add-hook 'write-file-functions 'dmp-write-mode-function (2) (setq write-file-functions (cons 'dmp-write-mode-function 'write-file-functions)) With add-hook I can specify the optional variable DEPTH for that version so I prefer this strategy over the other one, if it is allowed. *Davin.*