unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Install C source code for for debugging help
@ 2019-09-26 20:37 Paul Eggert
  2019-09-27  5:07 ` Eli Zaretskii
  0 siblings, 1 reply; 29+ messages in thread
From: Paul Eggert @ 2019-09-26 20:37 UTC (permalink / raw)
  To: Emacs development discussions

In Bug#37527 I proposed a patch to let builders install a compressed 
copy of the C source code for Emacs, so that when users type things like 
'C-h f car RET' they get a button that takes them to the source code for 
'car' instead of giving them a mysterious prompt like "Emacs C source 
dir: ~/" (which is what I get on Debian).

This patch lets builders choose whether to install the compressed 
source. The default is to install it, as the filesystem overhead of 
installing the source code (about 2% of the typical install size) is 
typically not worth worrying about; plus, there is value in encouraging 
builders to better follow the free-software principle of making it easy 
for users to study how Emacs works. Builders can also choose to not 
install the source, or to have Emacs refer to place where the source was 
located when Emacs was built (this last approach does not work in 
typical GNU/Linux distributions, as the build location is not available 
when Emacs is run).

If you run an uninstalled Emacs, it continues to refer to its C source 
directory as before.

I'm mentioning this proposed patch on emacs-devel to see whether anyone 
sees a problem with the idea before I install the patch.



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

* Re: Install C source code for for debugging help
  2019-09-26 20:37 Install C source code for for debugging help Paul Eggert
@ 2019-09-27  5:07 ` Eli Zaretskii
  2019-09-27  6:13   ` Paul Eggert
  0 siblings, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2019-09-27  5:07 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Thu, 26 Sep 2019 13:37:37 -0700
> 
> This patch lets builders choose whether to install the compressed 
> source. The default is to install it, as the filesystem overhead of 
> installing the source code (about 2% of the typical install size) is 
> typically not worth worrying about; plus, there is value in encouraging 
> builders to better follow the free-software principle of making it easy 
> for users to study how Emacs works. Builders can also choose to not 
> install the source, or to have Emacs refer to place where the source was 
> located when Emacs was built (this last approach does not work in 
> typical GNU/Linux distributions, as the build location is not available 
> when Emacs is run).

Why do we need any change at all, given that source-directory is a
variable that a user can change, if the sources are not in the place
where Emacs was built?  The help system even prompts for that
directory, AFAIR.

In any case, installing sources by default doesn't sound TRT to me,
since we currently don't do that, and there were no complaints.  We
could consider making such a change later, if there's sufficient
demand.

> I'm mentioning this proposed patch on emacs-devel to see whether anyone 
> sees a problem with the idea before I install the patch.

I'd like to avoid any more significant changes on master, until we cut
the emacs-27 branch (cannot be done yet because there are 2
significant changes on feature branches waiting to be merged).  We
have more than enough new and potentially destabilizing
changes/features on master already; time to leave something for the
future releases.

Thanks.



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

* Re: Install C source code for for debugging help
  2019-09-27  5:07 ` Eli Zaretskii
@ 2019-09-27  6:13   ` Paul Eggert
  2019-09-27  7:19     ` Eli Zaretskii
  2019-09-27  8:37     ` Andreas Schwab
  0 siblings, 2 replies; 29+ messages in thread
From: Paul Eggert @ 2019-09-27  6:13 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 9/26/19 10:07 PM, Eli Zaretskii wrote:
> Why do we need any change at all

We need it because the feature in question is not working on Debian, or on Red 
Hat, or on any other GNU/Linux distribution that I know of. It's all very well 
to say that the user can change the source-directory variable to some random 
location and then download a correct copy of the right version of the Emacs 
source to that location, but that can be a tricky thing to do correctly when the 
same home directory is shared by multiple Emacs versions (which is common for 
me, at least).

There is little justification to require users to do this this tricky extra work 
for each Emacs version that they use on each platform they run Emacs, when the 
source code in question could easily be made part of the Emacs distribution 
itself and when doing so helps promote the free-software goals of the GNU project.

> there were no complaints

I filed a bug report, and that is a complaint. The bug in question has been an 
annoyance for me for some time, as I often run the Emacs distributed as part of 
Ubuntu and/or Fedora. I finally got around to fixing the bug after noticing a 
related problem, and I doubt I'm the only one who'd welcome having the bug fixed.

The fix can wait until after Emacs 27 comes out of course. If master is that 
close to a release, perhaps it's time to create an emacs-27 branch.



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

* Re: Install C source code for for debugging help
  2019-09-27  6:13   ` Paul Eggert
