unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Advice on writing packages please
@ 2003-05-12 13:08 marcuirl
  2003-05-12 13:56 ` Lute Kamstra
  2003-05-12 14:15 ` Oliver Scholz
  0 siblings, 2 replies; 4+ messages in thread
From: marcuirl @ 2003-05-12 13:08 UTC (permalink / raw)



Hey all,

I am just about ready to start writing an emacs package of my
own. Some of the ones I have to use just don't do it for me anymore!
So at least I have a source to work from.

I have reasonable programming skills, though little in lisp ;-) so I
gain two skills from this! The questions I have:

Is there a source of info on the web that I can use to help in writing
major modes for emacs?

What advice would you guys/gals give an enthusiastic newbie to this
field?

Then also some ideas on really basic stuff like:

When editing an xx.el file for mode xx do you need to keep starting a
new emacs session for the changes to take effect? Is there an easier
way to do this?

This latter question is to help me get a foot in the door, I have
nobody here to help with the really really basic stuff like that,
getting over this hurdle would be a huge progress for me. Remember
those days long ago when you had no idea what to do with an 'hello.c'
file and your nerdy friend showed you how? Stuff like that!

Any help much appreciated!

marcu
-- 
Watch the sponge in the email address
Unless otherwise noted, the statements herein reflect my 
personal opinions and not those of any organisation with 
which I may be affiliated.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Advice on writing packages please
  2003-05-12 13:08 Advice on writing packages please marcuirl
@ 2003-05-12 13:56 ` Lute Kamstra
  2003-05-12 14:15 ` Oliver Scholz
  1 sibling, 0 replies; 4+ messages in thread
From: Lute Kamstra @ 2003-05-12 13:56 UTC (permalink / raw)


marcuirl <marcuirl@imap.no2this.cc> writes:

[...]

> Is there a source of info on the web that I can use to help in writing
> major modes for emacs?

The GNU Emacs Lisp Reference Manual is your friend.  It may be
installed in your system already.  Try C-h i d m elisp RET.
Otherwise,

http://www.gnu.org/manual/elisp-manual-21-2.8/elisp.html

It has a chapter on writing major and minor modes.

[...]

> When editing an xx.el file for mode xx do you need to keep starting a
> new emacs session for the changes to take effect? Is there an easier
> way to do this?

M-x eval-buffer, or C-x C-e (eval-last-sexp).

Lute.

