comparison lisp/mule/mule-coding.el @ 80:1ce6082ce73f r20-0b90

Import from CVS: tag r20-0b90
author cvs
date Mon, 13 Aug 2007 09:06:37 +0200
parents 54cc21c15cbb
children 364816949b59
comparison
equal deleted inserted replaced
79:5b0a5bbffab6 80:1ce6082ce73f
40 (get-coding-system coding-system) ;; correctness check 40 (get-coding-system coding-system) ;; correctness check
41 (setq pathname-coding-system coding-system)) 41 (setq pathname-coding-system coding-system))
42 42
43 (defun what-coding-system (start end &optional arg) 43 (defun what-coding-system (start end &optional arg)
44 "Show the encoding of text in the region. 44 "Show the encoding of text in the region.
45 With prefix arg, show all possible coding systems.
46 This function is meant to be called interactively; 45 This function is meant to be called interactively;
47 from a Lisp program, use `detect-coding-region' instead." 46 from a Lisp program, use `detect-coding-region' instead."
48 (interactive "r\nP") 47 (interactive "r\nP")
49 (let ((codings (detect-coding-region start end))) 48 (princ (detect-coding-region start end)))
50 (message "%s" (if (or arg (symbolp codings)) codings (car codings)))))
51 49
52 (defmacro with-string-as-buffer-contents (str &rest body) 50 (defmacro with-string-as-buffer-contents (str &rest body)
53 "With the contents of the current buffer being STR, run BODY. 51 "With the contents of the current buffer being STR, run BODY.
54 Returns the new contents of the buffer, as modified by BODY. 52 Returns the new contents of the buffer, as modified by BODY.
55 The original current buffer is restored afterwards." 53 The original current buffer is restored afterwards."