Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
62ee8b1a
Commit
62ee8b1a
authored
Oct 31, 2014
by
Stefan Monnier
Browse files
* lisp/simple.el (newline): Add assertions to try and help catch bug#18913.
parent
4e0cc351
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
lisp/ChangeLog
lisp/ChangeLog
+2
-0
lisp/simple.el
lisp/simple.el
+8
-2
No files found.
lisp/ChangeLog
View file @
62ee8b1a
2014-10-31 Stefan Monnier <monnier@iro.umontreal.ca>
* simple.el (newline): Add assertions to try and help catch bug#18913.
* emulation/cua-base.el (cua-delete-region): Use delete-active-region
(bug#18886).
(cua--last-deleted-region-pos, cua--last-deleted-region-text): Remove.
...
...
lisp/simple.el
View file @
62ee8b1a
...
...
@@ -28,6 +28,8 @@
;;; Code:
(eval-when-compile (require 'cl-lib))
(declare-function widget-convert "wid-edit" (type &rest args))
(declare-function shell-mode "shell" ())
...
...
@@ -410,6 +412,7 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
;; Do the rest in post-self-insert-hook, because we want to do it
;; *before* other functions on that hook.
(lambda ()
(cl-assert (eq ?\n (char-before)))
;; Mark the newline(s) `hard'.
(if use-hard-newlines
(set-hard-newline-properties
...
...
@@ -428,7 +431,8 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
;; starts a page.
(or was-page-start
(move-to-left-margin nil t)))))
(if (not interactive)
(unwind-protect
(if (not interactive)
;; FIXME: For non-interactive uses, many calls actually just want
;; (insert "\n"), so maybe we should do just that, so as to avoid
;; the risk of filling or running abbrevs unexpectedly.
...
...
@@ -441,7 +445,9 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
;; We first used let-binding to protect the hook, but that was naive
;; since add-hook affects the symbol-default value of the variable,
;; whereas the let-binding might only protect the buffer-local value.
(remove-hook 'post-self-insert-hook postproc))))
(remove-hook 'post-self-insert-hook postproc)))
(cl-assert (not (member postproc post-self-insert-hook)))
(cl-assert (not (member postproc (default-value 'post-self-insert-hook))))))
nil)
(defun set-hard-newline-properties (from to)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment