unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 17801-done@debbugs.gnu.org
Subject: bug#17801: 24.3.91; Regression: Texinfo Mode inserts newline after markup
Date: Fri, 20 Jun 2014 09:19:59 -0400	[thread overview]
Message-ID: <jwvionvsp66.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <83bntorme5.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jun 2014 11:54:58 +0300")

>> Indeed, that's why I haven't made such a change.
> Should we make such a change on the trunk at this time?

We could try, yes.  I bumped into this problem many years ago and didn't
dare to make such a change back then (instead, I added the
skeleton-end-newline variable, so that at least you can get rid of these
newlines without having to remove a lambda expression from a hook).

> Btw, while working on this, I bumped into some strange feature: the
> last \n element in a skeleton is only obeyed when it would be inserted
> not at end of line.  This is explicitly coded in skeleton.el:

>        ;; \n as last element only inserts \n if not at eol.
>        ((and (null (cdr skeleton-il)) (not recursive) (eolp))

Right, this is specifically so you can write skeletons which do the same
regardless of skeleton-end-newline.  I.e. so that after changing the
default of skeleton-end-newline, you can tell people they can fix their
skeletons by simply adding a final \n rather than having to test Emacs
version or the value of skeleton-end-newline.

> For this reason, if a skeleton wants to always insert a newline at the
> end, it quite embarrassingly must end with 2 \n elements, and risk
> inserting an extra newline in some cases.

Right, but this need is very rare in my experience.  You can always use
some other element, like "\n" instead.


        Stefan





      reply	other threads:[~2014-06-20 13:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 14:57 bug#17801: 24.3.91; Regression: Texinfo Mode inserts newline after markup Eli Zaretskii
2014-06-19  3:54 ` Stefan Monnier
2014-06-19 14:54   ` Eli Zaretskii
2014-06-19 15:44     ` Stefan Monnier
2014-06-20  8:54       ` Eli Zaretskii
2014-06-20 13:19         ` Stefan Monnier [this message]

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=jwvionvsp66.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=17801-done@debbugs.gnu.org \
    --cc=eliz@gnu.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).