Re: [Zope] Emacs, ange-ftp, zope ftp serv, auto mode loading and font-lock-mode
On Thu, 20 Dec 2001, Azboklin Lirik wrote:
Chances are good that Zope isn't giving Emacs enough of a clue as to what kind of file you are editting. Emacs either needs a '.' extension
Actually, what I do is name my python files myfile_py and html files myfile_html. I tried naming my files with .py, etc but that causes problems when trying to access them in python because of the object dot notation. So in my .emacs file I have the following
;; HTML Mode ;; --------- (setq auto-mode-alist (cons '("\\_html$" . html-mode) auto-mode-alist))
[...] Might be the double backslashes in front of "_html" -- they are necessary if its a ".html" extension because the first element is supposed to be a regular expression -- a dot is special for a regex, but an underscore is not. Ive got auto-mode-alist set up like this: ;; everything which ends in _dtml turns on html-mode (setq auto-mode-alist (cons '("_dtml$" . html-mode) auto-mode-alist)) and it works just fine (ftp or local).
being able to hack the whole thing with >Emacs via FTP is priceless.
Totally!
Yes! I cant stand lisp but emacs rocks my world ;) ru, peter. -- _____________________________________________________________________ peter sabaini, mailto: c c c p@oeh.tu-graz.ac.at "technology: connections that won't, upgrades that can't, hotsyncs that don't, standards that never are, wireless transmittors radiating who knows what..." (wash. post) icq: 122112836
I really liked your solution to this problem, and so I did some more checking and I think that I have found out the cause of the problem, it's not a Zope problem after all, but rather an Emacs regular expression problem. Instead of: (setq auto-mode-alist (cons '("\\_html$" . html-mode) auto-mode-alist)) Try instead: (setq auto-mode-alist (cons '("_html$" . html-mode) auto-mode-alist)) The two '\' characters are just there to escape the next character (which in most of the auto-mode-alist is the special '.' character). With this small modification I was able to get Emacs to do the "right thing" in Zope without having to put comments in each file. I was able to open foo_py, foo_html, and foo_sql in python-mode, html-mode, and sql-mode respectively. This made me very happy. I also learned a bit more about Emacs, and that is always handy. Thanks, Jason
participants (3)
-
Azboklin Lirik -
Jason Earl -
Peter Sabaini