unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Dave Abrahams <dave@boostpro.com>
Cc: 15767-done@debbugs.gnu.org
Subject: bug#15767: 24.3; [patch] electric-indent-mode bug
Date: Mon, 04 Nov 2013 15:04:31 -0500	[thread overview]
Message-ID: <jwvbo20hr59.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <m2bo269xa1.fsf@da0603a-dhcp217.apple.com> (Dave Abrahams's message of "Wed, 30 Oct 2013 16:03:34 -0700")

>   (electric-indent-mode)
>   (electric-layout-mode)
>   (setq electric-indent-chars (append "{}" electric-indent-chars))
>   (setq electric-layout-rules '((?\{ . after) (?\} . before)))

> 3. type `f o o SPC {'

Thanks.  Your patch defeated a useful case, so I replaced it with the
one below,


        Stefan


--- lisp/electric.el	2013-10-07 18:51:26 +0000
+++ lisp/electric.el	2013-11-04 20:01:20 +0000
@@ -251,9 +251,10 @@
             ;; whereas we need `move after insertion', so we do the
             ;; save/restore by hand.
             (goto-char before)
+	    (when (eolp)
             ;; Remove the trailing whitespace after indentation because
             ;; indentation may (re)introduce the whitespace.
-            (delete-horizontal-space t))))
+	      (delete-horizontal-space t)))))
       (unless (or (memq indent-line-function '(indent-to-left-margin))
                   (and electric-indent-inhibit
                        (> pos (line-beginning-position))))





  parent reply	other threads:[~2013-11-04 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 23:03 bug#15767: 24.3; [patch] electric-indent-mode bug Dave Abrahams
2013-10-31 17:06 ` Stefan Monnier
2013-11-01  3:27   ` Dave Abrahams
2013-11-04 20:04 ` Stefan Monnier [this message]
     [not found] ` <handler.15767.D15767.138359548417885.notifdone@debbugs.gnu.org>
2013-11-05  5:06   ` bug#15767: closed (Re: bug#15767: 24.3; [patch] electric-indent-mode bug) Dave Abrahams
2013-11-05 15:44     ` Stefan Monnier
2013-11-05 15:54       ` Dave Abrahams

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=jwvbo20hr59.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=15767-done@debbugs.gnu.org \
    --cc=dave@boostpro.com \
    /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).