changeset 57576:5e8a69bc2cfa

(calc-describe-bindings): Set `buffer-read-only' to nil while working in the keybindings buffer; remove some extra information from the keybindings buffer.
author Jay Belanger <jay.p.belanger@gmail.com>
date Mon, 18 Oct 2004 19:13:16 +0000
parents da44dbb5ee89
children ef480b4d6784
files lisp/calc/calc-help.el
diffstat 1 files changed, 21 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calc-help.el	Mon Oct 18 16:17:15 2004 +0000
+++ b/lisp/calc/calc-help.el	Mon Oct 18 19:13:16 2004 +0000
@@ -112,34 +112,27 @@
   (describe-bindings)
   (save-excursion
     (set-buffer "*Help*")
-    (goto-char (point-min))
-    (if (search-forward "Global bindings:" nil t)
-	(delete-region (match-beginning 0) (point-max)))
-    (goto-char (point-min))
-    (while (re-search-forward "\n[a-z] ESC" nil t)
-      (end-of-line)
-      (delete-region (match-beginning 0) (point)))
-    (goto-char (point-min))
-    (while (re-search-forward "\nESC m" nil t)
-      (end-of-line)
-      (delete-region (match-beginning 0) (point)))
-    (goto-char (point-min))
-    (while (search-forward "\n\n\n" nil t)
-      (backward-delete-char 1)
-      (backward-char 2))
-    (goto-char (point-min))
-    (while
-	(re-search-forward
-	 "\n[a-z] [0-9]\\(\t\t.*\n\\)\\([a-z] [0-9]\\1\\)*[a-z] \\([0-9]\\)\\1"
-	 nil t)
-      (let ((dig1 (char-after (1- (match-beginning 1))))
-	    (dig2 (char-after (match-beginning 3))))
-	(delete-region (match-end 1) (match-end 0))
-	(goto-char (match-beginning 1))
-	(delete-backward-char 1)
-	(delete-char 1)
-	(insert (format "%c .. %c" (min dig1 dig2) (max dig1 dig2)))))
-    (goto-char (point-min))))
+    (let ((buffer-read-only nil))
+      (goto-char (point-min))
+      (when (search-forward "Major Mode Bindings:" nil t)
+        (delete-region (point-min) (point))
+        (insert "Calc Mode Bindings:"))
+      (when (search-forward "Global bindings:" nil t)
+        (forward-line -1)
+        (delete-region (point) (point-max)))
+      (goto-char (point-min))
+      (while
+          (re-search-forward
+           "\n[a-z] [0-9]\\( .*\n\\)\\([a-z] [0-9]\\1\\)*[a-z] \\([0-9]\\)\\1"
+           nil t)
+        (let ((dig1 (char-after (1- (match-beginning 1))))
+              (dig2 (char-after (match-beginning 3))))
+          (delete-region (match-end 1) (match-end 0))
+          (goto-char (match-beginning 1))
+          (delete-backward-char 1)
+          (delete-char 5)
+          (insert (format "%c .. %c" (min dig1 dig2) (max dig1 dig2)))))
+      (goto-char (point-min)))))
 
 (defun calc-describe-key-briefly (key)
   (interactive "kDescribe key briefly: ")