@ 2019-09-27  7:19     ` Eli Zaretskii
  2019-09-27 13:01       ` Stefan Monnier
  2019-09-27  8:37     ` Andreas Schwab
  1 sibling, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2019-09-27  7:19 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Thu, 26 Sep 2019 23:13:15 -0700
> 
> It's all very well to say that the user can change the
> source-directory variable to some random location and then download
> a correct copy of the right version of the Emacs source to that
> location, but that can be a tricky thing to do correctly

Can you explain in more detail why is this tricky?  AFAIR, Emacs
prompts for the directory in this case, and all the user needs to do
is type its file name at the prompt.

> If master is that close to a release, perhaps it's time to create an
> emacs-27 branch.

I will do that as soon as possible, yes.



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

* Re: Install C source code for for debugging help
  2019-09-27  6:13   ` Paul Eggert
  2019-09-27  7:19     ` Eli Zaretskii
@ 2019-09-27  8:37     ` Andreas Schwab
  2019-09-27  9:06       ` Eli Zaretskii
  1 sibling, 1 reply; 29+ messages in thread
From: Andreas Schwab @ 2019-09-27  8:37 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel

On Sep 26 2019, Paul Eggert <eggert@cs.ucla.edu> wrote:

> We need it because the feature in question is not working on Debian, or on
> Red Hat, or on any other GNU/Linux distribution that I know of. It's all
> very well to say that the user can change the source-directory variable to
> some random location and then download a correct copy of the right version
> of the Emacs source to that location, but that can be a tricky thing to do
> correctly when the same home directory is shared by multiple Emacs
> versions (which is common for me, at least).

Emacs should be taught to find its sources in the debug source
directory, where emacs-debugsource (or its equivalent) installs them.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



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

* Re: Install C source code for for debugging help
  2019-09-27  8:37     ` Andreas Schwab
@ 2019-09-27  9:06       ` Eli Zaretskii
  2019-09-27 11:58         ` Andreas Schwab
  0 siblings, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2019-09-27  9:06 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: eggert, emacs-devel

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
> Date: Fri, 27 Sep 2019 10:37:06 +0200
> 
> Emacs should be taught to find its sources in the debug source
> directory, where emacs-debugsource (or its equivalent) installs them.

Is that different from source-directory?  If so, can you tell why it's
different?  (I know close to nothing about how distros build and
package Emacs.)

Thanks.



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

* Re: Install C source code for for debugging help
  2019-09-27  9:06       ` Eli Zaretskii
@ 2019-09-27 11:58         ` Andreas Schwab
  2019-09-27 12:58           ` Eli Zaretskii
  0 siblings, 1 reply; 29+ messages in thread
From: Andreas Schwab @ 2019-09-27 11:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

On Sep 27 2019, Eli Zaretskii <eliz@gnu.org> wrote:

> Is that different from source-directory?

Yes.

>  If so, can you tell why it's different?

Because the build directory name is not suitable for use in an installed
package.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



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

* Re: Install C source code for for debugging help
  2019-09-27 11:58         ` Andreas Schwab
@ 2019-09-27 12:58           ` Eli Zaretskii
  2019-09-27 13:45             ` Andreas Schwab
  0 siblings, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2019-09-27 12:58 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: eggert, emacs-devel

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: eggert@cs.ucla.edu,  emacs-devel@gnu.org
> Date: Fri, 27 Sep 2019 13:58:56 +0200
> 
> On Sep 27 2019, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > Is that different from source-directory?
> 
> Yes.
> 
> >  If so, can you tell why it's different?
> 
> Because the build directory name is not suitable for use in an installed
> package.

OK, I can see why this is a valid reason.  But how does it happen,
technically, that the emacs-debugsource directory is different?  I
mean, isn't the source directory recorded at build time, both in the
debug info and in the dumped Emacs?  I'm missing the mechanism or
procedure by which these two become different.

Or maybe you didn't mean the source directory as recorded in the debug
info.  But then where is the emacs-debugsource directory recorded?

Thanks.



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

* Re: Install C source code for for debugging help
  2019-09-27  7:19     ` Eli Zaretskii
@ 2019-09-27 13:01       ` Stefan Monnier
  2019-09-27 13:12         ` Stefan Monnier
  2019-09-27 13:33         ` Eli Zaretskii
  0 siblings, 2 replies; 29+ messages in thread
