emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114951: * lisp/electric.el (electric-indent-post-se


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114951: * lisp/electric.el (electric-indent-post-self-insert-function):
Date: Mon, 04 Nov 2013 20:04:38 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114951
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15767
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2013-11-04 15:04:25 -0500
message:
  * lisp/electric.el (electric-indent-post-self-insert-function):
  Only delete trailing whitepsace if it is indeed trailing.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/electric.el               electric.el-20091113204419-o5vbwnq5f7feedwu-47
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-11-04 19:50:56 +0000
+++ b/lisp/ChangeLog    2013-11-04 20:04:25 +0000
@@ -1,3 +1,8 @@
+2013-11-04  Stefan Monnier  <address@hidden>
+
+       * electric.el (electric-indent-post-self-insert-function):
+       Only delete trailing whitepsace if it is indeed trailing (bug#15767).
+
 2013-11-04  Helmut Eller  <address@hidden>
 
        * emacs-lisp/cl-indent.el (with-compilation-unit): Add rule (bug#15782).

=== modified file 'lisp/electric.el'
--- a/lisp/electric.el  2013-10-07 18:51:26 +0000
+++ b/lisp/electric.el  2013-11-04 20:04:25 +0000
@@ -251,9 +251,10 @@
             ;; whereas we need `move after insertion', so we do the
             ;; save/restore by hand.
             (goto-char before)
-            ;; Remove the trailing whitespace after indentation because
-            ;; indentation may (re)introduce the whitespace.
-            (delete-horizontal-space t))))
+           (when (eolp)
+             ;; Remove the trailing whitespace after indentation because
+             ;; indentation may (re)introduce the whitespace.
+             (delete-horizontal-space t)))))
       (unless (or (memq indent-line-function '(indent-to-left-margin))
                   (and electric-indent-inhibit
                        (> pos (line-beginning-position))))
@@ -270,7 +271,6 @@
 the hook `electric-indent-functions' returns non-nil, or you
 insert a character from `electric-indent-chars'."
   :global t
-  :group 'electricity
   (if (not electric-indent-mode)
       (remove-hook 'post-self-insert-hook
                    #'electric-indent-post-self-insert-function)
@@ -294,7 +294,6 @@
 (defcustom electric-pair-pairs
   '((?\" . ?\"))
   "Alist of pairs that should be used regardless of major mode."
-  :group 'electricity
   :version "24.1"
   :type '(repeat (cons character character)))
 
@@ -304,7 +303,6 @@
 just skip that character instead, so that hitting ( followed by ) results
 in \"()\" rather than \"())\".
 This can be convenient for people who find it easier to hit ) than C-f."
-  :group 'electricity
   :version "24.1"
   :type 'boolean)
 
@@ -410,7 +408,6 @@
 
 See options `electric-pair-pairs' and `electric-pair-skip-self'."
   :global t
-  :group 'electricity
   (if electric-pair-mode
       (progn
        (add-hook 'post-self-insert-hook
@@ -463,7 +460,6 @@
 the mode if ARG is omitted or nil.
 The variable `electric-layout-rules' says when and how to insert newlines."
   :global t
-  :group 'electricity
   (if electric-layout-mode
       (add-hook 'post-self-insert-hook
                 #'electric-layout-post-self-insert-function)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]