Approximating success one failure at a time

Monday, March 30, 2009

Make hideshow behave more like org-mode

I wanted to have hideshow.el work more like org-mode, so I spent a little time to whip up hideshow-org.el. It doesn't integrate hideshow and org-mode. It simply makes TAB do double duty in code, both performing the regular code indentation as normal, and showing and hiding code blocks. If your code needs to be indented, TAB will indent. If no indentation is needed, then TAB will try to toggle the visibility of the block. I put together a screencast to demonstrate what it does. The screencast quickly goes over org-mode, hideshow, and then demonstrates hideshow-org. If you're already familiar with org-mode or hideshow, I'd recommend skipping to the 2:30 mark which shows exactly what hideshow-org does.

The code is available on github here. Here is the agenda to make the links easier to get at. Feedback is most welcome.

44 comments:

  1. Looks pretty cool. What's your color theme?

    ReplyDelete
  2. After flirting with TextMate, I came back to Emacs but not without taking the color theme "pastels on dark." Here's the code for it. And here is the code in my .emacs:

    (load-file "/path/to/pastels-on-dark-theme.el")
    (color-theme-pastels-on-dark)

    ReplyDelete
  3. Looks great! One potential problem would be with languages like python, where indentation is syntax. With the emacs python mode, hitting TAB cycles through the possible legal indentations of the current line, of which there are often several. So I guess your approach wouldn't work there... You could always use "S-TAB" I suppose.

    ReplyDelete
  4. Awesome, I could never remember the folding key bindings, and now it makes it so easy, since I am also an org-mode user.

    Thank you!

    ReplyDelete
  5. Nice job! (I'm catching up on the org-mode mailing list, and found your post about this.) I'll try it, but I wonder, did you make any progress incorporating this into hideshow itself?

    ReplyDelete
  6. At this FFXI GIL point, a white Knight Online Gold flowing Perfect World gold purple Ling, Yu Mian Lip, handsome extraordinary, a Dragonica Gold
    black silk-fat Metin2 Yang dish Ragnarok Zeny into a Knight Online Gold bun, the hands of a delicate paper fan, 2Moons Dil full scholar dressed, but refined it Cabal Alz without Flyff Penya losing the charming woman, so that Brothel woman to see her every air of obsession, winks thrown straight, she was mistakenly treated as a handsome son of FFXIV GIL extraordinary Columbia.
    "Originally, rumors of Red Allods Gold House Lane, is this look like, and do not have any particular Well!" Purple Spirit freely cast a glance of the much Allods Gold slower to catch, and Jade Dynasty Gold some Jade Dynasty Gold disappointment Road.

    ReplyDelete
  7. I worked to much to do the same thing, but due to my weird method i couldn't, but now after reading this blog no more problem.

    - John Devis
    Magento Themes

    ReplyDelete
  8. Code is little bit difficult for me now, but i hope i will learn it soon.

    - Tanya
    Web Design Firm

    ReplyDelete
  9. How does one enable this extension by default?

    ReplyDelete
  10. Tried your nice color theme, but I get:
    Symbol's function definition is void: color-theme-install
    Any ideas?

    ReplyDelete
  11. Hey a great post for sure, thanks a lot for sharing the information......

    Magento Themes

    ReplyDelete
  12. Thanks a lot for sharing the post, really a splendid piece of information shared.....

    Electric Cigarette

    ReplyDelete
  13. The information posted seems to be great, well done...

    Hair Transplant Pakistan

    ReplyDelete
  14. Awesome, I could never remember the folding key bindings, and now it makes it so easy, since I am also an org-mode user.

    Thank you!

    party poker bonus code

    ReplyDelete
  15. I worked to much to do the same thing, but due to my weird method i couldn't, but now after reading this blog no more problem.
    thank you so much


    Party Casino Bonus

    ReplyDelete
  16. its a good blog for geting the finformation


    rushmore casino review

    ReplyDelete
  17. Hi,


    Fantastic theme, Thanks a lot for sharing it.

    ReplyDelete
  18. Hello Dear,


    Super perfect theme& looking so nice. keep it up. Thanks

    ReplyDelete
  19. Hi am!

    This blog is awesome full useful information that i was in dire need of. I will share your blog with my friends. Keep it up Thanks

    ReplyDelete
  20. Wow, it is really fantastic theme. I have used it.It is looking so cute. Love your blog. Best wishes for you future blogging career. Thanks

    ReplyDelete
  21. I am feeling very fresh and comfortable after reading you article.
    Nice work and keep doing well.

    Awesome pictures.They completely refresh my mind.
    Thanks for sharing such a useful information.
    It seems that you did a lot of hard work for this article.

    ReplyDelete
  22. Great information. Thanks for sharing it.

    ReplyDelete
  23. This is very nice information... i like this very much... guide me some thing that I came back to Emacs but not without taking the color theme "pastels on dark." ?????

    ReplyDelete
  24. Very nice information you have shared..... I'm catching up on the org-mode mailing list, and found your post about this is very nice.....

    ReplyDelete
  25. Very nice article and fantastic information as well... this awesome... keep sharing this information... i will use it....

    ReplyDelete
  26. Very nice post, I like your blogging techniques and have bookmarked this blog as found it very informative. Keep it up.... fabulous....

    ReplyDelete
  27. Wow, it is really fantastic. I have used it. It is looking so cute. Love your blog. very nice post..

    ReplyDelete
  28. Wow, seems to be some thing out standing. This stands as being one of the most clever approach to either hide or show the information to users whom you like.

    Promotional Items

    ReplyDelete
  29. I am feeling very fresh and comfortable after reading you article. Nice work and keep doing well
    Party Poker Review

    ReplyDelete
  30. I agree totally.
    Even though the warnings are there, I can guarantee a lot of people have the code on their live box, or people will use it in the future.

    ReplyDelete
  31. Surely a great post, never knew that all was possible. Is this implemented using HTML tags or Java Script.... ???

    ReplyDelete
  32. Great compilation. Thanks for inspiring. Keep it going .

    ReplyDelete
  33. This is very inserting I like this... i will keep my eye on it....... wonderful.....

    ReplyDelete
  34. Even though the warnings are there, I can guarantee a lot of people have the code on their live box, or people will use it in the future.

    ReplyDelete
  35. You have great perception and I will definitely be reading your other Blogs!

    Kashmir Tour Packages | Software Company India | Budget Hotels in Ranchi

    ReplyDelete