From: Stefan Monnier @ 2019-09-27 13:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Paul Eggert, emacs-devel

>> It's all very well to say that the user can change the
>> source-directory variable to some random location and then download
>> a correct copy of the right version of the Emacs source to that
>> location, but that can be a tricky thing to do correctly
>
> Can you explain in more detail why is this tricky?  AFAIR, Emacs
> prompts for the directory in this case, and all the user needs to do
> is type its file name at the prompt.

There is no valid answer to this prompt, because those source files
simply aren't installed on the machine (at least for 99.99% of the
users, I expect).

I never considered doping what Paul suggests, because I expected the
amount of space wasted this way is too large.  But admittedly, once
compressed with something like lzip the C source files take up less
than 3MB, so it's really not that bad given the size of the `emacs`
executable, plus the .pdmp file and all the .elcs.

In the case of Debian, it would make sense to include those compressed-C
files in the `emacs-el` package (the optional package that provides the
(compressed) .el files, since a normal install of the `emacs` package
only installs the .elc files) which currently weighs in at around 16MB.

Arguably, this is something that Debian/RedHat should be doing on their
side, but maybe Paul's patch is an easier way to convince "all" distros
to do that, rather than lobbying them one by one.


        Stefan




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

* Re: Install C source code for for debugging help
  2019-09-27 13:01       ` Stefan Monnier
@ 2019-09-27 13:12         ` Stefan Monnier
  2019-09-27 13:33         ` Eli Zaretskii
  1 sibling, 0 replies; 29+ messages in thread
From: Stefan Monnier @ 2019-09-27 13:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Paul Eggert, emacs-devel

> I never considered doping what Paul suggests, because I expected the
                     ^^^^^^
                     doing

-- Stefan




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

* Re: Install C source code for for debugging help
  2019-09-27 13:01       ` Stefan Monnier
  2019-09-27 13:12         ` Stefan Monnier
@ 2019-09-27 13:33         ` Eli Zaretskii
  2019-09-27 13:48           ` Stefan Monnier
  1 sibling, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2019-09-27 13:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: eggert, emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Paul Eggert <eggert@cs.ucla.edu>,  emacs-devel@gnu.org
> Date: Fri, 27 Sep 2019 09:01:14 -0400
> 
> >> It's all very well to say that the user can change the
> >> source-directory variable to some random location and then download
> >> a correct copy of the right version of the Emacs source to that
> >> location, but that can be a tricky thing to do correctly
> >
> > Can you explain in more detail why is this tricky?  AFAIR, Emacs
> > prompts for the directory in this case, and all the user needs to do
> > is type its file name at the prompt.
> 
> There is no valid answer to this prompt, because those source files
> simply aren't installed on the machine (at least for 99.99% of the
> users, I expect).

If they have no sources, and don't want to install them, they don't
need to worry about displaying the source of the primitives by
clicking on the Help button.  If they do have the sources installed
somewhere, there _is_ a valid answer to the prompt.

> I never considered doping what Paul suggests, because I expected the
> amount of space wasted this way is too large.  But admittedly, once
> compressed with something like lzip the C source files take up less
> than 3MB, so it's really not that bad given the size of the `emacs`
> executable, plus the .pdmp file and all the .elcs.

What other GNU project installs sources, let alone by default?  Why
should Emacs be different?

> In the case of Debian, it would make sense to include those compressed-C
> files in the `emacs-el` package (the optional package that provides the
> (compressed) .el files, since a normal install of the `emacs` package
> only installs the .elc files) which currently weighs in at around 16MB.
> 
> Arguably, this is something that Debian/RedHat should be doing on their
> side

Exactly.

> but maybe Paul's patch is an easier way to convince "all" distros to
> do that, rather than lobbying them one by one.

I don't see why would we want to convince them.  In the age when
GNU/Linux machines come without a compiler, why would we assume people
want to have the sources handy?

3MB might not be much, but I, for example, keep all the official
releases on my system (and the /usr/share/emacs tree is specifically
arranged to allow that), so these megabytes add up...



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

* Re: Install C source code for for debugging help
  2019-09-27 12:58           ` Eli Zaretskii
@ 2019-09-27 13:45             ` Andreas Schwab
  2019-09-27 13:50               ` Eli Zaretskii
  0 siblings, 1 reply; 29+ messages in thread
