From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: shouldn't `delete-blank-lines' treat form-feed as whitespace? Date: Wed, 3 Mar 2010 11:54:09 -0800 Message-ID: <45AE884B58464C6F8533A686709EB31B@us.oracle.com> References: <4CB6D99021EF440EAB10FFDB2740FE8B@us.oracle.com> <87mxyptfyp.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1267646877 22565 80.91.229.12 (3 Mar 2010 20:07:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 3 Mar 2010 20:07:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Juri Linkov'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 03 21:07:53 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NmurH-0001t3-P1 for ged-emacs-devel@m.gmane.org; Wed, 03 Mar 2010 21:07:52 +0100 Original-Received: from localhost ([127.0.0.1]:54641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmurH-0005w2-3C for ged-emacs-devel@m.gmane.org; Wed, 03 Mar 2010 15:07:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nmued-0006vv-2G for emacs-devel@gnu.org; Wed, 03 Mar 2010 14:54:47 -0500 Original-Received: from [140.186.70.92] (port=43504 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nmuec-0006tz-49 for emacs-devel@gnu.org; Wed, 03 Mar 2010 14:54:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nmuea-0006GG-Up for emacs-devel@gnu.org; Wed, 03 Mar 2010 14:54:46 -0500 Original-Received: from acsinet12.oracle.com ([141.146.126.234]:59757) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nmuea-0006Fr-HY for emacs-devel@gnu.org; Wed, 03 Mar 2010 14:54:44 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o23JsfoA014449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Mar 2010 19:54:42 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o23IRYSt016277; Wed, 3 Mar 2010 19:54:40 GMT Original-Received: from abhmt005.oracle.com by acsmt353.oracle.com with ESMTP id 58360851267646049; Wed, 03 Mar 2010 11:54:09 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Mar 2010 11:54:08 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87mxyptfyp.fsf@mail.jurta.org> Thread-Index: Acq7CN3fHy4DTI/qQbSMQcW4EqcvpQAANqNQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt353.oracle.com [141.146.40.153] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090205.4B8EBE81.0043:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:121618 Archived-At: > > `delete-blank-lines' treats SPC, TAB, and newline as whitespace. > > Shouldn't it also treat form-feed (aka \f, aka ^L) as whitespace? > > Maybe it should depend of the current buffer's syntax? I mean using > "[:space:]" in `delete-blank-lines'. Yes, I suppose the notion of whitespace is mode-dependent, and [:space:] should capture that notion appropriately for each mode. Good point. > This has a problem: e.g. in Lisp mode \n has the > `endcomment' syntax instead of `whitespace'. Hm. Then we seem to have a choice: 1. Always consider \n, \t, \f, SPC, etc. as whitespace for purposes of `delete-blank-lines', _in addition_ to whatever other characters might correspond to [:space:] for the given mode. 2. Use only [:space:], always, as the sole "whitespace" criterion for `delete-blank-lines'. Your \n as `endcomment' example seems to show that the notion of "whitespace" for syntax table purposes is too restrictive to use as the criterion for things like `delete-blank-lines'. So [:space:] would not be an adequate (sole) criterion. We could add an optional arg to `delete-blank-lines' that would override whatever default behavior we decide on, but the default choice is important, as it affects existing calls to `delete-blank-lines'. I'm leaning toward #1 above. It seems to me that `delete-blank-lines' uses a notion of blank line, and that should always include things like \n, even if that has `endcomment' syntax.