From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: daniel Newsgroups: gmane.emacs.help Subject: Re: Narrow: How to hide a specific part? Date: Mon, 10 Jun 2013 14:43:09 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1370871826 24388 80.91.229.3 (10 Jun 2013 13:43:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Jun 2013 13:43:46 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Marius Hofert Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 10 15:43:47 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Um2Nu-0000So-Et for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Jun 2013 15:43:46 +0200 Original-Received: from localhost ([::1]:40517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um2Nu-00052U-0l for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Jun 2013 09:43:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um2Ng-00052P-IM for help-gnu-emacs@gnu.org; Mon, 10 Jun 2013 09:43:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um2Ne-000492-TE for help-gnu-emacs@gnu.org; Mon, 10 Jun 2013 09:43:32 -0400 Original-Received: from mail-pb0-x230.google.com ([2607:f8b0:400e:c01::230]:45371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um2Ne-00048v-Ji for help-gnu-emacs@gnu.org; Mon, 10 Jun 2013 09:43:30 -0400 Original-Received: by mail-pb0-f48.google.com with SMTP id ma3so1830240pbc.35 for ; Mon, 10 Jun 2013 06:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=uI99iBit9S5Ay3fgQApXe4NEGqPAMqwhyV6+hW6b/X4=; b=ZkiMhhkOQxeXt9mA1KEQUIGHHXDewIqfpBkKn1Cwn1jFknlzz2qP0BYTisFzVEHqeY Jsq91u1ujwFGilZhLptwVeecDTfEsxZmG8T87ahYqdo7cP+auinOfwC1eMUrdIrqa8Ka YfyLxGNsovn97FVpNrWHq0joTmS3TV0ICWTP6j8IYpXx0G6oPvHVsQi24wwzBzsuJ00i xIsDmG1RHeqqlgsGcVG8pb4kAaF7ifRYUxK7Td6bUAbNY88OTg1lC1TC0TD98Z0NCo5Y LpDLIPATte7dKLs9HAp0g1JUCg7HTMjeYPyCaoU7//SP2xTjxQrVWB9psTnCaVyCu6z/ 0r4w== X-Received: by 10.68.12.165 with SMTP id z5mr9898507pbb.172.1370871809650; Mon, 10 Jun 2013 06:43:29 -0700 (PDT) Original-Received: by 10.70.55.69 with HTTP; Mon, 10 Jun 2013 06:43:09 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::230 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91438 Archived-At: hi! that was an elisp programming answear, not an user answear! But you can load this elisp and then use functions hide-region and unhide-region (defun hide-region () (interactive) (setq ov (make-overlay (region-beginning) (region-end))) (overlay-put ov 'invisible t) (overlay-put ov 'my-overlay t) ) (defun unhide-region () (interactive) (loop for ov in (overlays-in (region-beginning) (region-end)) if (overlay-get ov 'my-overlay) do (delete-overlay ov) ) ) 2013/6/10 Marius Hofert > Hi Daniel, > > Thanks for your quick reply. > > You mean selecting B? But how do you make it invisible? AFAIK, > narrowing only makes regions visible, not invisible (?) > > Cheers, > > Marius > > On Mon, Jun 10, 2013 at 2:59 PM, daniel wrote: > > You could create an overlay in the B area and make it invisible, I > think... > > I did that one time. > > > > But most emacs function, like search, will continue to see the hidden > part. > > > > > > 2013/6/10 Marius Hofert > >> > >> Hi, > >> > >> I recently discovered narrowing (C-x n n). Say I have three > >> consecutive paragraphs... > >> > >> A > >> B > >> C > >> > >> ... and I want to hide the 'middle' one, that is, B, while keeping A > >> and C visible. Can this be done with narrowing? (or in any similar > >> way?). As far as I know, with narrowing, I can only narrow down to A > >> or C but can't make them both visible simultaneously. > >> > >> Cheers, > >> > >> Marius > >> > > >