From: Andreas Schwab @ 2019-09-27 13:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

On Sep 27 2019, Eli Zaretskii <eliz@gnu.org> wrote:

> OK, I can see why this is a valid reason.  But how does it happen,
> technically, that the emacs-debugsource directory is different?

The debug info files are post-processed to relocate the references to
the source directory.  (See
<https://github.com/rpm-software-management/rpm/blob/master/scripts/find-debuginfo.sh>
for details.)

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



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

* Re: Install C source code for for debugging help
  2019-09-27 13:33         ` Eli Zaretskii
@ 2019-09-27 13:48           ` Stefan Monnier
  2019-09-27 13:56             ` Eli Zaretskii
                               ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: Stefan Monnier @ 2019-09-27 13:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

> What other GNU project installs sources, let alone by default?
> Why should Emacs be different?

Because Emacs provides buttons to jump straight to the source.
I think it is an important feature of Emacs that the source code is
always within easy reach.  I feel it makes it "Freer": we don't just
allow the users to have access to the source, we even encourage them to
dig into it.


        Stefan




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

* Re: Install C source code for for debugging help
  2019-09-27 13:45             ` Andreas Schwab
@ 2019-09-27 13:50               ` Eli Zaretskii
  0 siblings, 0 replies; 29+ messages in thread
From: Eli Zaretskii @ 2019-09-27 13:50 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: eggert, emacs-devel

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: eggert@cs.ucla.edu,  emacs-devel@gnu.org
> Date: Fri, 27 Sep 2019 15:45:14 +0200
> 
> On Sep 27 2019, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > OK, I can see why this is a valid reason.  But how does it happen,
> > technically, that the emacs-debugsource directory is different?
> 
> The debug info files are post-processed to relocate the references to
> the source directory.  (See
> <https://github.com/rpm-software-management/rpm/blob/master/scripts/find-debuginfo.sh>
> for details.)

I see, thanks.

So I guess it would be useful to have a feature whereby we look in the
debug info for this directory and use it instead of source-directory,
if source-directory itself was not found.



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

* Re: Install C source code for for debugging help
  2019-09-27 13:48           ` Stefan Monnier
@ 2019-09-27 13:56             ` Eli Zaretskii
  2019-09-27 14:24               ` Paul Eggert
  2019-09-27 15:25               ` Stefan Monnier
  2019-09-27 15:03             ` Lars Ingebrigtsen
  2019-09-27 15:47             ` David Ringo
  2 siblings, 2 replies; 29+ messages in thread
From: Eli Zaretskii @ 2019-09-27 13:56 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: eggert, emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: eggert@cs.ucla.edu,  emacs-devel@gnu.org
> Date: Fri, 27 Sep 2019 09:48:57 -0400
> 
> > What other GNU project installs sources, let alone by default?
> > Why should Emacs be different?
> 
> Because Emacs provides buttons to jump straight to the source.

Then how about an alternative change, whereby we do not show these
buttons when the sources cannot be found?

> I think it is an important feature of Emacs that the source code is
> always within easy reach.  I feel it makes it "Freer": we don't just
> allow the users to have access to the source, we even encourage them to
> dig into it.

I feel it's a tail wagging the dog.  Both you and my (and others on
this list) have the sources installed, so we are all inherently skewed
in our judgment of this.  To see whether this is a useful feature,
we'd need a real user poll.



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

* Re: Install C source code for for debugging help
  2019-09-27 13:56             ` Eli Zaretskii
@ 2019-09-27 14:24               ` Paul Eggert
  2019-09-27 14:40                 ` Eli Zaretskii
  2019-09-27 17:04                 ` Noam Postavsky
  2019-09-27 15:25               ` Stefan Monnier
  1 sibling, 2 replies; 29+ messages in thread
From: Paul Eggert @ 2019-09-27 14:24 UTC (permalink / raw)
  To: Eli Zaretskii, Stefan Monnier; +Cc: emacs-devel

On 9/27/19 6:56 AM, Eli Zaretskii wrote:
> Both you and my (and others on
> this list) have the sources installed,

Not really. I am typing this email on a laptop that has Emacs installed, 
but there are no C sources in sight because Ubuntu doesn't supply them 
as part of Emacs. When I click on the button to examine the source code 
for 'car', an enormous popup appears, taking up the whole screen, that 
has "Emacs C source dir:" at the top and a file chooser underneath it. I 
normally don't use Ubuntu file choosers (I prefer using Emacs 
minibuffers) and the whole thing is irritating and confusing: I can't 
get at Emacs while the file chooser hogs the whole screen, so I just 
close out the file chooser and give up.




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

