From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: customize hideshow.el? Date: Sun, 27 Aug 2017 07:07:24 -0500 Message-ID: <86shgdmcxv.fsf@stephe-leake.org> References: <861sofza80.fsf@stephe-leake.org> <83378vie3p.fsf@gnu.org> <86wp67xntx.fsf@stephe-leake.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1503835700 4521 195.159.176.226 (27 Aug 2017 12:08:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 Aug 2017 12:08:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 27 14:08:15 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlwMI-0000T5-4I for ged-emacs-devel@m.gmane.org; Sun, 27 Aug 2017 14:08:06 +0200 Original-Received: from localhost ([::1]:60754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlwMO-0001Hu-O1 for ged-emacs-devel@m.gmane.org; Sun, 27 Aug 2017 08:08:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlwLo-0001Hh-Kq for emacs-devel@gnu.org; Sun, 27 Aug 2017 08:07:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlwLl-00056u-Gb for emacs-devel@gnu.org; Sun, 27 Aug 2017 08:07:36 -0400 Original-Received: from smtp89.ord1d.emailsrvr.com ([184.106.54.89]:40851) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dlwLl-00052P-C1 for emacs-devel@gnu.org; Sun, 27 Aug 2017 08:07:33 -0400 Original-Received: from smtp12.relay.ord1d.emailsrvr.com (localhost [127.0.0.1]) by smtp12.relay.ord1d.emailsrvr.com (SMTP Server) with ESMTP id F2508E006C for ; Sun, 27 Aug 2017 08:07:25 -0400 (EDT) X-Auth-ID: board-president@tomahawk-creek-hoa.com Original-Received: by smtp12.relay.ord1d.emailsrvr.com (Authenticated sender: board-president-AT-tomahawk-creek-hoa.com) with ESMTPSA id C30B1E0066 for ; Sun, 27 Aug 2017 08:07:25 -0400 (EDT) X-Sender-Id: board-president@tomahawk-creek-hoa.com Original-Received: from Takver4 (76-218-37-33.lightspeed.kscymo.sbcglobal.net [76.218.37.33]) (using TLSv1.2 with cipher AES128-GCM-SHA256) by 0.0.0.0:25 (trex/5.7.12); Sun, 27 Aug 2017 08:07:25 -0400 In-Reply-To: <86wp67xntx.fsf@stephe-leake.org> (Stephen Leake's message of "Sun, 13 Aug 2017 14:35:54 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 184.106.54.89 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:217845 Archived-At: Stephen Leake writes: > Eli Zaretskii writes: > >>> From: Stephen Leake >>> Date: Sun, 13 Aug 2017 11:46:55 -0500 >>> >>> I'd like to customize hideshow.el to display the first and last line in >>> each hidden block. >> >> Did you try "C-x $" (with an appropriate numerical argument)? > > I was not aware of that. It affects the whole buffer, but that's not a > problem. > > With some wrappers to implement "hide lines more indented than this one" > and "unhide all", that might do it. > > Thanks, Just for the record, this works for me: (defun sal-ada-hide-block () "Hide contents of block whose structure is on current line." (save-excursion (back-to-indentation) (setq selective-display (1+ (current-column))))) (defun sal-ada-toggle-hide-block () (interactive) (if selective-display (setq selective-display nil) (sal-ada-hide-block)) (force-window-update (selected-window))) (define-key ada-mode-map "\C-ch" 'sal-ada-toggle-hide-block) -- -- Stephe