-- 
(spook) => "SCUD missile CID electronic surveillance"
(insert-file-contents "~/.signature") => (error "`~/.signature' too rude")

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Advice on writing packages please
  2003-05-12 13:08 Advice on writing packages please marcuirl
  2003-05-12 13:56 ` Lute Kamstra
@ 2003-05-12 14:15 ` Oliver Scholz
  2003-05-20  8:34   ` marcuirl
  1 sibling, 1 reply; 4+ messages in thread
From: Oliver Scholz @ 2003-05-12 14:15 UTC (permalink / raw)


marcuirl <marcuirl@imap.no2this.cc> writes:

> Hey all,
>
> I am just about ready to start writing an emacs package of my
> own. Some of the ones I have to use just don't do it for me anymore!
> So at least I have a source to work from.
>
> I have reasonable programming skills, though little in lisp ;-) so I
> gain two skills from this! The questions I have:
>
> Is there a source of info on the web that I can use to help in writing
> major modes for emacs?
>
> What advice would you guys/gals give an enthusiastic newbie to this
> field?

I assume that you already have the Emacs Lisp Reference Manual. Maybe
you could also have a look at Robert Chassel's "Introduction to Emacs
Lisp". The latter targets non-Programmers as an audience, but if you
are very new to Lisp there might still be something helpful for you.

Furthermore have a look at the Emacs Wiki: 
<URL: http://www.emacswiki.org>, it is an excellent resource for all
kind of information about Emacs Lisp: examples, tipps, code snippets.

For major modes I have the following links in my private Wiki:

    - Tutorial
      http://two-wugs.net/emacs/mode-tutorial.html

    - Generic mode: for simple modes
      http://www.emacswiki.org/cgi-bin/wiki.pl?GenericMode

    - derived modes
      http://www.emacswiki.org/cgi-bin/wiki.pl?DerivedMode

    - Short example
      http://www.emacswiki.org/cgi-bin/wiki.pl?SampleMode

And when you encounter a particular problem, you can always ask here,
of course.

> Then also some ideas on really basic stuff like:
>
> When editing an xx.el file for mode xx do you need to keep starting a
> new emacs session for the changes to take effect? Is there an easier
> way to do this?

Uh, no, Elisp is an interactive language and -- moreover -- you have
access to the Lisp interpreter all the time. (Even typing means
executing Lisp commands.) So most changes take effect as soon as you
evaluate them with `C-x C-e' or `M-x eval-buffer'. There are a few
exceptions to that rule, the most notable being `defvar' and
`defcustom' forms. But you can force evalutation of those forms by
typing `M-C-x' with point in such a form in emacs-lisp-mode. (In
emacs-lisp-mode `M-C-x' works for evaluating `defun's, too.) So at
most you have to execute the initialisation of your major mode in a
particular buffer again (by typing `M-x <major mode name>') to make
your changes take effect. No need to restart Emacs, unless you have
messed up the state of the session.

You could also look at edebug (described in the Emacs Lisp
Reference), which is a stepper for Elisp. Invoke it with `C-u M-C-x'
with point in a `defun'.

Does that help?

    Oliver
-- 
23 Floréal an 211 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Advice on writing packages please
  2003-05-12 14:15 ` Oliver Scholz
@ 2003-05-20  8:34   ` marcuirl
  0 siblings, 0 replies; 4+ messages in thread
From: marcuirl @ 2003-05-20  8:34 UTC (permalink / raw)


Oliver Scholz <alkibiades@gmx.de> writes:

> marcuirl <marcuirl@imap.no2this.cc> writes:
>
>> Hey all,
>>
>> I am just about ready to start writing an emacs package of my
>> own. Some of the ones I have to use just don't do it for me anymore!
>> So at least I have a source to work from.
>>
>> I have reasonable programming skills, though little in lisp ;-) so I
>> gain two skills from this! The questions I have:
>>
>> Is there a source of info on the web that I can use to help in writing
>> major modes for emacs?
>>
>> What advice would you guys/gals give an enthusiastic newbie to this
>> field?
>
> I assume that you already have the Emacs Lisp Reference Manual. Maybe
> you could also have a look at Robert Chassel's "Introduction to Emacs
> Lisp". The latter targets non-Programmers as an audience, but if you
> are very new to Lisp there might still be something helpful for you.
>
> Furthermore have a look at the Emacs Wiki: 
> <URL: http://www.emacswiki.org>, it is an excellent resource for all
> kind of information about Emacs Lisp: examples, tipps, code snippets.
>
> For major modes I have the following links in my private Wiki:
>
>     - Tutorial
>       http://two-wugs.net/emacs/mode-tutorial.html
>
>     - Generic mode: for simple modes
>       http://www.emacswiki.org/cgi-bin/wiki.pl?GenericMode
>
>     - derived modes
>       http://www.emacswiki.org/cgi-bin/wiki.pl?DerivedMode
>
>     - Short example
>       http://www.emacswiki.org/cgi-bin/wiki.pl?SampleMode
>
> And when you encounter a particular problem, you can always ask here,
> of course.
>
>> Then also some ideas on really basic stuff like:
>>
>> When editing an xx.el file for mode xx do you need to keep starting a
>> new emacs session for the changes to take effect? Is there an easier
>> way to do this?
>
> Uh, no, Elisp is an interactive language and -- moreover -- you have
> access to the Lisp interpreter all the time. (Even typing means
> executing Lisp commands.) So most changes take effect as soon as you
> evaluate them with `C-x C-e' or `M-x eval-buffer'. There are a few
> exceptions to that rule, the most notable being `defvar' and
> `defcustom' forms. But you can force evalutation of those forms by
> typing `M-C-x' with point in such a form in emacs-lisp-mode. (In
> emacs-lisp-mode `M-C-x' works for evaluating `defun's, too.) So at
> most you have to execute the initialisation of your major mode in a
> particular buffer again (by typing `M-x <major mode name>') to make
> your changes take effect. No need to restart Emacs, unless you have
> messed up the state of the session.
>
> You could also look at edebug (described in the Emacs Lisp
> Reference), which is a stepper for Elisp. Invoke it with `C-u M-C-x'
> with point in a `defun'.
>
> Does that help?

sorry for the late reply, I've had a promlem with gmane.org!

This is excelent info, thanks Oliver, its just the little push in the
right direction that I needed. I'll probably be back soon with many
more questions once I get set up in my project!

marcu

-- 
Unless otherwise noted, the statements herein reflect my 
personal opinions and not those of any organisation with 
which I may be affiliated.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-20  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-12 13:08 Advice on writing packages please marcuirl
2003-05-12 13:56 ` Lute Kamstra
2003-05-12 14:15 ` Oliver Scholz
2003-05-20  8:34   ` marcuirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).