Emacs & Zope -- M-x html-mode ... but doesn't color the document for html ???
Howdy, Switching over from Window Dev. Env EditPlus ==> Ftp-enabled browsing & editing, color/syntax-editing -- menu to choose file-type --> so easy Almost there with Emacs/XEmacs: (Emacs 101: Ctrl-x == C-x, Alt-x == M-x) C-x C-f ==> /jason@server 8830:/ ==> prompts for password, ftp-enabled browse & edit ... perfect! But, no file extensions, so we have to tell Emacs that a file w/ no extension is html M-x html-mode ... so I'm in html mode (right?) open main_template.html (copy on local) ... perfect coloring open main_template via ftp, M-x html-mode ... and just what's in """" is green??? Obviously this is just an Emacs question ... but I found all help out there useless beyond changing to html-mode. (I'm hoping emacs will prove its worth in minimal time ...) thanks so much!! Failed to get these to work for an ftp-enabled, colored syntax flexible dev. environment: K-Develop/Kate/Konqueror -- too much overhead GVIM --> easy to switch code/file-type from menu for color-editing ... but no ftp-enabled browse/edit Zope-External Editor: was able to view file in my browser of choice after install, and browser setup, and chmod +x zope_edit.py ... but couldn't get save to work.
Jason LeMonier wrote:
But, no file extensions, so we have to tell Emacs that a file w/ no extension is html M-x html-mode ... so I'm in html mode (right?) open main_template.html (copy on local) ... perfect coloring open main_template via ftp, M-x html-mode ... and just what's in """" is green???
I'm *not* an emacs expert. Here's what often works for me: The mode for emacs to do syntax coloring is called "global-font-lock-mode". I have *no* idea why. I find that sometimes, in certain situations, it won't be on. So try to enable it with M-x global-font-lock-mode. I'm sure that there's some way to get this to be always on for your particular problem documents, but I don't know the configuration. But at least now you have a start. Robb
Jason LeMonier wrote:
But, no file extensions, so we have to tell Emacs that a file w/ no extension is html M-x html-mode
If you will always want files with no extension to invoke html mode, try putting the following in your .emacs file: (setq initial-major-mode 'html-mode default-major-mode 'html-mode) Untested but, if you want a slightly less blunt instrument, you might be able to get html-mode for anything ending in "_html" ; make emacs give me html mode for _html files (add-to-list 'auto-mode-alist '("\\_html\\'" . html-mode)) And as Robb pointed out, toggling global-font-lock-mode should give you syntax coloring. I have mine turned off by default but I think the following should do the opposite and turn it on by derault: (setq font-lock-auto-fontify t) -- And while we are sharing emacs tips, does anyone have a magic incantation that will make python mode treat the underscore as a word boundry for killing words? Using the following comment in the python-mode.el that came with xemacs 21.4.9, I hooked up the "move" commands but I am far more concerned with having this work with deletes. Underscore is a word boundery in text mode, but not in python mode. ;; For historical reasons, underscore is word class instead of ;; symbol class. GNU conventions say it should be symbol class, but ;; there's a natural conflict between what major mode authors want ;; and what users expect from `forward-word' and `backward-word'. ;; Guido and I have hashed this out and have decided to keep ;; underscore in word class. If you're tempted to change it, try ;; binding M-f and M-b to py-forward-into-nomenclature and ;; py-backward-into-nomenclature instead. This doesn't help in all ;; situations where you'd want the different behavior ;; (e.g. backward-kill-word). -- Cynthia Kiser cnk@caltech.edu
I use .emacs entries like: (add-to-list 'auto-mode-alist '("/ftp:.*zopeserver.com" . nxml-mode)) (add-to-list 'auto-mode-alist '(".zcml$" . nxml-mode)) nxml-mode is a superior html mode - well worth installing.
participants (4)
-
Cynthia Kiser -
Jason LeMonier -
Robb Shecter -
Simon Michael