I've been trying to switch to using GNU Emacs while writing Pascal code, but the Pascal mode shipped with GNUmacs 21.2 is... let's just say, `not up to the task'.
Google-ing for one wasn't much help--none of the projects I've checked support Extended or Object Pascal properly (most don't support them at all).
So, I'd like to ask if anyone here has found/written a Pascal mode for Emacs that supports most (if not all) of the Pascal dialects supported by GNU Pascal, and, if so, where I could get a copy of it.
I only know enough LISP to be able to edit my .emacs file (and then some); I'm nothing near the level of expertise needed to write an Emacs language mode of this scale.
TIA.
On Thu, 7 Oct 2004, Neil Santos wrote:
I've been trying to switch to using GNU Emacs while writing Pascal code, but the Pascal mode shipped with GNUmacs 21.2 is... let's just say, `not up to the task'.
There are two Pascal modes in Emacs 21.3 (perhaps in 21.2 too): pascal.el and delphi.el . There was also another pascal.el with delphi modifications by Christian Sperr. The original download page seems to be gone, but it still exists in the web archive: http://web.archive.org/web/20000816214951/http://ourworld.compuserve.com/hom...
Google-ing for one wasn't much help--none of the projects I've checked support Extended or Object Pascal properly (most don't support them at all). So, I'd like to ask if anyone here has found/written a Pascal mode for Emacs that supports most (if not all) of the Pascal dialects supported by GNU Pascal, and, if so, where I could get a copy of it.
I was looking only for Delphi extensions and e.g. fontification in delphi.el looks quite good. However browsing overloaded constructs is painful - a really good parser is needed for that. It might become possible with CEDET (http://cedet.sourceforge.net/) - I am not sure.
I only know enough LISP to be able to edit my .emacs file (and then some); I'm nothing near the level of expertise needed to write an Emacs language mode of this scale.
If you only want to fontify some more keywords, just search for the keywords list in the existing modes and add yours. You do not have to know any Elisp for that :-).
Josef
On 01:02 08/10/04, Josef Urban wrote:
I've been trying to switch to using GNU Emacs while writing Pascal code, but the Pascal mode shipped with GNUmacs 21.2 is... let's just say, `not up to the task'.
There are two Pascal modes in Emacs 21.3 (perhaps in 21.2 too): pascal.el and delphi.el . There was also another pascal.el with delphi
I've seen reports of delphi.el having pretty much the same problems as pascal.el, though on a much lower scale; but, yeah, I should try that. :D
I was looking only for Delphi extensions and e.g. fontification in delphi.el looks quite good. However browsing overloaded constructs is
Actually, I'm looking mainly for support for Extended Pascal's additions to the language.
I only know enough LISP to be able to edit my .emacs file (and then some); I'm nothing near the level of expertise needed to write an Emacs language mode of this scale.
If you only want to fontify some more keywords, just search for the keywords list in the existing modes and add yours. You do not have to know any Elisp for that :-).
Oh, no; I'd also like proper indentation. Hitting C-q TAB gets rather old, rather quickly.
On Fri, 8 Oct 2004, Neil Santos wrote:
If you only want to fontify some more keywords, just search for the keywords list in the existing modes and add yours. You do not have to know any Elisp for that :-).
Oh, no; I'd also like proper indentation. Hitting C-q TAB gets rather old, rather quickly.
I do not know Extended Pascal, but delphi.el seems quite hackable also for indenting. I'd suggest sending some examples of where indenting fails for you to the delphi.el maintainers, or even to the emacs-devel list.
Josef
On Fri, Oct 08, 2004 at 02:05:33PM +0800, Neil Santos wrote: [...]
I only know enough LISP to be able to edit my .emacs file (and then some); I'm nothing near the level of expertise needed to write an Emacs language mode of this scale.
If you only want to fontify some more keywords, just search for the keywords list in the existing modes and add yours. You do not have to know any Elisp for that :-).
Oh, no; I'd also like proper indentation. Hitting C-q TAB gets rather old, rather quickly.
I use the following kludge in my .emacs. It doesn't fix the indentation rules, but at least makes it feasible to correct it manually.
(add-hook 'pascal-mode-hook (lambda () (local-unset-key ";") (local-unset-key ".") (local-unset-key ":") (local-unset-key "=") (local-unset-key "#") (defun electric-pascal-terminate-line () "Terminate line and indent next line." (interactive) (delete-horizontal-space) (newline) (pascal-indent-line))))
Hope this helps.
Emil Jerabek