Few questions

Asked by magical_widget

Just few questions:
1) How do I change the hotkey used for autocompletion?
2) What's the hotkey for folding sections?
3) Why when trying to use closing bracket (i.e. function blah () ) in php it jumps to the beginning of the line?

Question information

Language:
English Edit question
Status:
Solved
For:
nXhtml Edit question
Assignee:
No assignee Edit question
Solved by:
lborgman
Solved:
Last query:
Last reply:
Revision history for this message
Best lborgman (lennart-borgman) said :
#1

Hi magical_widget

1) In Emacs there are a lot of completion functions. So it might depend on which one you mean.

However with nXhtml comes tabkey2-mode which lets you use TAB for completion for many of the completion functions. That binding, TAB, can be replaced by customizing tabkey2-first-key.

2) Look in the menu at the Outline and Hide/Show entries. There you can see which bindings that are used.

3) This is a bug. I have optimistically not turned on c-electric-flag. However I think you just found a case where it is needed. Can you try

    M-: (setq c-electric-flag nil)

and see how that works for you?

Revision history for this message
magical_widget (sandshrew) said :
#2

1) I mean the one specifix to nXhtml "complete tag, attribute, etc" (Default key M-tab). Could you write exact line, which could be placed in emacs config or command which I should use in emacs?
2) Thanks;
3) I see. I have replaced now php-mode.el in related with the original file from Aaron S. Hawley (2007-01-02 version 1.4.0), which seems to work ok.

Revision history for this message
lborgman (lennart-borgman) said :
#3

1) The function you bind is nxml-complete:

   (eval-after-load 'nxml-mode
     '(define-key nxml-mode-map YOUR-KEY 'nxml-complete))

But in my opinion it is far easier to use tabkey2-mode that comes with nXhtml. Just turn on that minor mode and then the first TAB does indent as usual and the second one will do completion.

3) I would be surprised if it worked. Aaron did not correct this error as far as I know. But I might have forgotten something. Can you please check again. Restart Emacs and make sure c-electric-flag is non-nil (because that is what it was before.

Revision history for this message
magical_widget (sandshrew) said :
#4

1) Ok, I am emacs newbie. What do you mean by second TAB? I only see one tab on my keyboard. [Thanks for the f-ion]
3) Yup, I can confirm that. electric-flag is definitely non-nil - I use auto-newline which doesn't work with electric disabled.

Revision history for this message
magical_widget (sandshrew) said :
#5

I can send you the file if you want.

Revision history for this message
lborgman (lennart-borgman) said :
#6

1) Second TAB? My bad. It is very basic: The second time you press the TAB key ;-)

3) Yes, you are right. It works with 1.4.0 from Aaron. After some of my changes was merged into that 1.4.0 I added some more changes that are not in Aaron's version yet.

And that change did correct another error so now I am a bit lost. I will think about it.

Revision history for this message
lborgman (lennart-borgman) said :
#7

