[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
2 different initialization strategies
From: |
Davin Pearson |
Subject: |
2 different initialization strategies |
Date: |
Wed, 18 Jan 2023 12:46:56 +1300 |
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.*
- 2 different initialization strategies,
Davin Pearson <=