* Re: Install C source code for for debugging help
  2019-09-27 14:24               ` Paul Eggert
@ 2019-09-27 14:40                 ` Eli Zaretskii
  2019-09-28  4:03                   ` Paul Eggert
  2019-09-27 17:04                 ` Noam Postavsky
  1 sibling, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2019-09-27 14:40 UTC (permalink / raw)
  To: Paul Eggert; +Cc: monnier, emacs-devel

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Fri, 27 Sep 2019 07:24:23 -0700
> 
> On 9/27/19 6:56 AM, Eli Zaretskii wrote:
> > Both you and my (and others on
> > this list) have the sources installed,
> 
> Not really. I am typing this email on a laptop that has Emacs installed, 
> but there are no C sources in sight because Ubuntu doesn't supply them 
> as part of Emacs.

So if I refer to something in the sources, or send a C-level patch,
you cannot do anything useful with that information?  I don't
understand how a major contributor to C code in Emacs can work on a
machine without sources, excerpt when he/she is on vacation.



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

* Re: Install C source code for for debugging help
  2019-09-27 13:48           ` Stefan Monnier
  2019-09-27 13:56             ` Eli Zaretskii
@ 2019-09-27 15:03             ` Lars Ingebrigtsen
  2019-09-27 15:47             ` David Ringo
  2 siblings, 0 replies; 29+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-27 15:03 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, eggert, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> What other GNU project installs sources, let alone by default?
>> Why should Emacs be different?
>
> Because Emacs provides buttons to jump straight to the source.
> I think it is an important feature of Emacs that the source code is
> always within easy reach.  I feel it makes it "Freer": we don't just
> allow the users to have access to the source, we even encourage them to
> dig into it.

I agree; it seems like a good change (and having the mechanism in-tree
will, as you pointed out, perhaps encourage the distributions to include
the sources).

But it is a pretty unusual thing to include in a distribution.
Including the .el.gz files makes more sense, because people can copy
functions and stuff to their .emacs files and make changes, and then
Emacs behaves differently.  You can't do that with .c.gz files, so
they'd be only for documentation's sake.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: Install C source code for for debugging help
  2019-09-27 13:56             ` Eli Zaretskii
  2019-09-27 14:24               ` Paul Eggert
@ 2019-09-27 15:25               ` Stefan Monnier
  2019-09-28  1:32                 ` Richard Stallman
  1 sibling, 1 reply; 29+ messages in thread
From: Stefan Monnier @ 2019-09-27 15:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

> I feel it's a tail wagging the dog.  Both you and my (and others on
> this list) have the sources installed, so we are all inherently skewed
> in our judgment of this.  To see whether this is a useful feature,
> we'd need a real user poll.

I expect that the overwhelming majority of the users don't want to see
the C source, but then, the vast majority of computer users use
proprietary software.

I think Emacs should (and does) really make a special effort to go out
of its way to encourage users to access the source code.

So I don't think the decision should be made on a question of "do users
need it", but whether we want to actively encourage users to do that
thing that they normally wouldn't even dream of doing.


        Stefan




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

* Re: Install C source code for for debugging help
  2019-09-27 13:48           ` Stefan Monnier
  2019-09-27 13:56             ` Eli Zaretskii
  2019-09-27 15:03             ` Lars Ingebrigtsen
@ 2019-09-27 15:47             ` David Ringo
  2 siblings, 0 replies; 29+ messages in thread
From: David Ringo @ 2019-09-27 15:47 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, eggert, emacs-devel

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

On Fri, Sep 27, 2019 at 9:01 AM Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> > What other GNU project installs sources, let alone by default?
> > Why should Emacs be different?
>
> Because Emacs provides buttons to jump straight to the source.
> I think it is an important feature of Emacs that the source code is
> always within easy reach.  I feel it makes it "Freer": we don't just
> allow the users to have access to the source, we even encourage them to
> dig into it.
>
>
>         Stefan
>

