Re: Moving to XEmacs
[email protected] Mon, 19 Apr 2004 10:30:13 -0400
| Newsgroups | gmane.emacs.xemacs.general |
|---|---|
| Message-ID | <OFF84DF63C.6F049DFA-ON85256E7B.004D0BEF-85256E7B.004FD1E3@iqfinancial.com> |
>>> 1. Customized Syntax Highlighting:
Don't know if it's useful, I use Gnu emacs with
the following to syntax highlight *.ini files on
Windows. In GNU emacs, the feature you are looking
for is called "font-lock". Same in Xemacs?
Basically, you define a series of regex'es that
meet your needs and assign appropriate font-lock
settings to them.
I wouldn't consider it a "good" example, it was one
of my first and simplest attempts, and I still have
more to learn, but, if it gets you started... (Folks
who know better: feedback would be most appreciated!)
=================================================================
(defvar ini-keywords
"^\\[[a-zA-Z_-0-9 ]+\\]" ; Matches group header, e.g.: [group]
"*Keywords used in ini files and the djgpp.env file, basically, the
section header.")
(defvar ini-font-lock-keywords
(list (cons ini-keywords 'font-lock-keyword-face)
'("^[#;*].*" . font-lock-comment-face) )
"Additional expressions to highlight in ini mode.")
(defvar ini-mode-map nil
"Keymap for ini-file mode.")
(defun ini-mode ()
"Major mode for editing ini (.ini) files.
Major differences are in the way comments and group headers are
handled, tabs, and indentation.
Turning on Ini-File mode calls the value of the variable `ini-mode-hook',
if that value is non-nil."
(interactive)
(kill-all-local-variables)
(use-local-map ini-mode-map)
(setq mode-name "Ini-File")
(setq major-mode 'ini-mode)
(set-variable 'tab-width 3)
(set-variable 'indent-tabs-mode nil)
(set-variable 'truncate-partial-width-windows nil) ;line wrap on.
(set-variable 'comment-column 42)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(ini-font-lock-keywords t))
(run-hooks 'ini-mode-hook) )
=================================================================
>>> 3. Autocompletion like Visual C++
You want to type, in C++, e.g., with STL:
...
list<string> var;
...
var.f_ (_ = current cursor pos'n).
And Xemacs will recognize that "f" is the start of "front"
and automagically suggest it in for you? Or will provide a
list of all the methods or variables starting with "f"
in this class or template? I haven't found
that feature, don't think it's there yet, though I would
think it's a natural extension of the TAG files concept.