emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114695: * lisp/skeleton.el (skeleton-newline): Remo


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114695: * lisp/skeleton.el (skeleton-newline): Remove.
Date: Thu, 17 Oct 2013 04:51:14 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114695
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2013-10-17 00:51:05 -0400
message:
  * lisp/skeleton.el (skeleton-newline): Remove.
  (skeleton-internal-1): Use (insert "\n") instead.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/skeleton.el               skeleton.el-20091113204419-o5vbwnq5f7feedwu-728
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-10-17 04:49:42 +0000
+++ b/lisp/ChangeLog    2013-10-17 04:51:05 +0000
@@ -1,5 +1,8 @@
 2013-10-17  Stefan Monnier  <address@hidden>
 
+       * skeleton.el (skeleton-newline): Remove.
+       (skeleton-internal-1): Use (insert "\n") instead.
+
        * emacs-lisp/lisp.el (lisp-completion-at-point): Complete var names for
        let-bindings.
 

=== modified file 'lisp/skeleton.el'
--- a/lisp/skeleton.el  2013-06-05 19:57:10 +0000
+++ b/lisp/skeleton.el  2013-10-17 04:51:05 +0000
@@ -356,15 +356,6 @@
       (signal 'quit 'recursive)
     recursive))
 
-(defun skeleton-newline ()
-  (if (or (eq (point) skeleton-point)
-          (eq (point) (car skeleton-positions)))
-      ;; If point is recorded, avoid `newline' since it may do things like
-      ;; strip trailing spaces, and since recorded points are commonly placed
-      ;; right after a trailing space, calling `newline' can destroy the
-      ;; position and renders the recorded position incorrect.
-      (insert "\n")
-    (newline)))
 
 (defun skeleton-internal-1 (element &optional literal recursive)
   (cond
@@ -384,7 +375,7 @@
     (let ((pos (if (eq element '>) (point))))
       (cond
        ((and skeleton-regions (eq (nth 1 skeleton-il) '_))
-       (or (eolp) (newline))
+       (or (eolp) (insert "\n"))
        (if pos (save-excursion (goto-char pos) (indent-according-to-mode)))
        (indent-region (line-beginning-position)
                       (car skeleton-regions) nil))
@@ -393,13 +384,13 @@
        (if pos (indent-according-to-mode)))
        (skeleton-newline-indent-rigidly
        (let ((pt (point)))
-         (skeleton-newline)
+          (insert "\n")
          (indent-to (save-excursion
                       (goto-char pt)
                       (if pos (indent-according-to-mode))
                       (current-indentation)))))
        (t (if pos (reindent-then-newline-and-indent)
-           (skeleton-newline)
+           (insert "\n")
            (indent-according-to-mode))))))
    ((eq element '>)
     (if (and skeleton-regions (eq (nth 1 skeleton-il) '_))


reply via email to

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