3) I think I found the error that caused this problem. Can you please test with nXhtml v 1.58 (and the php-mode.el included there, not Aaron's version)?

Revision history for this message
magical_widget (sandshrew) said :
#8

Yeah, I think php-mode works as it should now.
Anyway, I am wondering how nxhtml folding (block hiding) works, it seems to fail sometimes... Take a look at this example (and I do know that it's an ugly piece of code) -> http://pastebin.com/m3664dd09 and try to hide table block.

And one more question: how to turn off the background color for subregions?

...and is there somewhere FULL guide for nxhtml?

Revision history for this message
lborgman (lennart-borgman) said :
#9

Thanks. Just a note: normally you probably do not want to use php-mode by itself but for example nxhtml-mumamo or html-mumamo where you can have chunks of php code in (x)html documents. You can have that in php-mode by itself too, but then you do not have any special support for editing the (x)html part.
----
Hiding blocks? Hide/show, outline etc. Yes, that is a problem for when editing php code and other template languages. The code for hide/show and outline works ok, but only for wellformed (x)html documents.

If someone want to contribute better code for that it would be very nice, but it is not a simple problem. I have been a bit hesitating for how to handle this. I have thought about removing the menu entries. However sometimes they can be really useful so I have left them there.

I could perhaps be more useful to have something like "hide region". There is some code for that on Emacs wiki, but I have not tested it.
----
You can customize the background colors. Try

  M-x customize-group RET mumamo RET
----
The Complete Guide to nXhtml? No, unfortunately. I have tried to make useful documentation, but nXhtml has grown in a way I did not expect from the beginning. But maybe it can help if you tell me what documentation you did notice and what you are missing. Can you perhaps do that?

Revision history for this message
magical_widget (sandshrew) said :
#10

What do you mean by "wellformed"? Does nxhtml block hiding depend on indentation? Why php code causing it to fail? Wouldn't it be easier if it would just search for end tags & closing brackets in the whole code (even in the php part)? :|
I am not sure if it can help in any way but Geany's (IDE for many languages including c, c++, java, pascal, (x)html, css, php, javascript) folding seems to work perfectly well for me.
---
By saying complete documentation I mean full descriptions of all nxhtml specific commands (i.e. you have so many folding options it becomes "a bit" confusing & "try and see what happens" at least for me doesn't seem right). Also I think some FAQ, full nxhtlm customization guide (like for changing colours, key bindings, etc) and links to documentations of the other modules used in nxhtml would be nice too.
---
PS: thanks for help :)

Revision history for this message
magical_widget (sandshrew) said :
#11

Just remembered: you could also do some video tutorials showing what keys you use and what happens.

Revision history for this message
lborgman (lennart-borgman) said :
#12

Wellformed? The folding code searches for tags and end tags according to XHTML standard.

But your idea of using something much simpler in php code is probably good. I guess that is what Geany is doing. I will think of the idea and tell you more later.
----
Thanks for the feedback on the documentation.

There are full description on the commands, but it is not very easy to find in the beginning. And because of the many possibilities it may be hard to grasp too. It simply takes some time to get used to it. (I myself think one of the biggest trouble there is the hiding/folding part.)

I guess one of the main problem is finding the documentation at all. So that is why I asked you where you have looked so far. I am trying to find out how to make it easier to find it. Where have you looked so far? Where did you start?

Revision history for this message
lborgman (lennart-borgman) said :
#13

A video tutorial is a good idea. I would be glad to give advice if someone wants to do that. (Not on the "videoing" part, I do not know much about that.)

Revision history for this message
magical_widget (sandshrew) said :
#14

Here is how I found out about nxhtml: google -> emacs wiki ( http://www.emacswiki.org/cgi-bin/wiki/NxhtmlMode ) -> nxhtml homepage ( http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html ).

There is some app (works in linux too ) which can capture video, display keys used and generate flash video file. Don't remember its name now, but I'll try to find it. That way it shouldn't be too hard to make the tutorials.

Revision history for this message
lborgman (lennart-borgman) said :
#15

Ok, thanks, I see. But most of the documentation is inside Emacs. Have you noticed that?

Revision history for this message
magical_widget (sandshrew) said :
#16

To be honest, no.
I usually search for docs only on websites, man pages and in the text files provided in the package containing the app...

Revision history for this message
magical_widget (sandshrew) said :
#17

When writing about video tutorials I was actually thinking about wink ( http://www.debugmode.com/wink/ ), but it doesn't seem to show what key was pressed (or requires to put that info yourself). Here are few examples to see what can it do: http://rhinoweb.us/ .
Anyway, I found software which can do just that - http://www.virtualmimic.com/ (virtual mimic), but it's only for windows xp.

Also, you might want to try CamStudio ( http://camstudio.org/ ) for windows or xvidcap / gvidcap ( http://xvidcap.sourceforge.net/ ) and recordmydesktop ( http://recordmydesktop.sourceforge.net/about.php ) for linix.

"How to" on recordmydesktop -> http://ubuntuforums.org/showthread.php?t=617006

Revision history for this message
lborgman (lennart-borgman) said :
#18

Thanks for all the good tips, magical_widget. I have taken a look at all the web sites you have mentioned.

It might surprise you that I am actually still use windows xp and not gnu/linux. But that how it is at the moment.

So I have been looking mostly at Wink and CamStudio. Wink looks very good, but I am always a bit hesitating to install something that is not open source. Though I have found nothing that points to that there should be spyware in Wink.

CamStudio is open source, but I can't compile it. Unfortunately it will not compile with any freely available tool.

Revision history for this message
magical_widget (sandshrew) said :
#19

If you are afraid that camstudio or wink might have spyware/adware, download them from download.com - cnet guarantees that software is spyware and adware free.

I couldn't find virtual mimic at download.com , but judging by the reviews I read, I really doubt it will have any spyware / adware too. Their site looks ok to me too.

If you still don't believe them to be clean you could use "Ad-Aware SE" ( http://en.wikipedia.org/wiki/Ad-Aware_SE ) or "Spybot Search & Destroy" ( http://en.wikipedia.org/wiki/Spybot_-_Search_%26_Destroy )to check. From the time I was still using win xp both seemed pretty good.

Revision history for this message
lborgman (lennart-borgman) said :
#20

The problem with cam studio is that the latest version is not available as a binary download and I can't compile it since the sources does not support gcc (or maybe I can bit it looks like a lot of work for someone who do not know c++ very well).

Revision history for this message
magical_widget (sandshrew) said :
#21

Why are you even using gcc to compile c++ source? Shouldn't g++ be the way to go? BTW, app was created with visual c++, so I think you should try it if nothing else works.
Anyway, why do you need the LATEST (from svn repo, right?) version?

Revision history for this message
lborgman (lennart-borgman) said :
#22

Sorry, I did not mean gcc, just the GNU c++ compiler.

I tried CamStudio and my impression is that this is still more a development project than an application. The GUI is just to clumsy to use in my opinion. Several things are non-standard and the behavior is not what I expect.

So after your advice about downloading from CNET I tested Wink and found it much better. I played a bit with it and set up a page:

  http://ourcomments.org/Emacs/nXhtml/tut/tutorials.html

It looks useful, but it takes some time making tutorials.

Revision history for this message
magical_widget (sandshrew) said :
#23

Thanks for the tutorial. It looks pretty good :)