unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: customize hideshow.el?
Date: Sun, 27 Aug 2017 07:07:24 -0500	[thread overview]
Message-ID: <86shgdmcxv.fsf@stephe-leake.org> (raw)
In-Reply-To: <86wp67xntx.fsf@stephe-leake.org> (Stephen Leake's message of "Sun, 13 Aug 2017 14:35:54 -0500")

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Stephen Leake <stephen_leake@stephe-leake.org>
>>> 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



      reply	other threads:[~2017-08-27 12:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-13 16:46 customize hideshow.el? Stephen Leake
2017-08-13 16:58 ` Yuri Khan
2017-08-14  4:44   ` Clément Pit-Claudel
2017-08-13 17:15 ` Eli Zaretskii
2017-08-13 19:35   ` Stephen Leake
2017-08-27 12:07     ` Stephen Leake [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86shgdmcxv.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).