summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2006-04-10 14:52:24 +0000
committerKaroly Lorentey <lorentey@elte.hu>2006-04-10 14:52:24 +0000
commite349ae3b6b6db99d11321622fadff88bc42c1125 (patch)
tree7a24a5dad70d4b3695f227681fc37e179551d24a /lisp/simple.el
parent2518de51d20e848711c712f5030e8c207a4e2840 (diff)
parent4f07f2e8a5458758dcf2bfbdf9b0cf8c91a8572e (diff)
downloademacs-e349ae3b6b6db99d11321622fadff88bc42c1125.tar.gz
Merged from
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-188 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-189 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-190 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-191 Undo incorrect merge of etc/images/README from Gnus 5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-192 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-193 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-194 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-195 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-196 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-197 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-198 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-199 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-200 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-201 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-202 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-203 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-204 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-205 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-206 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-73 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-74 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-75 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-76 Update from CVS: README: Addition from 5.10.6 tar ball. * emacs@sv.gnu.org/gnus--rel--5.10--patch-77 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-78 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-79 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-80 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-547
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el46
1 files changed, 32 insertions, 14 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 812c2d1fa2e..99192d79ec0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1038,7 +1038,10 @@ display the result of expression evaluation."
Value is also consed on to front of the variable `values'.
Optional argument EVAL-EXPRESSION-INSERT-VALUE, if non-nil, means
insert the result into the current buffer instead of printing it in
-the echo area."
+the echo area.
+
+If `eval-expression-debug-on-error' is non-nil, which is the default,
+this command arranges for all errors to enter the debugger."
(interactive
(list (read-from-minibuffer "Eval: "
nil read-expression-map t
@@ -2317,7 +2320,7 @@ return value of `filter-buffer-substring'.
If this variable is nil, no filtering is performed.")
-(defun filter-buffer-substring (beg end &optional delete)
+(defun filter-buffer-substring (beg end &optional delete noprops)
"Return the buffer substring between BEG and END, after filtering.
The buffer substring is passed through each of the filter
functions in `buffer-substring-filters', and the value from the
@@ -2327,21 +2330,36 @@ is nil, the buffer substring is returned unaltered.
If DELETE is non-nil, the text between BEG and END is deleted
from the buffer.
+If NOPROPS is non-nil, final string returned does not include
+text properties, while the string passed to the filters still
+includes text properties from the buffer text.
+
Point is temporarily set to BEG before calling
`buffer-substring-filters', in case the functions need to know
where the text came from.
-This function should be used instead of `buffer-substring' or
-`delete-and-extract-region' when you want to allow filtering to
-take place. For example, major or minor modes can use
-`buffer-substring-filters' to extract characters that are special
-to a buffer, and should not be copied into other buffers."
- (save-excursion
- (goto-char beg)
- (let ((string (if delete (delete-and-extract-region beg end)
- (buffer-substring beg end))))
- (dolist (filter buffer-substring-filters string)
- (setq string (funcall filter string))))))
+This function should be used instead of `buffer-substring',
+`buffer-substring-no-properties', or `delete-and-extract-region'
+when you want to allow filtering to take place. For example,
+major or minor modes can use `buffer-substring-filters' to
+extract characters that are special to a buffer, and should not
+be copied into other buffers."
+ (cond
+ ((or delete buffer-substring-filters)
+ (save-excursion
+ (goto-char beg)
+ (let ((string (if delete (delete-and-extract-region beg end)
+ (buffer-substring beg end))))
+ (dolist (filter buffer-substring-filters)
+ (setq string (funcall filter string)))
+ (if noprops
+ (set-text-properties 0 (length string) nil string))
+ string)))
+ (noprops
+ (buffer-substring-no-properties beg end))
+ (t
+ (buffer-substring beg end))))
+
;;;; Window system cut and paste hooks.
@@ -3731,7 +3749,7 @@ If point reaches the beginning or end of buffer, it stops there.
To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
(interactive "p")
(or arg (setq arg 1))
-
+
(let ((orig (point)))
;; Move by lines, if ARG is not 1 (the default).