]> git.eshelyaron.com Git - emacs.git/commitdiff
Initialize text conversion hooks for each C Mode buffer
authorPo Lu <luangruo@yahoo.com>
Fri, 9 Jun 2023 07:55:19 +0000 (15:55 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 9 Jun 2023 07:55:19 +0000 (15:55 +0800)
* lisp/progmodes/cc-mode.el (c-initialize-cc-mode): Always add
text conversion hooks.

lisp/progmodes/cc-mode.el

index 1364117bdc8daf3193ffab986a322485e5156651..88e0aebb9a2b4be970a15ff8ab52b4ea3a836ec6 100644 (file)
@@ -251,13 +251,14 @@ control).  See \"cc-mode.el\" for more info."
             (when (fboundp 'electric-indent-local-mode)
              (add-hook 'electric-indent-mode-hook 'c-electric-indent-mode-hook)
               (add-hook 'electric-indent-local-mode-hook
-                        'c-electric-indent-local-mode-hook))
-           ;; Set up text conversion, for Emacs >= 30.0
-           (when (boundp 'post-text-conversion-hook)
-             (add-hook 'post-text-conversion-hook #'c-post-text-conversion)))
+                        'c-electric-indent-local-mode-hook)))
        ;; Will try initialization hooks again if they failed.
        (put 'c-initialize-cc-mode initprop c-initialization-ok))))
 
+  ;; Set up text conversion, for Emacs >= 30.0
+  (when (boundp 'post-text-conversion-hook)
+    (add-hook 'post-text-conversion-hook #'c-post-text-conversion))
+
   (unless new-style-init
     (c-init-language-vars-for 'c-mode)))