bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#10772: 24.0.93; [patch] Convert tcl-auto-fill-mode to use define-min


From: Xue Fuqiao
Subject: bug#10772: 24.0.93; [patch] Convert tcl-auto-fill-mode to use define-minor-mode
Date: Thu, 27 Feb 2014 06:40:37 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:
>>> Tcl is not special wrt to filling and comments, AFAIK, so tcl-mode
>>> should simply use the default auto-fill functionality without any
>>> local tweaks.
>> Right, and that's exactly what my patch does.
>
> No, it preserves the "special behavior", just changing the
> implementation to rely on the generic auto-fill code.  My point is that
> the special behavior is just a preference of the mode's author and hence
> doesn't belong in the major mode's definition.

Ah, I see.  So here's the new patch (without ChangeLog/NEWS):

=== modified file 'lisp/progmodes/tcl.el'
--- lisp/progmodes/tcl.el       2014-02-10 01:34:22 +0000
+++ lisp/progmodes/tcl.el       2014-02-26 22:39:06 +0000
@@ -1410,13 +1410,8 @@
                     tcl-application file tcl-command-switches)
        (if and-go (switch-to-tcl t)))))))
 
-(defun tcl-auto-fill-mode (&optional arg)
-  "Like `auto-fill-mode', but sets `comment-auto-fill-only-comments'."
-  (interactive "P")
-  (auto-fill-mode arg)
-  (if auto-fill-function
-      (set (make-local-variable 'comment-auto-fill-only-comments) t)
-    (kill-local-variable 'comment-auto-fill-only-comments)))
+(define-obsolete-function-alias tcl-auto-fill-mode
+  auto-fill-mode "24.4")
 
 (defun tcl-electric-hash (&optional count)
   "Insert a `#' and quote if it does not start a real comment.

-- 
http://www.gnu.org/software/emacs/





reply via email to

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