From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.devel Subject: Re: Inhibiting read-only Date: Wed, 19 Jun 2013 22:18:28 +0530 Message-ID: <878v2682sj.fsf@gmail.com> References: <87ehby84p1.fsf@gmail.com> <87a9mm83x7.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371660453 28287 80.91.229.3 (19 Jun 2013 16:47:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Jun 2013 16:47:33 +0000 (UTC) Cc: Emacs developers To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 19 18:47:33 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UpLXg-0007CV-6W for ged-emacs-devel@m.gmane.org; Wed, 19 Jun 2013 18:47:32 +0200 Original-Received: from localhost ([::1]:40457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpLXf-0008CD-Su for ged-emacs-devel@m.gmane.org; Wed, 19 Jun 2013 12:47:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpLXc-0008C0-Rj for emacs-devel@gnu.org; Wed, 19 Jun 2013 12:47:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpLXb-0001cV-39 for emacs-devel@gnu.org; Wed, 19 Jun 2013 12:47:28 -0400 Original-Received: from mail-pd0-f176.google.com ([209.85.192.176]:51971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpLXa-0001cN-Tk for emacs-devel@gnu.org; Wed, 19 Jun 2013 12:47:27 -0400 Original-Received: by mail-pd0-f176.google.com with SMTP id t12so5227894pdi.21 for ; Wed, 19 Jun 2013 09:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=fm+1w40aOQDqXBN5n8gU9zEXIC1F7En0fSepkuQtS5U=; b=WeDWtD02O/PhlJgIBQvHvdCJm9demhVpxraSsXGRZfyPYZCI0pklgsWx6fjXXvdv7M 6rfp0f0PSuNMPbNLeQO3DhZs6tIjP5qFBsNGB7xRruDt0r288BzjJNJpMzuswKFu8B7w 3mwls3OPI5qIJXBuC3rOfyh7JDsUSzXiLCt0XRg3rgMqcdAYhOxYQH6xT8ABa98LLXdI jbRHklar+WmOY0FynH3KOm8xdPVPNPGdw8M1TCZbuYMziNWAULgm/OtB7i+62rSV9jRh RSKYVIy/jxepgQz7rVzkyOin1iM4ueugQ1GLFvNmosUn+U+9/yHcBdEwO+bTdAbceRx1 257g== X-Received: by 10.66.131.46 with SMTP id oj14mr7510859pab.111.1371660445879; Wed, 19 Jun 2013 09:47:25 -0700 (PDT) Original-Received: from debian-6.05 ([115.242.219.48]) by mx.google.com with ESMTPSA id ot10sm23819093pbb.12.2013.06.19.09.47.23 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 09:47:25 -0700 (PDT) In-Reply-To: (Juanma Barranquero's message of "Wed, 19 Jun 2013 18:30:15 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.176 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160685 Archived-At: Juanma Barranquero 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)))