Just want to say +1 to this, and to Paul's proposal.  I'm just a "regular"
Emacs user (i.e. not a contributor) but the ability to inspect Emacs' Elisp
effortlessly is one of my favorite things about the program, and it really
raises Emacs to its own class. The ability to modify Emacs' behavior is
made considerably more meaningful and easier when you can see what else
governs its behavior.  In practice, I think seeing the Elisp is much more
useful than the C source, but after getting accustomed to jumping to the
location of a `def<whatever>', being greeted with the prompt for the C
source directory is almost jarring.  I remember seeing this prompt when I
was first using and exploring Emacs (as provided by my system's package
manager) and just giving up.  It's not so hard to install sources and tell
Emacs about them, as I later discovered, but providing them alongside Emacs
(or at least making it simple to do so) makes it that much easier for
newbies like myself to see how cool and unique Emacs is.  For such a small
cost (a few MB on disk) this seems like a great benefit.

- David

[-- Attachment #2: Type: text/html, Size: 2046 bytes --]

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

* Re: Install C source code for for debugging help
  2019-09-27 14:24               ` Paul Eggert
  2019-09-27 14:40                 ` Eli Zaretskii
@ 2019-09-27 17:04                 ` Noam Postavsky
  2019-09-27 22:45                   ` Fu Yuan
  1 sibling, 1 reply; 29+ messages in thread
From: Noam Postavsky @ 2019-09-27 17:04 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, Stefan Monnier, Emacs developers

On Fri, 27 Sep 2019 at 12:41, Paul Eggert <eggert@cs.ucla.edu> wrote:

> normally don't use Ubuntu file choosers (I prefer using Emacs
> minibuffers) and the whole thing is irritating and confusing: I can't
> get at Emacs while the file chooser hogs the whole screen,

Kind of off-topic, but it sounds like you want to set use-dialog-box to nil.



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

* Re: Install C source code for for debugging help
  2019-09-27 17:04                 ` Noam Postavsky
@ 2019-09-27 22:45                   ` Fu Yuan
  2019-09-28  0:09                     ` Juanma Barranquero
  2019-09-28  2:14                     ` Michael Rohleder
  0 siblings, 2 replies; 29+ messages in thread
From: Fu Yuan @ 2019-09-27 22:45 UTC (permalink / raw)
  To: Noam Postavsky
  Cc: Eli Zaretskii, Paul Eggert, Stefan Monnier, Emacs developers

I’m not sure this change worth the effort. 

I’m not sure being able to C source is that much beneficial to normal users as the C source isn’t that easy to make sense of, as opposed to Elisp sources. 

Regarding the encourage effect Stefan mentioned, I think Elisp sources already have this effect and is better than C source in this aspect because it’s easier to understand, manipulate and play around with.

It is possible that because people on this list all know internal C source of Emacs well, you exaggerated the effect of it for normal users.

On the other hand, maybe a command that downloads and stores the appropriate C source could be added. This shouldn’t be very hard to implement and don’t effect the build size. And people that wants to see the C source can achieve it very easily with the help of this command.

So what I’m trying to say is that 1) Emacs is already encouraging users to explore (Elisp) source and 2) enabling access to C by default don’t have much benefit and 3) there might be a good alternative.

Just my two cents.

- Yuan


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

* Re: Install C source code for for debugging help
  2019-09-27 22:45                   ` Fu Yuan
@ 2019-09-28  0:09                     ` Juanma Barranquero
  2019-09-28  2:14                     ` Michael Rohleder
  1 sibling, 0 replies; 29+ messages in thread
From: Juanma Barranquero @ 2019-09-28  0:09 UTC (permalink / raw)
  To: Fu Yuan
  Cc: Eli Zaretskii, Paul Eggert, Emacs developers, Noam Postavsky,
	Stefan Monnier

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

On Sat, Sep 28, 2019 at 12:46 AM Fu Yuan <casouri@gmail.com> wrote:

> Regarding the encourage effect Stefan mentioned, I think Elisp sources
already
> have this effect and is better than C source in this aspect because it’s
easier to
> understand, manipulate and play around with.

I couldn't agree more. Any Emacs user already has an Elisp interpreter
installed, and can change, explore, experiment. Having the elisp sources at
hand can be a useful tool for learning and extending.

The C sources are anything but trivial to understand, and cannot be changed
unless you invest time in setting up a build environment. Anyone who will
know what to do with the C sources, or even will learn anything from them,
quite likely will already know how to get them.

