all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs C source code
@ 2012-07-31 10:12 drain
  2012-07-31 16:27 ` Teemu Likonen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: drain @ 2012-07-31 10:12 UTC (permalink / raw)
  To: Help-gnu-emacs


After I enter C-h f then forward-word, I get this message:

forward-word is an interactive built-in function in `syntax.c'.

I click on 'syntax.c' and Emacs tells me: "the C source file syntax.c is not
available".

Where can I find this file? Where is it most likely to be in GNU / Linux?
(my distro is Ubuntu 11.10)
-- 
View this message in context: http://old.nabble.com/Emacs-C-source-code-tp34234906p34234906.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Emacs C source code
  2012-07-31 10:12 Emacs C source code drain
@ 2012-07-31 16:27 ` Teemu Likonen
  2012-07-31 16:47   ` Teemu Likonen
  2012-07-31 16:29 ` XeCycle
  2012-07-31 16:37 ` Mark Skilbeck
  2 siblings, 1 reply; 8+ messages in thread
From: Teemu Likonen @ 2012-07-31 16:27 UTC (permalink / raw)
  To: drain; +Cc: Help-gnu-emacs

drain [2012-07-31 03:12:07 -0700] wrote:

> I click on 'syntax.c' and Emacs tells me: "the C source file syntax.c
> is not available".
>
> Where can I find this file? Where is it most likely to be in GNU /
> Linux? (my distro is Ubuntu 11.10)

If you compile Emacs from its source code and leave the source code
directory intact then the Emacs runtime will find function and variable
definitions from the C source too.

The relevant function looks like this:


DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 1, "^p",
       doc: /* Move point forward ARG words (backward if ARG is negative).
Normally returns t.
If an edge of the buffer or a field boundary is reached, point is left there
and the function returns nil.  Field boundaries are not noticed if
`inhibit-field-text-motion' is non-nil.  */)
  (Lisp_Object arg)
{
  Lisp_Object tmp;
  int orig_val, val;

  if (NILP (arg))
    XSETFASTINT (arg, 1);
  else
    CHECK_NUMBER (arg);

  val = orig_val = scan_words (PT, XINT (arg));
  if (! orig_val)
    val = XINT (arg) > 0 ? ZV : BEGV;

  /* Avoid jumping out of an input field.  */
  tmp = Fconstrain_to_field (make_number (val), make_number (PT),
			     Qt, Qnil, Qnil);
  val = XFASTINT (tmp);

  SET_PT (val);
  return val == orig_val ? Qt : Qnil;
}



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

* Re: Emacs C source code
  2012-07-31 10:12 Emacs C source code drain
  2012-07-31 16:27 ` Teemu Likonen
@ 2012-07-31 16:29 ` XeCycle
  2012-08-01  3:57   ` Yuri Khan
  2012-07-31 16:37 ` Mark Skilbeck
  2 siblings, 1 reply; 8+ messages in thread
From: XeCycle @ 2012-07-31 16:29 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

drain <aeuster@gmail.com> writes:

> After I enter C-h f then forward-word, I get this message:
>
> forward-word is an interactive built-in function in `syntax.c'.
>
> I click on 'syntax.c' and Emacs tells me: "the C source file syntax.c is not
> available".
>
> Where can I find this file?

In the Emacs source tree.

> Where is it most likely to be in GNU / Linux?

It's most likely to be unavailable in most GNU/Linux
installations.

> (my distro is Ubuntu 11.10)

Ubuntu, like Debian, guesses you won't need those files.  You can
get the source release from GNU.

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: Emacs C source code
  2012-07-31 10:12 Emacs C source code drain
  2012-07-31 16:27 ` Teemu Likonen
  2012-07-31 16:29 ` XeCycle
@ 2012-07-31 16:37 ` Mark Skilbeck
  2 siblings, 0 replies; 8+ messages in thread
From: Mark Skilbeck @ 2012-07-31 16:37 UTC (permalink / raw)
  To: drain; +Cc: Help-gnu-emacs

On Tue, Jul 31, 2012 at 03:12:07AM -0700, drain wrote:
> 
> After I enter C-h f then forward-word, I get this message:
> 
> forward-word is an interactive built-in function in `syntax.c'.
> 
> I click on 'syntax.c' and Emacs tells me: "the C source file syntax.c is not
> available".
> 
> Where can I find this file? Where is it most likely to be in GNU / Linux?
> (my distro is Ubuntu 11.10)

Hi!

According to the documentation for `find-function-source-path', it
will look through your `load-path' variable. You will need to point
this to your local Emacs source. Of course, installing Emacs through
the ubuntu apt-get interface does not give you the source - you'll
have to use `apt-get source emacs' or something similar.

