unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Francis Moreau <francis.moro@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to get skills in elisp ?
Date: Mon, 25 May 2009 13:50:44 +0200	[thread overview]
Message-ID: <4A1A8614.1000600@easy-emacs.de> (raw)
In-Reply-To: <9c718a3f-d913-4a8d-b928-443c7e9d25d4@r34g2000vbi.googlegroups.com>

Francis Moreau wrote:
> Hello,
>
> [thanks for answering]
>
> On May 25, 10:17 am, "Drew Adams" <drew.ad...@oracle.com> wrote:
>   
>> Yes, take a look at the manual (in Info, `C-h i') called `Emacs Lisp
>> Introduction' in the Info menu. The manual title is actually "An Introduction to
>> Programming in Emacs Lisp". It's just what you're looking for.
>>     
>
> Ok, I did have a look to this but it starts by;
>
>  "This is an `Introduction to Programming in Emacs Lisp', for people
> who are not programmers."
>
> so since I'm a programmer (well I try to be ;) I just skiped the
> document.
>
>   
>> When you want to code something, search (`grep') the existing Emacs-Lisp source
>> code for terms that are pertinent. You can often find code that is similar to
>> what you want to do. This is the way to learn about writing code to change to a
>> different buffer, select a different window, display a buffer, search for text,
>> replace text, and so on - see how the Emacs developers do it.
>>     
>
> yeah that's a good idea.
>
> Is there any way to jump into a function definition (for example by
> using tags) when asking for help on this function (C-h f) ?
>
>   

After C-h f, while info is displayed in other-buffer, I use this

(defun jump-to-form ()
  (interactive)
  (if (featurep 'xemacs)
      (progn
    (forward-char 1)
    (let ((name (symbol-atpt))
          (file (progn (search-forward "\"" nil t 1)(filename-atpt))))
      (forward-char 1)
        (help-find-source-or-scroll-up (point))
        (switch-to-buffer (current-buffer))
        (kill-new name)
        (search-forward name)))
    (other-window 1)
    (forward-button 1)
    (find-file-at-point)))

with key f12

(global-set-key [(f12)] 'jump-to-form)

BTW XEmacs user need
thing-at-point-utils.el from
https://code.launchpad.net/s-x-emacs-werkstatt/
to use this.




>>> Also I would like to know how people debug their scripts ? Are there
>>> any tricks ? For now I just write some forms and evaluate
>>> them with 'C-j'.
>>>       
>> `C-j' evaluates in the *scratch* buffer. I personally don't use *scratch* much.
>> I prefer to create an Emacs-Lisp buffer/file, e.g. foo.el, and work in that,
>> then throw it away. (My fingers can't think of `C-j' as anything other than
>> `newline-and-indent'.)
>>
>> See also `M-:', `eval-region', and `C-x C-e'. See `debug-on-entry'. Put
>> `(debug)' in your code if you want to debug part of a function. Make a function
>> interactive temporarily, to make it easier to call (`M-x', with completion, vs
>> `M-:'). Comment out sections of code using `C-u M-x comment-region' (I bind
>> `comment-region' to `C-x C-;').
>>
>>     
>
> Ok I'll do, thanks for the tips.
>
>   
>> Ask questions here. Visit Emacs Wiki (http://www.emacswiki.org/). Have fun!
>>     
>
> thanks
>
>   





  parent reply	other threads:[~2009-05-25 11:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25  7:30 How to get skills in elisp ? Francis Moreau
2009-05-25  8:17 ` Drew Adams
     [not found] ` <mailman.7753.1243239425.31690.help-gnu-emacs@gnu.org>
2009-05-25  9:15   ` Francis Moreau
2009-05-25 10:22     ` Pascal J. Bourguignon
2009-05-25 11:50     ` Andreas Röhler [this message]
2009-05-25 12:42     ` Richard Riley
2009-05-25 13:51       ` Pascal J. Bourguignon
2009-05-25 14:18         ` Richard Riley
2009-05-26  7:58       ` Francis Moreau
2009-05-25 17:11     ` Drew Adams
     [not found]     ` <mailman.7774.1243271469.31690.help-gnu-emacs@gnu.org>
2009-05-25 19:41       ` Francis Moreau
2009-05-25 20:52         ` Drew Adams
2009-05-25 10:04 ` Tassilo Horn
2009-05-25 11:01 ` Pascal J. Bourguignon
2009-05-25 12:03   ` Andreas Röhler
2009-05-27 13:05   ` Thien-Thi Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2009-05-28  7:09 Benjamin Badgley
2009-05-28 15:55 ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A1A8614.1000600@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=francis.moro@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).