emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auto-header 9afc94dea4 09/26: Warn if not being used in


From: ELPA Syncer
Subject: [elpa] externals/auto-header 9afc94dea4 09/26: Warn if not being used in a C-mode buffer
Date: Sun, 26 Mar 2023 07:57:34 -0400 (EDT)

branch: externals/auto-header
commit 9afc94dea465039b621e72ff72c544dbd740f25f
Author: Philip Kaludercic <philip.kaludercic@fau.de>
Commit: Philip Kaludercic <philip.kaludercic@fau.de>

    Warn if not being used in a C-mode buffer
---
 auto-header.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/auto-header.el b/auto-header.el
index a62a9ace2e..3536bde469 100644
--- a/auto-header.el
+++ b/auto-header.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2022  Philip Kaludercic
 
 ;; Author: Philip Kaludercic <philip.kaludercic@fau.de>
-;; Version: $Id: auto-header.el,v 1.7 2022/05/01 20:15:59 oj14ozun Exp 
oj14ozun $
+;; Version: $Id: auto-header.el,v 1.8 2022/05/01 20:19:34 oj14ozun Exp $
 ;; Package-Version: 1.0
 ;; Keywords: c
 
@@ -151,7 +151,10 @@ NAME."
   "Run `auto-header-buffer' before saving."
   :lighter " AH"
   (if auto-header-mode
-      (add-hook 'before-save-hook #'auto-header-buffer nil t)
+      (progn
+        (unless (derived-mode-p 'c-mode)
+          (warn "Auto-header ought to be used in a C-mode buffer"))
+        (add-hook 'before-save-hook #'auto-header-buffer nil t))
     (remove-hook 'before-save-hook #'auto-header-buffer t)))
 
 (provide 'auto-header)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]