Compiling and installing your own Emacs binary, I believe, sets the
load-path automatically to find the source code.

-- 
- mgs.

if all you young men / were fish in the water 
how many young girls / would undress and dive after



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

* Re: Emacs C source code
  2012-07-31 16:27 ` Teemu Likonen
@ 2012-07-31 16:47   ` Teemu Likonen
  2012-08-01  6:56     ` Teemu Likonen
  0 siblings, 1 reply; 8+ messages in thread
From: Teemu Likonen @ 2012-07-31 16:47 UTC (permalink / raw)
  To: drain; +Cc: Help-gnu-emacs

Teemu Likonen [2012-07-31 19:27:54 +0300] wrote:

> If you compile Emacs from its source code and leave the source code
> directory intact then the Emacs runtime will find function and variable
> definitions from the C source too.

I found it. It's variable find-function-C-source-directory and it should
point to the src subdirectory of Emacs code tree.



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

* Re: Emacs C source code
  2012-07-31 16:29 ` XeCycle
@ 2012-08-01  3:57   ` Yuri Khan
  2012-08-01  4:44     ` XeCycle
  0 siblings, 1 reply; 8+ messages in thread
From: Yuri Khan @ 2012-08-01  3:57 UTC (permalink / raw)
  To: XeCycle; +Cc: help-gnu-emacs

On Tue, Jul 31, 2012 at 11:29 PM, XeCycle <XeCycle@gmail.com> wrote:

> Ubuntu, like Debian, guesses you won't need those files.  You can
> get the source release from GNU.

Not entirely correct. In debianoids, one can download the sources from
which a binary package was built by issuing this:

# apt-get source <packagename>

e.g.

# apt-get source emacs

This puts the sources in a subdirectory of the current working
directory, so then Emacs needs to be configured to find its sources
there.



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

* Re: Emacs C source code
  2012-08-01  3:57   ` Yuri Khan
@ 2012-08-01  4:44     ` XeCycle
  0 siblings, 0 replies; 8+ messages in thread
From: XeCycle @ 2012-08-01  4:44 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 908 bytes --]

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Tue, Jul 31, 2012 at 11:29 PM, XeCycle <XeCycle@gmail.com> wrote:
>
>> Ubuntu, like Debian, guesses you won't need those files.  You can
>> get the source release from GNU.
>
> Not entirely correct. In debianoids, one can download the sources from
> which a binary package was built by issuing this:
>
> # apt-get source <packagename>
>
> e.g.
>
> # apt-get source emacs
>
> This puts the sources in a subdirectory of the current working
> directory, so then Emacs needs to be configured to find its sources
> there.

Ah, right, I forgot that.  Most binary distributions don't
provide sources by default, so I'm accustomed to get sources from
official releases.

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: Emacs C source code
  2012-07-31 16:47   ` Teemu Likonen
@ 2012-08-01  6:56     ` Teemu Likonen
  0 siblings, 0 replies; 8+ messages in thread
From: Teemu Likonen @ 2012-08-01  6:56 UTC (permalink / raw)
  To: drain; +Cc: Help-gnu-emacs

Teemu Likonen [2012-07-31 19:47:31 +0300] wrote:

> Teemu Likonen [2012-07-31 19:27:54 +0300] wrote:
>> If you compile Emacs from its source code and leave the source code
>> directory intact then the Emacs runtime will find function and
>> variable definitions from the C source too.
>
> I found it. It's variable find-function-C-source-directory and it
> should point to the src subdirectory of Emacs code tree.

So, you could download the source code

    $ mkdir -p /home/drain/some/good/place
    $ cd /home/drain/some/good/place
    $ apt-get source emacs23

and add a line like this to your Emacs init file:

    (setq find-function-C-source-directory
          "/home/drain/some/good/place/emacs23-23.2+1/src")

Done.



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

end of thread, other threads:[~2012-08-01  6:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31 10:12 Emacs C source code drain
2012-07-31 16:27 ` Teemu Likonen
2012-07-31 16:47   ` Teemu Likonen
2012-08-01  6:56     ` Teemu Likonen
2012-07-31 16:29 ` XeCycle
2012-08-01  3:57   ` Yuri Khan
2012-08-01  4:44     ` XeCycle
2012-07-31 16:37 ` Mark Skilbeck

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.