From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#10772: 24.0.93; [patch] Convert tcl-auto-fill-mode to use define-minor-mode Date: Sun, 12 Feb 2012 00:12:26 -0500 Message-ID: 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: dough.gmane.org 1329062836 31892 80.91.229.3 (12 Feb 2012 16:07:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 12 Feb 2012 16:07:16 +0000 (UTC) Cc: 10772@debbugs.gnu.org To: William Stevenson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 12 17:07:15 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RwbxL-000077-3U for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Feb 2012 17:07:15 +0100 Original-Received: from localhost ([::1]:60375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwb9e-00029z-ID for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Feb 2012 10:15:54 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwb9O-0001SM-Vf for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2012 10:15:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rwb9N-00019N-IB for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2012 10:15:38 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwb9N-00019H-0u for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2012 10:15:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RwbAj-0006sX-NM for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2012 10:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2012 15:17: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.132905976726364 (code B ref 10772); Sun, 12 Feb 2012 15:17:01 +0000 Original-Received: (at 10772) by debbugs.gnu.org; 12 Feb 2012 15:16:07 +0000 Original-Received: from localhost ([127.0.0.1]:37663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rwb9p-0006rA-SN for submit@debbugs.gnu.org; Sun, 12 Feb 2012 10:16:06 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:34330) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rwb9m-0006r1-B3 for 10772@debbugs.gnu.org; Sun, 12 Feb 2012 10:16:03 -0500 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q1CFEaLZ030705; Sun, 12 Feb 2012 10:14:36 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 19B866659C; Sun, 12 Feb 2012 00:12:27 -0500 (EST) In-Reply-To: <87r4y1pezt.fsf@gmail.com> (William Stevenson's message of "Sat, 11 Feb 2012 15:27:18 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4129=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4129> : streams <727922> : uri <1064033> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:56832 Archived-At: > --8<---------------cut here---------------start------------->8--- > (set (make-local-variable 'normal-auto-fill-function) 'foo-do-auto-fill) > --8<---------------cut here---------------end--------------->8--- > These 3 modes (and some others from cursory checking) don't define > foo-auto-fill-mode and just let the user call auto-fill-mode - which > makes me wonder if defining tcl-auto-fill-mode is the right thing to do > anyway. Actually, thinking about it some more, maybe tcl-auto-fill-mode should be renamed (it has nothing specific to Tcl) and I think it could be implemented along the lines of (100% untested): (define-minor-mode auto-fill-noncode-mode :variable ((and auto-fill-function comment-auto-fill-only-comments) . (lambda (x) (auto-fill-mode (if x 1 -1)) (if auto-fill-function (set (make-local-variable 'comment-auto-fill-only-comments) t) (kill-local-variable 'comment-auto-fill-only-comments))))) -- Stefan