changeset: 4555:20c32e48923530d9f7b78a89f925a4c6cb93051b
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun May 11 19:50:10 2008 +0200
files: lisp/ChangeLog lisp/coding.el
description:
Add #'query-coding-clear-highlights.
2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
* coding.el (query-coding-clear-highlights):
New function--clear any face information added by
`query-coding-region'.
(default-query-coding-region): Use it.
diff -r 4953b7353349ac3293d419461fee6a71cf63c115 -r
20c32e48923530d9f7b78a89f925a4c6cb93051b lisp/ChangeLog
--- a/lisp/ChangeLog Sat May 03 13:09:06 2008 +0200
+++ b/lisp/ChangeLog Sun May 11 19:50:10 2008 +0200
@@ -1,3 +1,10 @@ 2008-04-13 Henry S. Thompson <ht(a)inf.ed
+2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * coding.el (query-coding-clear-highlights):
+ New function--clear any face information added by
+ `query-coding-region'.
+ (default-query-coding-region): Use it.
+
2008-04-13 Henry S. Thompson <ht(a)inf.ed.ac.uk>, Mike Sperber
<mike(a)xemacs.org>
* window-xemacs.el (save-window-excursion/mapping,
diff -r 4953b7353349ac3293d419461fee6a71cf63c115 -r
20c32e48923530d9f7b78a89f925a4c6cb93051b lisp/coding.el
--- a/lisp/coding.el Sat May 03 13:09:06 2008 +0200
+++ b/lisp/coding.el Sun May 11 19:50:10 2008 +0200
@@ -286,6 +286,20 @@ if does not differ from the encoded stri
#s(hash-table test equal data ())
"A map from list of charsets to `skip-chars-forward' arguments for
them.")
+(defsubst query-coding-clear-highlights (begin end &optional buffer)
+ "Remove extent faces added by `query-coding-region' between BEGIN and END.
+
+Optional argument BUFFER is the buffer to use, and defaults to the current
+buffer.
+
+The HIGHLIGHTP argument to `query-coding-region' indicates that it should
+display unencodable characters using `query-coding-warning-face'. After
+this function has been called, this will no longer be the case. "
+ (map-extents #'(lambda (extent ignored-arg)
+ (when (eq 'query-coding-warning-face
+ (extent-face extent))
+ (delete-extent extent))) buffer begin end))
+
(defun default-query-coding-region (begin end coding-system
&optional buffer errorp highlightp)
"The default `query-coding-region' implementation.
@@ -319,10 +333,7 @@ addition, characters that can be safely
safe-charsets "")
default-query-coding-region-safe-charset-skip-chars-map)))
(when highlightp
- (map-extents #'(lambda (extent ignored-arg)
- (when (eq 'query-coding-warning-face
- (extent-face extent))
- (delete-extent extent))) buffer begin end))
+ (query-coding-clear-highlights begin end buffer))
(if (and (zerop (length skip-chars-arg)) (null safe-chars))
(progn
;; Uh-oh, nothing known about this coding system. Fail.
@@ -384,7 +395,7 @@ addition, characters that can be safely
(values nil ranges)
(values t nil))))))
-(defsubst query-coding-region (start end coding-system &optional buffer
+(defun query-coding-region (start end coding-system &optional buffer
errorp highlight)
"Work out whether CODING-SYSTEM can losslessly encode a region.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches