From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.bugs Subject: bug#10772: 24.0.93; [patch] Convert tcl-auto-fill-mode to use define-minor-mode Date: Tue, 25 Feb 2014 21:30:05 +0800 Message-ID: <87vbw35nhe.fsf@gnu.org> References: <87fwektsb4.fsf@gmail.com> <87r4y1pezt.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1393335069 18517 80.91.229.3 (25 Feb 2014 13:31:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Feb 2014 13:31:09 +0000 (UTC) Cc: William Stevenson , 10772@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 25 14:31:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WII6K-00010s-7P for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Feb 2014 14:31:12 +0100 Original-Received: from localhost ([::1]:34881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WII6J-0006U4-QM for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Feb 2014 08:31:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WII6F-0006Tw-CR for bug-gnu-emacs@gnu.org; Tue, 25 Feb 2014 08:31:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WII6B-0002Pk-0a for bug-gnu-emacs@gnu.org; Tue, 25 Feb 2014 08:31:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WII6A-0002PY-UJ for bug-gnu-emacs@gnu.org; Tue, 25 Feb 2014 08:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WII69-0004Au-Rg for bug-gnu-emacs@gnu.org; Tue, 25 Feb 2014 08:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Xue Fuqiao Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Feb 2014 13:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10772 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 10772-submit@debbugs.gnu.org id=B10772.139333501815982 (code B ref 10772); Tue, 25 Feb 2014 13:31:01 +0000 Original-Received: (at 10772) by debbugs.gnu.org; 25 Feb 2014 13:30:18 +0000 Original-Received: from localhost ([127.0.0.1]:38778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WII5S-00049h-5f for submit@debbugs.gnu.org; Tue, 25 Feb 2014 08:30:18 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:46102 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WII5P-00049Y-CL for 10772@debbugs.gnu.org; Tue, 25 Feb 2014 08:30:16 -0500 Original-Received: from [123.114.123.21] (port=41864 helo=xfq-ThinkPad-X1-Carbon) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1WII5N-00089i-BX; Tue, 25 Feb 2014 08:30:14 -0500 In-Reply-To: (Stefan Monnier's message of "Sun, 12 Feb 2012 00:12:26 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86176 Archived-At: What about the following patch: === modified file 'lisp/progmodes/tcl.el' --- lisp/progmodes/tcl.el 2014-02-10 01:34:22 +0000 +++ lisp/progmodes/tcl.el 2014-02-25 13:22:36 +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-noncode-mode "24.4") (defun tcl-electric-hash (&optional count) "Insert a `#' and quote if it does not start a real comment. === modified file 'lisp/simple.el' --- lisp/simple.el 2014-02-21 13:22:14 +0000 +++ lisp/simple.el 2014-02-25 13:26:54 +0000 @@ -6146,6 +6146,16 @@ . (lambda (v) (setq auto-fill-function (if v normal-auto-fill-function))))) +(define-minor-mode auto-fill-noncode-mode + "Like `auto-fill-mode', but sets `comment-auto-fill-only-comments'." + :variable + ((and auto-fill-function comment-auto-fill-only-comments) + . (lambda (x) + (auto-fill-mode (if x 1 -1)) + (if auto-fill-function + (setq-local comment-auto-fill-only-comments t) + (kill-local-variable 'comment-auto-fill-only-comments))))) + ;; This holds a document string used to document auto-fill-mode. (defun auto-fill-function () "Automatically break line at a previous space, in insertion of text."