changeset 5820:3443820118a0

(makefile-browser-fill, makefile-browser-toggle): Bind inhibit-read-only; don't set buffer-read-only.
author Richard M. Stallman <rms@gnu.org>
date Mon, 07 Feb 1994 05:54:34 +0000
parents b047e246c13d
children 4212fd8028bb
files lisp/progmodes/make-mode.el
diffstat 1 files changed, 32 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/make-mode.el	Mon Feb 07 05:43:51 1994 +0000
+++ b/lisp/progmodes/make-mode.el	Mon Feb 07 05:54:34 1994 +0000
@@ -18,7 +18,7 @@
 
 ;; So, for the meantime, this is not the default mode for makefiles.
 
-;; $Id: makefile.el,v 1.10 1993/12/23 04:57:18 rms Exp rms $
+;; $Id: makefile.el,v 1.11 1994/01/06 09:59:12 rms Exp rms $
 
 ;; This file is part of GNU Emacs.
 
@@ -654,25 +654,24 @@
 	   (makefile-format-macro-ref macro))))
 
 (defun makefile-browser-fill (targets macros)
-  (setq buffer-read-only nil)
-  (goto-char (point-min))
-  (erase-buffer)
-  (mapconcat
-   (function
-    (lambda (item) (insert (makefile-browser-format-target-line (car item) nil) "\n")))
-   targets
-   "")
-  (mapconcat
-   (function
-    (lambda (item) (insert (makefile-browser-format-macro-line (car item) nil) "\n")))
-   macros
-   "")
-  (sort-lines nil (point-min) (point-max))
-  (goto-char (1- (point-max)))
-  (delete-char 1)			; remove unnecessary newline at eob
-  (goto-char (point-min))
-  (forward-char makefile-browser-cursor-column)
-  (setq buffer-read-only t))
+  (let ((inhibit-read-only t))
+    (goto-char (point-min))
+    (erase-buffer)
+    (mapconcat
+     (function
+      (lambda (item) (insert (makefile-browser-format-target-line (car item) nil) "\n")))
+     targets
+     "")
+    (mapconcat
+     (function
+      (lambda (item) (insert (makefile-browser-format-macro-line (car item) nil) "\n")))
+     macros
+     "")
+    (sort-lines nil (point-min) (point-max))
+    (goto-char (1- (point-max)))
+    (delete-char 1)			; remove unnecessary newline at eob
+    (goto-char (point-min))
+    (forward-char makefile-browser-cursor-column)))
 
 ;;;
 ;;; Moving up and down in the browser
@@ -719,22 +718,21 @@
     (setq this-line (max 1 this-line))
     (makefile-browser-toggle-state-for-line this-line)
     (goto-line this-line)
-    (setq buffer-read-only nil)
-    (beginning-of-line)
-    (if (makefile-browser-on-macro-line-p)
-	(let ((macro-name (makefile-browser-this-line-macro-name)))
+    (let ((inhibit-read-only t))
+      (beginning-of-line)
+      (if (makefile-browser-on-macro-line-p)
+	  (let ((macro-name (makefile-browser-this-line-macro-name)))
+	    (kill-line)
+	    (insert
+	     (makefile-browser-format-macro-line
+		macro-name
+		(makefile-browser-get-state-for-line this-line))))
+	(let ((target-name (makefile-browser-this-line-target-name)))
 	  (kill-line)
 	  (insert
-	   (makefile-browser-format-macro-line
-	      macro-name
-	      (makefile-browser-get-state-for-line this-line))))
-      (let ((target-name (makefile-browser-this-line-target-name)))
-	(kill-line)
-	(insert
-	 (makefile-browser-format-target-line
-	    target-name
-	    (makefile-browser-get-state-for-line this-line)))))
-    (setq buffer-read-only t)
+	   (makefile-browser-format-target-line
+	      target-name
+	      (makefile-browser-get-state-for-line this-line))))))
     (beginning-of-line)
     (forward-char makefile-browser-cursor-column)
     (if makefile-browser-auto-advance-after-selection-p