* additional functionality for html-helper-mode @ 2017-05-22 22:34 ken 2017-05-22 22:53 ` Jean-Christophe Helary 2017-05-23 0:29 ` Emanuel Berg 0 siblings, 2 replies; 16+ messages in thread From: ken @ 2017-05-22 22:34 UTC (permalink / raw) To: help-gnu-emacs Another current conversation about emacs & elisp programming got me thinking again.... There is some mode in emacs which can selectively and flexibly "collapse" and "expand" selected blocks of text; that is, make it/them visible to the user or not display them. It was a long time ago, but I believe that was org-mode. Would it be possible to integrate that functionality into html-helper-mode so that chapters could be selectively collapsed or expanded? For example, I might have: <h1>Chapter One</h1> <p>This is a paragraph. There would be many of these. </p> <h1>Chapter Two</h1> <p>Paragraph in Chapter II. blah blah blah </p> <h1>Chapter Three</h1> <p>More paragraphs for this chapter also. </p> Then I'd want to not see the contents of chapter 2 only, like this: <h1>Chapter One</h1> <h1>Chapter Two</h1> <p>Paragraph in Chapter II. blah blah blah </p> <h1>Chapter Three</h1> Of course all the text for all chapters would still be there in the file, just not visible in emacs. I could still pull the file into a browser and see the entire thing. I'm fairly certain this would be possible. The question is, I guess, what would be the easiest way to do it? Much thanks. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-22 22:34 additional functionality for html-helper-mode ken @ 2017-05-22 22:53 ` Jean-Christophe Helary 2017-05-23 17:43 ` ken 2017-05-23 0:29 ` Emanuel Berg 1 sibling, 1 reply; 16+ messages in thread From: Jean-Christophe Helary @ 2017-05-22 22:53 UTC (permalink / raw) To: help-gnu-emacs Kem I think you have a hideshow minor mode that does that: https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html I think it's generally called "code folding". Jean-Christophe > On May 23, 2017, at 7:34, ken <gebser@mousecar.com> wrote: > > Another current conversation about emacs & elisp programming got me thinking again.... > > There is some mode in emacs which can selectively and flexibly "collapse" and "expand" selected blocks of text; that is, make it/them visible to the user or not display them. It was a long time ago, but I believe that was org-mode. > > Would it be possible to integrate that functionality into html-helper-mode so that chapters could be selectively collapsed or expanded? ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-22 22:53 ` Jean-Christophe Helary @ 2017-05-23 17:43 ` ken 2017-05-23 22:13 ` Jean-Christophe Helary 0 siblings, 1 reply; 16+ messages in thread From: ken @ 2017-05-23 17:43 UTC (permalink / raw) To: help-gnu-emacs On 05/22/2017 06:53 PM, Jean-Christophe Helary wrote: > Kem > > I think you have a hideshow minor mode that does that: > https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html > > I think it's generally called "code folding". > > Jean-Christophe > >> On May 23, 2017, at 7:34, ken <gebser@mousecar.com> wrote: >> >> Another current conversation about emacs & elisp programming got me thinking again.... >> >> There is some mode in emacs which can selectively and flexibly "collapse" and "expand" selected blocks of text; that is, make it/them visible to the user or not display them. It was a long time ago, but I believe that was org-mode. >> >> Would it be possible to integrate that functionality into html-helper-mode so that chapters could be selectively collapsed or expanded? Thanks for the suggestion. However, it doesn't seem to understand html, i.e., only affects CSS definitions enclosed within curly braces, { and }. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-23 17:43 ` ken @ 2017-05-23 22:13 ` Jean-Christophe Helary 2017-05-24 4:46 ` Yuri Khan 2017-05-24 18:25 ` ken 0 siblings, 2 replies; 16+ messages in thread From: Jean-Christophe Helary @ 2017-05-23 22:13 UTC (permalink / raw) To: help-gnu-emacs > On May 24, 2017, at 2:43, ken <gebser@mousecar.com> wrote: > > On 05/22/2017 06:53 PM, Jean-Christophe Helary wrote: >> Kem >> >> I think you have a hideshow minor mode that does that: >> https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html >> >> I think it's generally called "code folding". > > > Thanks for the suggestion. > > However, it doesn't seem to understand html, i.e., only affects CSS definitions enclosed within curly braces, { and }. Ok, a quick search with "html, folding, emacs) brought these: https://github.com/ataka/html-fold https://www.emacswiki.org/emacs/FoldingMode https://stackoverflow.com/questions/29463639/how-to-fold-html-tag-in-emacs Jean-Christophe ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-23 22:13 ` Jean-Christophe Helary @ 2017-05-24 4:46 ` Yuri Khan 2017-05-24 18:27 ` ken 2017-05-25 22:47 ` John Ankarström 2017-05-24 18:25 ` ken 1 sibling, 2 replies; 16+ messages in thread From: Yuri Khan @ 2017-05-24 4:46 UTC (permalink / raw) To: Jean-Christophe Helary; +Cc: help-gnu-emacs@gnu.org On Wed, May 24, 2017 at 5:13 AM, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote: >> However, it doesn't seem to understand html, i.e., only affects CSS definitions enclosed within curly braces, { and }. > > Ok, a quick search with "html, folding, emacs) brought these: Keep in mind that with regard to HTML there are two possible interpretations of folding. * One is folding the contents between two paired tags: <p>{{…}}</p>. * Another is folding the contents after a heading up to (but not including) the next heading of that or higher level on the same level of element nesting: <h2>Foo</h2>{{…}}<h1>Bar</h1>. The first is what a typical general-purpose folding library is going to implement. The second can arguably be called “understanding HTML”, and is what Ken is asking for. (And no, I don’t have any experience with HTML folding in Emacs.) ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-24 4:46 ` Yuri Khan @ 2017-05-24 18:27 ` ken 2017-05-25 22:47 ` John Ankarström 1 sibling, 0 replies; 16+ messages in thread From: ken @ 2017-05-24 18:27 UTC (permalink / raw) Cc: help-gnu-emacs@gnu.org On 05/24/2017 12:46 AM, Yuri Khan wrote: > On Wed, May 24, 2017 at 5:13 AM, Jean-Christophe Helary > <jean.christophe.helary@gmail.com> wrote: > >>> However, it doesn't seem to understand html, i.e., only affects CSS definitions enclosed within curly braces, { and }. >> Ok, a quick search with "html, folding, emacs) brought these: > Keep in mind that with regard to HTML there are two possible > interpretations of folding. > > * One is folding the contents between two paired tags: <p>{{…}}</p>. > * Another is folding the contents after a heading up to (but not > including) the next heading of that or higher level on the same level > of element nesting: <h2>Foo</h2>{{…}}<h1>Bar</h1>. > > The first is what a typical general-purpose folding library is going > to implement. The second can arguably be called “understanding HTML”, > and is what Ken is asking for. > > (And no, I don’t have any experience with HTML folding in Emacs.) > Good distinction. Completely correct. And hideshow couldn't do either. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-24 4:46 ` Yuri Khan 2017-05-24 18:27 ` ken @ 2017-05-25 22:47 ` John Ankarström 1 sibling, 0 replies; 16+ messages in thread From: John Ankarström @ 2017-05-25 22:47 UTC (permalink / raw) To: Yuri Khan, Jean-Christophe Helary; +Cc: help-gnu-emacs@gnu.org Yuri Khan <yuri.v.khan@gmail.com> writes: > Keep in mind that with regard to HTML there are two possible > interpretations of folding. > [...] > * Another is folding the contents after a heading up to (but not > including) the next heading of that or higher level on the same level > of element nesting: <h2>Foo</h2>{{…}}<h1>Bar</h1>. I'm not sure that's an optimal way to interpret or write HTML. Modern tags like <section> make it easier and more reliable to divide documents into sections, for both humans and programs. The second approach you describe seems a little prone to breaking, as it's hard to know the writer's original intent without explicit <section>'s. Though, there is a case where a similar approach is necessary: for example, to fold paragraphs without a closing </p> tag (which is valid HTML), or list items without </li>, etc. Though it would surprise me if any HTML folding packages for Emacs supported it ... :-) ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-23 22:13 ` Jean-Christophe Helary 2017-05-24 4:46 ` Yuri Khan @ 2017-05-24 18:25 ` ken 1 sibling, 0 replies; 16+ messages in thread From: ken @ 2017-05-24 18:25 UTC (permalink / raw) To: help-gnu-emacs On 05/23/2017 06:13 PM, Jean-Christophe Helary wrote: >> On May 24, 2017, at 2:43, ken <gebser@mousecar.com> wrote: >> >> On 05/22/2017 06:53 PM, Jean-Christophe Helary wrote: >>> Kem >>> >>> I think you have a hideshow minor mode that does that: >>> https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html >>> >>> I think it's generally called "code folding". >> >> Thanks for the suggestion. >> >> However, it doesn't seem to understand html, i.e., only affects CSS definitions enclosed within curly braces, { and }. > Ok, a quick search with "html, folding, emacs) brought these: > > https://github.com/ataka/html-fold > https://www.emacswiki.org/emacs/FoldingMode > https://stackoverflow.com/questions/29463639/how-to-fold-html-tag-in-emacs > > Jean-Christophe > > Thanks, Jean-Christophe. I was digging into the code for hideshow, to see if it were doctorable to handle html and didn't think to search out a better solution. The first, html-fold, might be a better option. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-22 22:34 additional functionality for html-helper-mode ken 2017-05-22 22:53 ` Jean-Christophe Helary @ 2017-05-23 0:29 ` Emanuel Berg 2017-05-23 18:49 ` ken 1 sibling, 1 reply; 16+ messages in thread From: Emanuel Berg @ 2017-05-23 0:29 UTC (permalink / raw) To: help-gnu-emacs ken wrote: > There is some mode in emacs which can > selectively and flexibly "collapse" and > "expand" selected blocks of text; that is, > make it/them visible to the user or not > display them. It was a long time ago, but > I believe that was org-mode. > > Would it be possible to integrate that > functionality into html-helper-mode so that > chapters could be selectively collapsed or > expanded? For example, I might have: I use the built-in `html-mode' for my primitive or 90s-looking pages and as for editing I never had any problems or felt the need to do code fold, but some people who do HTML insist web-mode.el is much better and there code folding is available probably exactly as you describe it: http://web-mode.org -- underground experts united http://user.it.uu.se/~embe8573 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-23 0:29 ` Emanuel Berg @ 2017-05-23 18:49 ` ken 2017-05-24 19:27 ` Emanuel Berg 0 siblings, 1 reply; 16+ messages in thread From: ken @ 2017-05-23 18:49 UTC (permalink / raw) To: help-gnu-emacs On 05/22/2017 08:29 PM, Emanuel Berg wrote: > ken wrote: > >> There is some mode in emacs which can >> selectively and flexibly "collapse" and >> "expand" selected blocks of text; that is, >> make it/them visible to the user or not >> display them. It was a long time ago, but >> I believe that was org-mode. >> >> Would it be possible to integrate that >> functionality into html-helper-mode so that >> chapters could be selectively collapsed or >> expanded? For example, I might have: > I use the built-in `html-mode' for my primitive > or 90s-looking pages and as for editing I never > had any problems or felt the need to do code > fold, but some people who do HTML insist > web-mode.el is much better and there code > folding is available probably exactly as you > describe it: > > http://web-mode.org > Thanks for the suggestion, but I didn't want to have to learn a new editor. I tried html-mode years ago and didn't care for it. Moreover,, I've been using html-helper-mode for decades and am not only quite comfortable with it and don't want to become a newbie again, but I've also made a lot of very helpful customizations and have written some bits of fresh code which is dependent upon html-helper-mode. So maybe you understand that I'm just interested in additional functionality for html-helper-mode. Though it's off-topic, I would add that I use html-helper-mode to edit quite sophisticated web pages which aren't '90s-looking at all, but which incorporate web 2.0 features and CSS and columns, graphics, and much more. Of course I wouldn't write an entire CMS with html-helper-mode, but then I wouldn't attempt it in any emacs mode; it would be much more sensible to use Joomla, Wordpress or Drupal... and probably, if at all feasible, one of the emacs modes designed specifically to interface with those. But this is all a separate conversation. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-23 18:49 ` ken @ 2017-05-24 19:27 ` Emanuel Berg 2017-05-25 21:58 ` ken 0 siblings, 1 reply; 16+ messages in thread From: Emanuel Berg @ 2017-05-24 19:27 UTC (permalink / raw) To: help-gnu-emacs ken <gebser@mousecar.com> writes: >>> Would it be possible to integrate that >>> functionality into html-helper-mode so that >>> chapters could be selectively collapsed or >>> expanded? For example, I might have: I use the >>> built-in `html-mode' for my primitive or >>> 90s-looking pages and as for editing I never had >>> any problems or felt the need to do code fold, but >>> some people who do HTML insist web-mode.el is much >>> better and there code folding is available >>> probably exactly as you describe it: >>> http://web-mode.org >> > Thanks for the suggestion, but I didn't want to have to > learn a new editor. A new editor? Sweet heaven, no! Here is what it says on the web site: web-mode.el is an autonomous emacs major-mode for editing web templates. HTML documents can embed parts (CSS/JavaScript) and blocks (client/server side). Does "autonomous" mean it is implemented as a standalone editor? What kind of "Emacs mode" is that?! > Though it's off-topic, I would add that I use > html-helper-mode to edit quite sophisticated web > pages which aren't '90s-looking at all, but which > incorporate web 2.0 features and CSS Well, you are allowed to use CSS... > and columns, graphics, and much more. Of course > I wouldn't write an entire CMS with > html-helper-mode, but then I wouldn't attempt it in > any emacs mode; it would be much more sensible to > use Joomla, Wordpress or Drupal... ...but not that :) -- underground experts united http://user.it.uu.se/~embe8573 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-24 19:27 ` Emanuel Berg @ 2017-05-25 21:58 ` ken 2017-05-26 6:26 ` Yuri Khan 0 siblings, 1 reply; 16+ messages in thread From: ken @ 2017-05-25 21:58 UTC (permalink / raw) To: help-gnu-emacs On 05/24/2017 03:27 PM, Emanuel Berg wrote: > ken <gebser@mousecar.com> writes: > >>>> Would it be possible to integrate that >>>> functionality into html-helper-mode so that >>>> chapters could be selectively collapsed or >>>> expanded? For example, I might have: I use the >>>> built-in `html-mode' for my primitive or >>>> 90s-looking pages and as for editing I never had >>>> any problems or felt the need to do code fold, but >>>> some people who do HTML insist web-mode.el is much >>>> better and there code folding is available >>>> probably exactly as you describe it: >>>> http://web-mode.org >> Thanks for the suggestion, but I didn't want to have to >> learn a new editor. > A new editor? Sweet heaven, no! Here is what it says > on the web site: > > web-mode.el is an autonomous emacs major-mode for > editing web templates. HTML documents can embed > parts (CSS/JavaScript) and blocks (client/server > side). > > Does "autonomous" mean it is implemented as > a standalone editor? What kind of "Emacs mode" is > that?! In a technical world disregarding the humans using software, I think you would be correct. When I say it would be like a new editor, I mean that the keybindings for doing all the html coding in web-mode would likely be completely different from those in html-helper-mode... they definitely were in html-mode. Imagine how many different html markups there are... idk, perhaps hundreds... I don't want to have to learn all new keybindings for another, different mode. I've been using html-helper-mode for a long time, probably decades. I'm fluent with its keybindings. And I've created new functions within html-helper-mode and modified others which have yet other related keybindings. Those have become fluent also. That kind of fluency is part and parcel of the human factor, a view and an experience which purely technical considerations seem to be oblivious to. To me, confronting hundreds of new keybindings (for things I already know how to do with my current setup) is tantamount to learning a new editor. From your technical vantage point, however, I will readily admit you are correct. > >> Though it's off-topic, I would add that I use >> html-helper-mode to edit quite sophisticated web >> pages which aren't '90s-looking at all, but which >> incorporate web 2.0 features and CSS > Well, you are allowed to use CSS... > >> and columns, graphics, and much more. Of course >> I wouldn't write an entire CMS with >> html-helper-mode, but then I wouldn't attempt it in >> any emacs mode; it would be much more sensible to >> use Joomla, Wordpress or Drupal... > ...but not that :) > Not long ago I applied for a passport and it specifically allows me to use Wordpress and Drupal. :) ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-25 21:58 ` ken @ 2017-05-26 6:26 ` Yuri Khan 2017-05-26 12:39 ` Emanuel Berg 0 siblings, 1 reply; 16+ messages in thread From: Yuri Khan @ 2017-05-26 6:26 UTC (permalink / raw) To: gebser; +Cc: help-gnu-emacs@gnu.org On Fri, May 26, 2017 at 4:58 AM, ken <gebser@mousecar.com> wrote: > When I say it would be like a new editor, I mean that the > keybindings for doing all the html coding in web-mode would likely be > completely different from those in html-helper-mode... they definitely were > in html-mode. Imagine how many different html markups there are... idk, > perhaps hundreds... I don't want to have to learn all new keybindings for > another, different mode. You don’t need to relearn keybindings. You can instead port your keybindings to a new underlying mode. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-26 6:26 ` Yuri Khan @ 2017-05-26 12:39 ` Emanuel Berg 2017-05-26 13:34 ` Yuri Khan 0 siblings, 1 reply; 16+ messages in thread From: Emanuel Berg @ 2017-05-26 12:39 UTC (permalink / raw) To: help-gnu-emacs Yuri Khan wrote: >> When I say it would be like a new editor, >> I mean that the keybindings for doing all >> the html coding in web-mode would likely be >> completely different from those in >> html-helper-mode... they definitely were in >> html-mode. Imagine how many different html >> markups there are... idk, perhaps >> hundreds... I don't want to have to learn >> all new keybindings for another, >> different mode. > > You don’t need to relearn keybindings. > You can instead port your keybindings to > a new underlying mode. From Ken's posts it seems he doesn't write HTML as much as use shortcuts to insert all the tags. Then I suppose it would require some work to export all of that to another mode where likely the insert functions also have different names and so on. It would also be a constant discussion - when to re-learn, when to tweak the new stuff to your old ways. The "insert way" of producing code never appealed to me, as I love typing (the physical aspect of it), but reading Ken's post I suspect he is the opposite as otherwise I don't understand where all hundreds of HTML-specific shortcuts would come from. (?) From an efficiency standpoint, typing is good as it is more versatile and is readily transferable between modes. It is more flexible. Relying heavily on mode-specific things is the opposite, but when taken to a certain degree of perfection, for that particular mode and task I suppose it could be insanely fast and efficient. -- underground experts united http://user.it.uu.se/~embe8573 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-26 12:39 ` Emanuel Berg @ 2017-05-26 13:34 ` Yuri Khan 2017-05-26 21:05 ` Emanuel Berg 0 siblings, 1 reply; 16+ messages in thread From: Yuri Khan @ 2017-05-26 13:34 UTC (permalink / raw) To: help-gnu-emacs@gnu.org On Fri, May 26, 2017 at 7:39 PM, Emanuel Berg <moasen@zoho.com> wrote: > It would also be a constant discussion - when > to re-learn, when to tweak the new stuff to > your old ways. When your old ways are so hard ingrained in your brain and fingers, you port. That’s what happened for me with F2 to save and Ctrl+Y to delete a line; I have carried them from wordstar-like editors on DOS through Visual Studio on Windows to Emacs on GNU/Linux. > From an efficiency standpoint, typing is good > as it is more versatile and is readily > transferable between modes. It is more > flexible. Relying heavily on mode-specific > things is the opposite, but when taken to > a certain degree of perfection, for that > particular mode and task I suppose it could be > insanely fast and efficient. In the previous life, in a different editor, I had a very efficient setup based halfway on keys, halfway on typing. I would hold down Alt and type a unique prefix of an HTML tag, and it would wrap the selection in a matched pair. Never got to port it to Emacs though; these days I prefer generating HTML from Markdown. Or, when I need the full power of HTML, I use Yasnippet (which also has a way to wrap around the selection). ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: additional functionality for html-helper-mode 2017-05-26 13:34 ` Yuri Khan @ 2017-05-26 21:05 ` Emanuel Berg 0 siblings, 0 replies; 16+ messages in thread From: Emanuel Berg @ 2017-05-26 21:05 UTC (permalink / raw) To: help-gnu-emacs Yuri Khan wrote: > In the previous life, in a different editor, > I had a very efficient setup based halfway on > keys, halfway on typing. I would hold down > Alt and type a unique prefix of an HTML tag, > and it would wrap the selection in a matched > pair. Never got to port it to Emacs though; > these days I prefer generating HTML from > Markdown. Or, when I need the full power of > HTML, I use Yasnippet (which also has a way > to wrap around the selection). I used to think Emacs and Unix is the superior way do things with a computer. I even felt sorry for the poor bastards doing eclipsed Java on Windows. But because I never thought me to be a superior programmer to them, just a person with much better taste in technology, I actually thought it was a mystery why they never realized what awesome stuff there is and moved on! Now I don't think in terms of what is superior but rather in terms of computer personalities. Styles make fights! And I have to admit that I don't know any other personalities than the Emacs/Unix one. So I can't say which is better than the other. What I've seen, for my style, I've not seen anything remotely as good tho. For other people's style, I now know that what I see, some moron clicking on icons, scrolling tons of tiny letters and skimming thru menus and autocompletion lists, and this looks completely bizarre, but is it actually a computer personality behind all this jungle that makes sense, possibly as much as mine? I guess I'll never know for sure :) -- underground experts united http://user.it.uu.se/~embe8573 ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2017-05-26 21:05 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-05-22 22:34 additional functionality for html-helper-mode ken 2017-05-22 22:53 ` Jean-Christophe Helary 2017-05-23 17:43 ` ken 2017-05-23 22:13 ` Jean-Christophe Helary 2017-05-24 4:46 ` Yuri Khan 2017-05-24 18:27 ` ken 2017-05-25 22:47 ` John Ankarström 2017-05-24 18:25 ` ken 2017-05-23 0:29 ` Emanuel Berg 2017-05-23 18:49 ` ken 2017-05-24 19:27 ` Emanuel Berg 2017-05-25 21:58 ` ken 2017-05-26 6:26 ` Yuri Khan 2017-05-26 12:39 ` Emanuel Berg 2017-05-26 13:34 ` Yuri Khan 2017-05-26 21:05 ` Emanuel Berg
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).