[-- Attachment #2: Type: text/html, Size: 956 bytes --]

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

* Re: Install C source code for for debugging help
  2019-09-27 15:25               ` Stefan Monnier
@ 2019-09-28  1:32                 ` Richard Stallman
  2019-09-28  2:06                   ` Jean-Christophe Helary
  0 siblings, 1 reply; 29+ messages in thread
From: Richard Stallman @ 2019-09-28  1:32 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: eliz, eggert, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I expect that the overwhelming majority of the users don't want to see
  > the C source, but then, the vast majority of computer users use
  > proprietary software.

  > I think Emacs should (and does) really make a special effort to go out
  > of its way to encourage users to access the source code.

I think it is enough to help users look at the source code
once they decide to download it.

If you build and run Emacs uninstalled, this works automatically.  We
could fairly easily make it more convenient for those who run
installed Emacs and unpack the corresponding source in their home
directories.

To go further than that would do no harm, but it could be a lot of
work.  I suggest that people do the work if they want to.

-- 
Dr Richard Stallman
Founder, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

* Re: Install C source code for for debugging help
  2019-09-28  1:32                 ` Richard Stallman
@ 2019-09-28  2:06                   ` Jean-Christophe Helary
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe Helary @ 2019-09-28  2:06 UTC (permalink / raw)
  To: Emacs developers

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


> On Sep 28, 2019, at 10:32, Richard Stallman <rms@gnu.org> wrote:
> 
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
>> I expect that the overwhelming majority of the users don't want to see
>> the C source, but then, the vast majority of computer users use
>> proprietary software.
> 
>> I think Emacs should (and does) really make a special effort to go out
>> of its way to encourage users to access the source code.
> 
> I think it is enough to help users look at the source code
> once they decide to download it.
> 
> If you build and run Emacs uninstalled, this works automatically.  We
> could fairly easily make it more convenient for those who run
> installed Emacs and unpack the corresponding source in their home
> directories.
> 
> To go further than that would do no harm, but it could be a lot of
> work.  I suggest that people do the work if they want to.

As a non coder but curious user, I think the current setting is enough: checkout the code, build, check the source (either C or lisp), do your thing, build again, etc.

Most of the people who are interested in the entrails of free software, even if not for coding, are willing to take those extra steps, that are necessary anyway if they want to contribute at one point.


Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune



[-- Attachment #2: Type: text/html, Size: 3435 bytes --]

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

* Re: Install C source code for for debugging help
  2019-09-27 22:45                   ` Fu Yuan
  2019-09-28  0:09                     ` Juanma Barranquero
@ 2019-09-28  2:14                     ` Michael Rohleder
  1 sibling, 0 replies; 29+ messages in thread
From: Michael Rohleder @ 2019-09-28  2:14 UTC (permalink / raw)
  To: Emacs developers

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

Fu Yuan <casouri@gmail.com> writes:
> So what I’m trying to say is that 1) Emacs is already encouraging users to
> explore (Elisp) source and 2) enabling access to C by default don’t have much
> benefit and 3) there might be a good alternative.

To 3) one is to use gentoo (and maybe other source based distros?) which
have this functionality build in:

- build emacs with USE=sources and they get installed in
/usr/share/emacs/${FULL_VERSION}/src
- put FEATURES=installsources in your make.conf and sources
get installed to /usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src

etc (w/ symbols, git master branch ...)

For .deb based distros one can "apt-get source emacs.deb" after you have
added a deb-src url to /etc/apt/sources.list.


So in short, I think this is the job of a distro and also the freedom
for the user to decide if he wants src installed should be there
(or in the package management).

But, if its easy to add a ./configure flag like --install-with-sources,
it could still be useful, because it has much more information about
what exactly are the source files, so it could make (src) packaging
easier. (eg gentoo copies .c,.h,.m files. that could be wrong...)


-- 
Redistribution via the Microsoft Network is prohibited.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Install C source code for for debugging help
  2019-09-27 14:40                 ` Eli Zaretskii
@ 2019-09-28  4:03                   ` Paul Eggert
  0 siblings, 0 replies; 29+ messages in thread
From: Paul Eggert @ 2019-09-28  4:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: monnier, emacs-devel

On 9/27/19 9:40 AM, Eli Zaretskii wrote:
>>> Both you and my (and others on
>>> this list) have the sources installed,
>> Not really. I am typing this email on a laptop that has Emacs installed,
>> but there are no C sources in sight because Ubuntu doesn't supply them
>> as part of Emacs.
> So if I refer to something in the sources, or send a C-level patch,
> you cannot do anything useful with that information?

