comparison lisp/progmodes/make-mode.el @ 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 4823e14b1314
children 1a2a8ef9b4af
comparison
equal deleted inserted replaced
5819:b047e246c13d 5820:3443820118a0
16 ;; and other usage is not high quality. Symbol names don't have `...'. 16 ;; and other usage is not high quality. Symbol names don't have `...'.
17 ;; The Mode names is written as makefile-mode instead of Makefile mode. 17 ;; The Mode names is written as makefile-mode instead of Makefile mode.
18 18
19 ;; So, for the meantime, this is not the default mode for makefiles. 19 ;; So, for the meantime, this is not the default mode for makefiles.
20 20
21 ;; $Id: makefile.el,v 1.10 1993/12/23 04:57:18 rms Exp rms $ 21 ;; $Id: makefile.el,v 1.11 1994/01/06 09:59:12 rms Exp rms $
22 22
23 ;; This file is part of GNU Emacs. 23 ;; This file is part of GNU Emacs.
24 24
25 ;; GNU Emacs is free software; you can redistribute it and/or modify 25 ;; GNU Emacs is free software; you can redistribute it and/or modify
26 ;; it under the terms of the GNU General Public License as published by 26 ;; it under the terms of the GNU General Public License as published by
652 makefile-browser-selected-mark 652 makefile-browser-selected-mark
653 makefile-browser-unselected-mark) 653 makefile-browser-unselected-mark)
654 (makefile-format-macro-ref macro)))) 654 (makefile-format-macro-ref macro))))
655 655
656 (defun makefile-browser-fill (targets macros) 656 (defun makefile-browser-fill (targets macros)
657 (setq buffer-read-only nil) 657 (let ((inhibit-read-only t))
658 (goto-char (point-min)) 658 (goto-char (point-min))
659 (erase-buffer) 659 (erase-buffer)
660 (mapconcat 660 (mapconcat
661 (function 661 (function
662 (lambda (item) (insert (makefile-browser-format-target-line (car item) nil) "\n"))) 662 (lambda (item) (insert (makefile-browser-format-target-line (car item) nil) "\n")))
663 targets 663 targets
664 "") 664 "")
665 (mapconcat 665 (mapconcat
666 (function 666 (function
667 (lambda (item) (insert (makefile-browser-format-macro-line (car item) nil) "\n"))) 667 (lambda (item) (insert (makefile-browser-format-macro-line (car item) nil) "\n")))
668 macros 668 macros
669 "") 669 "")
670 (sort-lines nil (point-min) (point-max)) 670 (sort-lines nil (point-min) (point-max))
671 (goto-char (1- (point-max))) 671 (goto-char (1- (point-max)))
672 (delete-char 1) ; remove unnecessary newline at eob 672 (delete-char 1) ; remove unnecessary newline at eob
673 (goto-char (point-min)) 673 (goto-char (point-min))
674 (forward-char makefile-browser-cursor-column) 674 (forward-char makefile-browser-cursor-column)))
675 (setq buffer-read-only t))
676 675
677 ;;; 676 ;;;
678 ;;; Moving up and down in the browser 677 ;;; Moving up and down in the browser
679 ;;; 678 ;;;
680 679
717 (interactive) 716 (interactive)
718 (let ((this-line (count-lines (point-min) (point)))) 717 (let ((this-line (count-lines (point-min) (point))))
719 (setq this-line (max 1 this-line)) 718 (setq this-line (max 1 this-line))
720 (makefile-browser-toggle-state-for-line this-line) 719 (makefile-browser-toggle-state-for-line this-line)
721 (goto-line this-line) 720 (goto-line this-line)
722 (setq buffer-read-only nil) 721 (let ((inhibit-read-only t))
723 (beginning-of-line) 722 (beginning-of-line)
724 (if (makefile-browser-on-macro-line-p) 723 (if (makefile-browser-on-macro-line-p)
725 (let ((macro-name (makefile-browser-this-line-macro-name))) 724 (let ((macro-name (makefile-browser-this-line-macro-name)))
725 (kill-line)
726 (insert
727 (makefile-browser-format-macro-line
728 macro-name
729 (makefile-browser-get-state-for-line this-line))))
730 (let ((target-name (makefile-browser-this-line-target-name)))
726 (kill-line) 731 (kill-line)
727 (insert 732 (insert
728 (makefile-browser-format-macro-line 733 (makefile-browser-format-target-line
729 macro-name 734 target-name
730 (makefile-browser-get-state-for-line this-line)))) 735 (makefile-browser-get-state-for-line this-line))))))
731 (let ((target-name (makefile-browser-this-line-target-name)))
732 (kill-line)
733 (insert
734 (makefile-browser-format-target-line
735 target-name
736 (makefile-browser-get-state-for-line this-line)))))
737 (setq buffer-read-only t)
738 (beginning-of-line) 736 (beginning-of-line)
739 (forward-char makefile-browser-cursor-column) 737 (forward-char makefile-browser-cursor-column)
740 (if makefile-browser-auto-advance-after-selection-p 738 (if makefile-browser-auto-advance-after-selection-p
741 (makefile-browser-next-line)))) 739 (makefile-browser-next-line))))
742 740