Mercurial > emacs
changeset 62565:2b285bf6f228
(calc-invalidate-units-table): Use inhibit-read-only.
(math-build-units-table-buffer): Use view-mode.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Fri, 20 May 2005 22:37:14 +0000 |
parents | c013c4474e31 |
children | 48398831c474 |
files | lisp/calc/calc-units.el |
diffstat | 1 files changed, 60 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/calc/calc-units.el Fri May 20 22:05:21 2005 +0000 +++ b/lisp/calc/calc-units.el Fri May 20 22:37:14 2005 +0000 @@ -555,7 +555,7 @@ (save-excursion (goto-char (point-min)) (if (looking-at "Calculator Units Table") - (let ((buffer-read-only nil)) + (let ((inhibit-read-only t)) (insert "(Obsolete) ")))))))) (defun calc-get-unit-definition (uname) @@ -1310,65 +1310,65 @@ (save-excursion (message "Formatting units table...") (set-buffer buf) - (setq buffer-read-only nil) - (erase-buffer) - (insert "Calculator Units Table:\n\n") - (insert "Unit Type Definition Description\n\n") - (while uptr - (setq u (car uptr) - name (nth 2 u)) - (when (eq (car u) 'm) - (setq std t)) - (setq shadowed (and std (assq (car u) math-additional-units))) - (when (and name - (> (length name) 1) - (eq (aref name 0) ?\*)) - (unless (eq uptr math-units-table) - (insert "\n")) - (setq name (substring name 1))) - (insert " ") - (and shadowed (insert "(")) - (insert (symbol-name (car u))) - (and shadowed (insert ")")) - (if (nth 3 u) - (progn - (indent-to 10) - (insert (symbol-name (nth 3 u)))) - (or std - (progn - (indent-to 10) - (insert "U")))) - (indent-to 14) - (and shadowed (insert "(")) - (if (nth 1 u) - (insert (math-format-value (nth 1 u) 80)) - (insert (symbol-name (car u)))) - (and shadowed (insert ")")) - (indent-to 41) - (insert " ") - (when name - (insert name)) - (if shadowed - (insert " (redefined above)") - (unless (nth 1 u) - (insert " (base unit)"))) - (insert "\n") - (setq uptr (cdr uptr))) - (insert "\n\nUnit Prefix Table:\n\n") - (setq uptr math-unit-prefixes) - (while uptr - (setq u (car uptr)) - (insert " " (char-to-string (car u))) - (if (equal (nth 1 u) (nth 1 (nth 1 uptr))) - (insert " " (char-to-string (car (car (setq uptr (cdr uptr))))) - " ") - (insert " ")) - (insert "10^" (int-to-string (nth 2 (nth 1 u)))) - (indent-to 15) - (insert " " (nth 2 u) "\n") - (while (eq (car (car (setq uptr (cdr uptr)))) 0))) - (insert "\n") - (setq buffer-read-only t) + (let ((inhibit-read-only t)) + (erase-buffer) + (insert "Calculator Units Table:\n\n") + (insert "Unit Type Definition Description\n\n") + (while uptr + (setq u (car uptr) + name (nth 2 u)) + (when (eq (car u) 'm) + (setq std t)) + (setq shadowed (and std (assq (car u) math-additional-units))) + (when (and name + (> (length name) 1) + (eq (aref name 0) ?\*)) + (unless (eq uptr math-units-table) + (insert "\n")) + (setq name (substring name 1))) + (insert " ") + (and shadowed (insert "(")) + (insert (symbol-name (car u))) + (and shadowed (insert ")")) + (if (nth 3 u) + (progn + (indent-to 10) + (insert (symbol-name (nth 3 u)))) + (or std + (progn + (indent-to 10) + (insert "U")))) + (indent-to 14) + (and shadowed (insert "(")) + (if (nth 1 u) + (insert (math-format-value (nth 1 u) 80)) + (insert (symbol-name (car u)))) + (and shadowed (insert ")")) + (indent-to 41) + (insert " ") + (when name + (insert name)) + (if shadowed + (insert " (redefined above)") + (unless (nth 1 u) + (insert " (base unit)"))) + (insert "\n") + (setq uptr (cdr uptr))) + (insert "\n\nUnit Prefix Table:\n\n") + (setq uptr math-unit-prefixes) + (while uptr + (setq u (car uptr)) + (insert " " (char-to-string (car u))) + (if (equal (nth 1 u) (nth 1 (nth 1 uptr))) + (insert " " (char-to-string (car (car (setq uptr (cdr uptr))))) + " ") + (insert " ")) + (insert "10^" (int-to-string (nth 2 (nth 1 u)))) + (indent-to 15) + (insert " " (nth 2 u) "\n") + (while (eq (car (car (setq uptr (cdr uptr)))) 0))) + (insert "\n")) + (view-mode) (message "Formatting units table...done")) (setq math-units-table-buffer-valid t) (let ((oldbuf (current-buffer)))