emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inhibiting read-only


From: Jambunathan K
Subject: Re: Inhibiting read-only
Date: Wed, 19 Jun 2013 22:18:28 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Juanma Barranquero <address@hidden> writes:

> I understand Lars' question as having a read-only buffer (not a
> read-only text property set from (point-min) to (point-max)) and
> wanting to deactivate it for some segments of the text.

I meant this.  M-: the below form.  You will see that first line is
editable.  But the second and third lines cannot be edited.

(with-current-buffer (generate-new-buffer  "read-only")
  (pop-to-buffer (current-buffer))
  (insert "first line\nsecond line\nthird line")  
  (goto-char (point-min))                   
  (add-text-properties (point-at-bol) (point-at-eol) '(read-only
                                                       editable))
  (forward-line 1)
  (add-text-properties (point) (point-max) '(read-only t))
  (setq inhibit-read-only '(editable)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]