unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juri Linkov'" <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: RE: shouldn't `delete-blank-lines' treat form-feed as whitespace?
Date: Wed, 3 Mar 2010 11:54:09 -0800	[thread overview]
Message-ID: <45AE884B58464C6F8533A686709EB31B@us.oracle.com> (raw)
In-Reply-To: <87mxyptfyp.fsf@mail.jurta.org>

> > `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.






  reply	other threads:[~2010-03-03 19:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-28 20:44 shouldn't `delete-blank-lines' treat form-feed as whitespace? Drew Adams
2010-03-03 19:32 ` Juri Linkov
2010-03-03 19:54   ` Drew Adams [this message]
2010-03-04  4:28     ` Stefan Monnier
2010-03-05  8:48       ` Eli Zaretskii
2010-03-06 17:57         ` Juri Linkov
2010-03-06 18:56           ` Eli Zaretskii
2010-03-03 21:35 ` David De La Harpe Golden
2010-03-03 22:21   ` Drew Adams
2010-03-04  1:40   ` Miles Bader
2010-03-04  6:21     ` Drew Adams
     [not found] <E1No0yT-0007vs-HZ@mail.fsf.org>
2010-03-06 22:34 ` Jonathan Yavner
2010-03-07  4:14   ` Eli Zaretskii
2010-03-07  4:34     ` Jonathan Yavner
2010-03-07 17:42       ` Eli Zaretskii
2010-03-07 18:11       ` Stephen J. Turnbull
2010-03-07  5:08     ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45AE884B58464C6F8533A686709EB31B@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).