From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Smie-auto-fill =?utf-8?Q?doesn=E2=80=99t?= respect comment-auto-fill-only-comments Date: Tue, 02 May 2017 15:18:43 -0400 Message-ID: References: <87o9vdj0s5.fsf@tromey.com> <87mvavw0h5.fsf@pokyo> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493752743 30284 195.159.176.226 (2 May 2017 19:19:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 May 2017 19:19:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 02 21:19:00 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5dK7-0007lo-Eu for ged-emacs-devel@m.gmane.org; Tue, 02 May 2017 21:18:59 +0200 Original-Received: from localhost ([::1]:33249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5dKD-0000rN-8u for ged-emacs-devel@m.gmane.org; Tue, 02 May 2017 15:19:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5dK7-0000rG-3E for emacs-devel@gnu.org; Tue, 02 May 2017 15:18:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5dK2-0005AN-0q for emacs-devel@gnu.org; Tue, 02 May 2017 15:18:59 -0400 Original-Received: from [195.159.176.226] (port=36082 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5dK1-00058w-QG for emacs-devel@gnu.org; Tue, 02 May 2017 15:18:53 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d5dJt-0007RF-0r for emacs-devel@gnu.org; Tue, 02 May 2017 21:18:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 20 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:8fmw83MgGgn0hfENL4+QSYu2RXQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214526 Archived-At: > Could this just setq auto-fill-function to a function that wraps (the > captured value of) normal-auto-fill-function? That would avoid using advice. Not sure what you mean: "a function that wraps (the captured value of) normal-auto-fill-function" is exactly what add-function creates. [ Tho my patch is buggy, it should say (add-function :around (local auto-fill-function) i.s.o (add-function :around normal-auto-fill-function ] But maybe a cleaner patch would change the C code so it doesn't (funcall auto-fill-function) directly but instead it calls a fixed Elisp function which does the comment-auto-fill-only-comments check and then funcalls auto-fill-function. This would probably make it desirable to move auto-fill-function from buffer.c to simple.el or fill.el. Stefan