It depends on which version of Emacs you were referring to.Typically 
when you and I interact, it's about Emacs master, and that's different 
from what Ubuntu ships. So I wouldn't expect my laptop Emacs to match 
your email exactly; in order to do something useful and reliable with 
your email I'd need to put a copy of Emacs master on my laptop, or use 
my laptop to log into a computer that already has a copy of Emacs master 
(the latter is what I typically do).

However, if we were talking about Emacs 1:26.1+1-3.2ubuntu2 (which is 
the latest version on stable Ubuntu, and is what I run on my laptop), 
then I'd expect my Emacs C-h f help buttons to match our conversation. 
Unfortunately, this does not currently work for C-language functions. 
Although it's unlikely that you and I would discuss this particular 
Emacs version as you don't use Ubuntu, it's quite possible I'd discuss 
this Emacs version with other Ubuntu users and it'd help such 
discussions if C-h f worked for us.




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

* Re: Install C source code for for debugging help
@ 2019-09-28 18:19 Angelo Graziosi
  2019-09-29  6:56 ` Paul Eggert
  0 siblings, 1 reply; 29+ messages in thread
From: Angelo Graziosi @ 2019-09-28 18:19 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii wrote:

> To see whether this is a useful feature, we'd need a real user poll

I build Emacs from the emacs-master.tar.gz file produced by the Git repo and after the build I delete both the build tree and the tarball (*), so I do not see any usefulness to have the source. If I need it I can read it directly online from the Git repo, and if I need it to change something and test  I can download it. BTW, I often build without debug info so why should I have the need of source? Why you insist in creating "user-developer"?  Do you really think all user of a software product aim to read it source to understand how it work?

Please, let me know how to disable this if installed on master...

  Angelo

----
(*) Really I start to build on GNU/Linux Mint where the tar.gz is downloaded. Then I build for this OS and do also a nox build to be installed on WSL. Then the tar.gz is transferred on the Windows partition where a Windows build is done for W10 Pro 64. the result is installed also on a W10 Home 64.



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

* Re: Install C source code for for debugging help
  2019-09-28 18:19 Angelo Graziosi
@ 2019-09-29  6:56 ` Paul Eggert
  0 siblings, 0 replies; 29+ messages in thread
From: Paul Eggert @ 2019-09-29  6:56 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

On 9/28/19 1:19 PM, Angelo Graziosi wrote:
> Do you really think all user of a software product aim to read it source to understand how it work?

No, of course not. Most users of Emacs can get along without this 
feature (but the same is true for most Emacs features :-).

> let me know how to disable this if installed on master...

In the draft patch, use --disable-install-srcdir when running 'configure'.




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

end of thread, other threads:[~2019-09-29  6:56 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26 20:37 Install C source code for for debugging help Paul Eggert
2019-09-27  5:07 ` Eli Zaretskii
2019-09-27  6:13   ` Paul Eggert
2019-09-27  7:19     ` Eli Zaretskii
2019-09-27 13:01       ` Stefan Monnier
2019-09-27 13:12         ` Stefan Monnier
2019-09-27 13:33         ` Eli Zaretskii
2019-09-27 13:48           ` Stefan Monnier
2019-09-27 13:56             ` Eli Zaretskii
2019-09-27 14:24               ` Paul Eggert
2019-09-27 14:40                 ` Eli Zaretskii
2019-09-28  4:03                   ` Paul Eggert
2019-09-27 17:04                 ` Noam Postavsky
2019-09-27 22:45                   ` Fu Yuan
2019-09-28  0:09                     ` Juanma Barranquero
2019-09-28  2:14                     ` Michael Rohleder
2019-09-27 15:25               ` Stefan Monnier
2019-09-28  1:32                 ` Richard Stallman
2019-09-28  2:06                   ` Jean-Christophe Helary
2019-09-27 15:03             ` Lars Ingebrigtsen
2019-09-27 15:47             ` David Ringo
2019-09-27  8:37     ` Andreas Schwab
2019-09-27  9:06       ` Eli Zaretskii
2019-09-27 11:58         ` Andreas Schwab
2019-09-27 12:58           ` Eli Zaretskii
2019-09-27 13:45             ` Andreas Schwab
2019-09-27 13:50               ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2019-09-28 18:19 Angelo Graziosi
2019-09-29  6:56 ` Paul Eggert

Code repositories for project(s) associated with this public inbox

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

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).