aboutsummaryrefslogtreecommitdiff
path: root/lisp/emms.el
diff options
context:
space:
mode:
authorWilliam Xu <william.xwl@gmail.com>2009-08-06 18:50:21 +0800
committerWilliam Xu <william.xwl@gmail.com>2009-08-06 18:50:21 +0800
commitf64f5d9b9b3b1546d247033198504f164c2919ee (patch)
tree55e88ee4836135ced78fe02da094aad997810e69 /lisp/emms.el
parent97344c85a0657e479177620daa5b3bdc956e31fb (diff)
parent3e001aacb45633583282001d49634e080deaf8d7 (diff)
Merge branch 'master' of ssh://xwl@git.sv.gnu.org/srv/git/emms
Diffstat (limited to 'lisp/emms.el')
-rw-r--r--lisp/emms.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/emms.el b/lisp/emms.el
index 750781d..3c5402d 100644
--- a/lisp/emms.el
+++ b/lisp/emms.el
@@ -528,6 +528,27 @@ See `completing-read' for a description of ARGS."
(require 'emms-compat)
+;;; Utility functions
+
+(defun emms-insert-file-contents (filename &optional visit)
+ "Insert the contents of file FILENAME after point.
+Do character code conversion and end-of-line conversion, but none
+of the other unnecessary things like format decoding or
+`find-file-hook'.
+
+If VISIT is non-nil, the buffer's visited filename
+and last save file modtime are set, and it is marked unmodified.
+If visiting and the file does not exist, visiting is completed
+before the error is signaled."
+ (let ((format-alist nil)
+ (after-insert-file-functions nil)
+ (inhibit-file-name-handlers
+ (append '(jka-compr-handler image-file-handler epa-file-handler)
+ inhibit-file-name-handlers))
+ (inhibit-file-name-operation 'insert-file-contents))
+ (insert-file-contents filename visit)))
+
+
;;; Dictionaries
;; This is a simple helper data structure, used by both players