Christophe Weblog Wiki Code Publications Music
slightly nicer iplayer-progress management
[iplayer-el.git] / iplayer.el
index 3ef51900c5f4cefdae65c338f9f50cd28a96957d..6c4352021471045b4a493591bd23ed3d17f01a08 100644 (file)
     ("2" . "BBC Two")
     ("3" . "BBC Three")
     ("4" . "BBC Four")
     ("2" . "BBC Two")
     ("3" . "BBC Three")
     ("4" . "BBC Four")
+    ("8" . "CBBC")
+    ("9" . "CBeebies")
 
     ("!" . "BBC Radio 1")
     ("\"" . "BBC Radio 2")
 
     ("!" . "BBC Radio 1")
     ("\"" . "BBC Radio 2")
@@ -224,17 +226,20 @@ The presets are defined in the variable `iplayer-presets'."
         (state (process-get process 'iplayer-state))
         (progress (process-get process 'iplayer-progress)))
     (with-current-buffer (get-buffer-create "*iplayer-progress*")
         (state (process-get process 'iplayer-state))
         (progress (process-get process 'iplayer-progress)))
     (with-current-buffer (get-buffer-create "*iplayer-progress*")
-      (goto-char (point-min))
-      (let ((found (re-search-forward (format "^%s:" id) nil 'end)))
-        (unless found
-          (unless (= (point) (progn (forward-line 0) (point)))
-            (goto-char (point-max))
-            (newline)))
-        (forward-line 0)
-        (let ((beg (point)))
-          (end-of-line)
-          (delete-region beg (point)))
-        (insert (format "%s: %s %s%%" id state progress))))))
+      (special-mode)
+      (save-excursion
+        (goto-char (point-min))
+        (let ((found (re-search-forward (format "^%s:" id) nil 'end))
+              (inhibit-read-only t))
+          (unless found
+            (unless (= (point) (progn (forward-line 0) (point)))
+              (goto-char (point-max))
+              (newline)))
+          (forward-line 0)
+          (let ((beg (point)))
+            (end-of-line)
+            (delete-region beg (point)))
+          (insert (format "%s: %s %s%%" id state progress)))))))
 
 (defun iplayer-download-process-filter (process string)
   (catch 'no-progress
 
 (defun iplayer-download-process-filter (process string)
   (catch 'no-progress