emacs-devel
[Top][All Lists]
Advanced

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

customize hideshow.el?


From: Stephen Leake
Subject: customize hideshow.el?
Date: Sun, 13 Aug 2017 11:46:55 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (windows-nt)

I'd like to customize hideshow.el to display the first and last line in
each hidden block.

This makes sense (at least to me) for languages like Ada. For example,
suppose I have an "if then else" statement nested in a block:

   declare
   begin
      if  then
      elsif  then
      else
      end if;
   exception
   end;

But I realize the declare block is only needed in the first branch of
the if, so I'd like to change this to:

   if  then
      declare
      begin
      exception
      end;
   elsif  then
   else
   end if;

If all the code fits in one window, this is not hard. But if the "if
then else" is long, I'd like to hide it, so I can easily delete the
"declare begin" and "exception end". But I'd like to be sure where the
beginning and end of the "if then else" is, so I don't accidently delete
part of it:

   declare
   begin
      if  then
      ...
      end if;
   exception
   end;

However, hideshow.el, without any customizations, does this:

   declare
   begin...exception
   end;

I've looked into the hooks in hide-show; I can set
hs-adjust-block-beginning to get this:

   declare
   begin
      if  then...exception
   end;

but there is no corresponding hs-adjust-block-end hook.

Before I start trying to add hs-adjust-block-end, I'm looking for
advice.

Is there any way to use the existing hooks to get what I want?

Are there other modes like hideshow.el that are closer to what I want?

Anyone else want what I want?

-- 
-- Stephe



reply via email to

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