* Re: Retrieving the "include" directory for Emacs Modules [not found] <mailman.624.1733687129.13738.help-gnu-emacs@gnu.org> @ 2024-12-09 9:58 ` Marco Antoniotti 2024-12-09 14:56 ` Eli Zaretskii 0 siblings, 1 reply; 37+ messages in thread From: Marco Antoniotti @ 2024-12-09 9:58 UTC (permalink / raw) To: help-gnu-emacs Hi Eli somewhere, somehow (don't ask me), the "data" directory where emacs keeps its stuff is created and its location recorded. The emacs-module.h is the only thing that sits in the include directory. Now. On my Windows machine, where I install Emacs downloading the installer from one of the links available on the main website, the installation seems, AFAIK, to be up to your standards. On my Mac, If I install emacs as a "formula" (i.e., not a s an app) things seem installed as they should be. OTOH the brew "cask" (which installs a .app in the Application directory) seems to create something that Apple likes, but that STILL may be told to have a pointer to the include directory as it does to the data-directory. This is obviously something that the brew folks should deal with, but the notion of having a variable that tracks the include directory still has merit. At least as an extra guideline to people like the brew maintainers. All the best Marco On Sun, Dec 8, 2024 at 8:45 PM <help-gnu-emacs-request@gnu.org> wrote: > Send help-gnu-emacs mailing list submissions to > help-gnu-emacs@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/help-gnu-emacs > or, via email, send a message with subject or body 'help' to > help-gnu-emacs-request@gnu.org > > You can reach the person managing the list at > help-gnu-emacs-owner@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of help-gnu-emacs digest..." > > > Today's Topics: > > 1. Re: Retrieving the "include" directory for Emacs Modules > (Eli Zaretskii) > 2. Re: Unicode and text editors (Heime) > 3. Re: Unicode and text editors (Eli Zaretskii) > 4. Re: Unicode and text editors (Heime) > 5. Re: Unicode and text editors (Eli Zaretskii) > 6. Re: Checking conditions unrelated to expression > (Michael Heerdegen) > 7. Re: Unicode and text editors (Heime) > 8. Re: Transforming paths in compilation output (containerized > builds) (Björn Bidar) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 08 Dec 2024 19:46:11 +0200 > From: Eli Zaretskii <eliz@gnu.org> > To: help-gnu-emacs@gnu.org > Subject: Re: Retrieving the "include" directory for Emacs Modules > Message-ID: <865xnuf4po.fsf@gnu.org> > > > Date: Sun, 08 Dec 2024 11:48:24 -0500 > > From: Stefan Monnier via Users list for the GNU Emacs text editor < > help-gnu-emacs@gnu.org> > > > > >> > #include <emacs-module.h> > > >> > > > >> > and that's it. Or what am I missing? > > >> > > >> That presumes that Emacs is installed system-wide (and "properly"). > > > > > > What other way is there to install Emacs? > > > > Compile manually and run from the build tree? > > That's called "run uninstalled". And in that case, the user who does > that knows very well where the header lives: in the same directory > from which he/she runs Emacs. > > > Uncompress a downloaded pre-compiled archive into a directory and just > > use it from there (AFAIK, very common under macOS and Windows)? > > If that doesn't place emacs-module.h in the system-wide include > directory, it is a broken installation. > > > With luck on some systems the C (or other) compiler is installed in > > a similar way (i.e. in its own subdirectory, siloed from Emacs). > > That's not how multi-package installation should be organized if the > user wants the packages to cooperate. > > > >> When the compilation of the module is initiated from within Emacs, it > > >> would make a lot of sense for this "ambient" Emacs to be able to tell > > >> `make/gcc/younameit` explicitly and reliably where its own > > >> `emacs-module.h` can be found. > > > But if Emacs is "not installed properly", we don't know that. > > > > Emacs *should* know that, just like it knows where is its > > `lisp-directory`. > > That's impractical expectation. Recall how hard we worked to find the > pdumper file and the preloaded *.eln files, what with all the tricks > people use when installing Emacs. I'm not interested in adding > another burden to our maintenance so that Emacs will paper over broken > installations. Sorry. > > > > ------------------------------ > > Message: 2 > Date: Sun, 08 Dec 2024 17:54:43 +0000 > From: Heime <heimeborgia@protonmail.com> > To: Eli Zaretskii <eliz@gnu.org> > Cc: help-gnu-emacs@gnu.org > Subject: Re: Unicode and text editors > Message-ID: > > <VpTsRgeCxJL-JNeghs40Qt5cLBHbFykIIGYBA6zMT8AkgKUGc_RobIkWbXrtJnf4MVOF_oHrD4iCYJk1jS92lbFA2SjCpB_1htjcPAV0gv0=@ > protonmail.com> > > Content-Type: text/plain; charset=utf-8 > > > On Monday, December 9th, 2024 at 4:32 AM, Eli Zaretskii <eliz@gnu.org> > wrote: > > > > Date: Sun, 08 Dec 2024 15:15:31 +0000 > > > From: "W. Greenhouse" via Users list for the GNU Emacs text editor > help-gnu-emacs@gnu.org > > > > > > Heime via Users list for the GNU Emacs text editor > > > help-gnu-emacs@gnu.org writes: > > > > > > > Is this becoming the norm? What about emacs? > > > > > > > > Does emacs encourage use of unicode characters (UTF-8) in code > comments > > > > and documentation? > > > > > > UTF-8 represents Emacs' internal text encoding > > > > > > No, the internal encoding is different (it's a superset of UTF-8). > > > > > and also its default preference for new files. > > > > > > That is only true if the user's locale has UTF-8 as its codeset. > > > > > When visiting existing files it attempts to > > > detect the encoding, and maintain it while editing. > > > > That is correct. > > Does this mean that we should not worry when we use UTF-8? Would > UTF-* be supported, and detected. With the appropriate symbols showing > as they should. > > > > ------------------------------ > > Message: 3 > Date: Sun, 08 Dec 2024 20:44:42 +0200 > From: Eli Zaretskii <eliz@gnu.org> > To: help-gnu-emacs@gnu.org > Subject: Re: Unicode and text editors > Message-ID: <861pyif205.fsf@gnu.org> > > > Date: Sun, 08 Dec 2024 17:54:43 +0000 > > From: Heime <heimeborgia@protonmail.com> > > Cc: help-gnu-emacs@gnu.org > > > > > > When visiting existing files it attempts to > > > > detect the encoding, and maintain it while editing. > > > > > > That is correct. > > > > Does this mean that we should not worry when we use UTF-8? Would > > UTF-* be supported, and detected. With the appropriate symbols showing > > as they should. > > I was talking about Emacs. Your original question was about other > editors. I'm not familiar with other modern editors enough to tell > whether you should or should not worry. In particular, I don't know > how they recognize UTF-8, and am not sure that Emacs coding cookies > are supported by them. > > > > ------------------------------ > > Message: 4 > Date: Sun, 08 Dec 2024 18:55:52 +0000 > From: Heime <heimeborgia@protonmail.com> > To: Eli Zaretskii <eliz@gnu.org> > Cc: help-gnu-emacs@gnu.org > Subject: Re: Unicode and text editors > Message-ID: > > <p6vv68VE9KE4Y8ML-nAfy75EPmsnsFPaRGtZglz_qmAeKRH62jOOy9XqbeinPnf0-5GkV3BhYTB2gR6QAV_YA85x5teM-wfdi5SXLgsW4W4=@ > protonmail.com> > > Content-Type: text/plain; charset=utf-8 > > > > > > > Sent with Proton Mail secure email. > > On Monday, December 9th, 2024 at 6:44 AM, Eli Zaretskii <eliz@gnu.org> > wrote: > > > > Date: Sun, 08 Dec 2024 17:54:43 +0000 > > > From: Heime heimeborgia@protonmail.com > > > Cc: help-gnu-emacs@gnu.org > > > > > > > > When visiting existing files it attempts to > > > > > detect the encoding, and maintain it while editing. > > > > > > > > That is correct. > > > > > > Does this mean that we should not worry when we use UTF-8? Would > > > UTF-* be supported, and detected. With the appropriate symbols showing > > > as they should. > > > > > > I was talking about Emacs. Your original question was about other > > editors. I'm not familiar with other modern editors enough to tell > > whether you should or should not worry. In particular, I don't know > > how they recognize UTF-8, and am not sure that Emacs coding cookies > > are supported by them. > > Is it reasonable to expect that UTF-* characters are recognised and > supported? > What is your school of thought regarding emacs? > > > > > ------------------------------ > > Message: 5 > Date: Sun, 08 Dec 2024 21:07:47 +0200 > From: Eli Zaretskii <eliz@gnu.org> > To: help-gnu-emacs@gnu.org > Subject: Re: Unicode and text editors > Message-ID: <86wmgadmd8.fsf@gnu.org> > > > Date: Sun, 08 Dec 2024 18:55:52 +0000 > > From: Heime <heimeborgia@protonmail.com> > > Cc: help-gnu-emacs@gnu.org > > > > > I was talking about Emacs. Your original question was about other > > > editors. I'm not familiar with other modern editors enough to tell > > > whether you should or should not worry. In particular, I don't know > > > how they recognize UTF-8, and am not sure that Emacs coding cookies > > > are supported by them. > > > > Is it reasonable to expect that UTF-* characters are recognised and > supported? > > Reasonable? yes. But the problem is not trivial: Emacs itself not > always recognizes UTF-8 reliably. So there could be problems. > > > What is your school of thought regarding emacs? > > I don't understand the question, sorry. > > > > ------------------------------ > > Message: 6 > Date: Sun, 08 Dec 2024 20:19:57 +0100 > From: Michael Heerdegen <michael_heerdegen@web.de> > To: help-gnu-emacs@gnu.org > Subject: Re: Checking conditions unrelated to expression > Message-ID: <87ikruouci.fsf@web.de> > Content-Type: text/plain > > Hello, > > the only thing I want to add to Stefan's answer: the 'let' pattern can > be (despite the name) used as a full-featured "sub-pcase". But also see > 'app' etc. - just see the pattern descriptions in the fine docs. > > Michael. > > > > > ------------------------------ > > Message: 7 > Date: Sun, 08 Dec 2024 19:39:55 +0000 > From: Heime <heimeborgia@protonmail.com> > To: Eli Zaretskii <eliz@gnu.org> > Cc: help-gnu-emacs@gnu.org > Subject: Re: Unicode and text editors > Message-ID: > > <Be0XIegjOn-QFIHzjODCIV_jnl-68E45AFCdDLeqeQ6cYw8sH6hMgQudQVXE_Jx4REYEV96IgFMaEtOaIlDTWDY7QbsIDrY61z-feuEjIpM=@ > protonmail.com> > > Content-Type: text/plain; charset=utf-8 > > > On Monday, December 9th, 2024 at 7:07 AM, Eli Zaretskii <eliz@gnu.org> > wrote: > > > > Date: Sun, 08 Dec 2024 18:55:52 +0000 > > > From: Heime heimeborgia@protonmail.com > > > Cc: help-gnu-emacs@gnu.org > > > > > > > I was talking about Emacs. Your original question was about other > > > > editors. I'm not familiar with other modern editors enough to tell > > > > whether you should or should not worry. In particular, I don't know > > > > how they recognize UTF-8, and am not sure that Emacs coding cookies > > > > are supported by them. > > > > > > Is it reasonable to expect that UTF-* characters are recognised and > supported? > > > > > > Reasonable? yes. But the problem is not trivial: Emacs itself not > > always recognizes UTF-8 reliably. So there could be problems. > > > > > What is your school of thought regarding emacs? > > > > > > I don't understand the question, sorry. > > Should we comfortable use UTF Characters in source code when using Emacs? > When there are problems, do they usually get looked into and fixed if > possible? > > > > > ------------------------------ > > Message: 8 > Date: Sun, 08 Dec 2024 21:45:15 +0200 > From: Björn Bidar <bjorn.bidar@thaodan.de> > To: Yuri Khan <yuri.v.khan@gmail.com> > Cc: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org > Subject: Re: Transforming paths in compilation output (containerized > builds) > Message-ID: <87frmy2c38.fsf@> > Content-Type: text/plain > > Yuri Khan <yuri.v.khan@gmail.com> writes: > > > On Sun, 8 Dec 2024 at 12:43, Eli Zaretskii <eliz@gnu.org> wrote: > > > >> > > Is compilation-transform-file-match-alist what you are looking for? > >> > > >> > The variable talks only about errors. Does it apply to all messages > not just > >> > the errors? > >> > >> It is applied to all messages. > > > > In my experience, it is not applied to messages as such. It is > > consulted when building text properties while fontifying the messages > > so that the user can jump to error locations; but the actual visible > > text in the buffer remains unmodified. > > That the actual text remains unmodified is good, it's actually better > since it doesn't reveal any private information/makes the output depend on > the > users machine. > > As long as it applies to all messages it's good. Maybe the description > or the name of the variable should be changed then. > > I looked at the integration for the other container engines for > inspiration on how to solve this issue. > None of them handle this issue or are affected. > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > https://lists.gnu.org/mailman/listinfo/help-gnu-emacs > > > ------------------------------ > > End of help-gnu-emacs Digest, Vol 265, Issue 40 > *********************************************** > -- Marco Antoniotti Somewhere over the Rainbow ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-09 9:58 ` Retrieving the "include" directory for Emacs Modules Marco Antoniotti @ 2024-12-09 14:56 ` Eli Zaretskii 2024-12-09 15:50 ` Rudolf Schlatte ` (2 more replies) 0 siblings, 3 replies; 37+ messages in thread From: Eli Zaretskii @ 2024-12-09 14:56 UTC (permalink / raw) To: help-gnu-emacs > From: Marco Antoniotti <marcoxa@gmail.com> > Date: Mon, 9 Dec 2024 10:58:57 +0100 > > On my Mac, If I install emacs as a "formula" (i.e., not a s an app) things > seem installed as they should be. OTOH the brew "cask" (which installs a > .app in the Application directory) seems to create something that Apple > likes, but that STILL may be told to have a pointer to the include > directory as it does to the data-directory. > > This is obviously something that the brew folks should deal with, but the > notion of having a variable that tracks the include directory still has > merit. At least as an extra guideline to people like the brew maintainers. As I tried to explain, if emacs-module.h is not installed in its intended place, we cannot know where it is installed. We only know that from the default installation locations we have in our Makefiles, but if some distros modify that, we cannot know. And I still contend that the correct installation should put this file where all the other header files are, and then the compiler will always find it. Users who don't want to fight the uphill battle against brew could simply copy the file to the compiler's include directory, and be done. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-09 14:56 ` Eli Zaretskii @ 2024-12-09 15:50 ` Rudolf Schlatte 2024-12-09 22:10 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-22 22:17 ` Arsen Arsenović 2 siblings, 0 replies; 37+ messages in thread From: Rudolf Schlatte @ 2024-12-09 15:50 UTC (permalink / raw) To: help-gnu-emacs Eli Zaretskii <eliz@gnu.org> writes: >> From: Marco Antoniotti <marcoxa@gmail.com> >> Date: Mon, 9 Dec 2024 10:58:57 +0100 >> >> On my Mac, If I install emacs as a "formula" (i.e., not a s an app) things >> seem installed as they should be. OTOH the brew "cask" (which installs a >> .app in the Application directory) seems to create something that Apple >> likes, but that STILL may be told to have a pointer to the include >> directory as it does to the data-directory. >> >> This is obviously something that the brew folks should deal with, but the >> notion of having a variable that tracks the include directory still has >> merit. At least as an extra guideline to people like the brew maintainers. > > As I tried to explain, if emacs-module.h is not installed in its > intended place, we cannot know where it is installed. We only know > that from the default installation locations we have in our Makefiles, > but if some distros modify that, we cannot know. > > And I still contend that the correct installation should put this file > where all the other header files are, and then the compiler will > always find it. Users who don't want to fight the uphill battle > against brew could simply copy the file to the compiler's include > directory, and be done. `make install' for the nextstep backend produces Emacs.app, a self-contained bundle that can be double-clicked to start Emacs but is also a directory that contains the standard Emacs files inside, as Emacs.app/Contents/Resources/{etc,include,info,lisp,man,site-lisp,...}. I guess this is the case that Marco encounters: C-h N opens <wherever>/Emacs.app/Contents/Resources/etc/NEWS, so the running Emacs must have some knowledge about where it is installed. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-09 14:56 ` Eli Zaretskii 2024-12-09 15:50 ` Rudolf Schlatte @ 2024-12-09 22:10 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-10 3:29 ` Eli Zaretskii 2024-12-22 22:17 ` Arsen Arsenović 2 siblings, 1 reply; 37+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-09 22:10 UTC (permalink / raw) To: help-gnu-emacs > As I tried to explain, if emacs-module.h is not installed in its > intended place, we cannot know where it is installed. The patch below would make sure that `emacs-module.h` is always available at `$(data-directory)/include/emacs-module.h`. Stefan diff --git a/src/Makefile.in b/src/Makefile.in index c278924ef94..c1385dd7188 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -731,12 +731,19 @@ MAKE_PDUMPER_FINGERPRINT = MAKE_PDUMPER_FINGERPRINT = endif +modules_header = $(top_srcdir)/etc/include/emacs-module.h + +$(modules_header): $(srcdir)/emacs-module.h + $(AM_V_at)$(MKDIR_P) $(dir $@) + $(AM_V_at)cp $< $@ + ## We have to create $(etc) here because init_cmdargs tests its ## existence when setting Vinstallation_directory (FIXME?). ## This goes on to affect various things, and the emacs binary fails ## to start if Vinstallation_directory has the wrong value. temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \ - $(charsets) $(charscript) ${emoji-zwj} $(MAKE_PDUMPER_FINGERPRINT) + $(charsets) $(charscript) ${emoji-zwj} $(MAKE_PDUMPER_FINGERPRINT) \ + $(modules_header) ifeq ($(HAVE_BE_APP),yes) $(AM_V_CXXLD)$(CXX) -o $@.tmp \ $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ ^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-09 22:10 ` Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-10 3:29 ` Eli Zaretskii 2024-12-11 3:23 ` Stefan Monnier via Users list for the GNU Emacs text editor 0 siblings, 1 reply; 37+ messages in thread From: Eli Zaretskii @ 2024-12-10 3:29 UTC (permalink / raw) To: help-gnu-emacs > Date: Mon, 09 Dec 2024 17:10:50 -0500 > From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> > > > As I tried to explain, if emacs-module.h is not installed in its > > intended place, we cannot know where it is installed. > > The patch below would make sure that `emacs-module.h` is always > available at `$(data-directory)/include/emacs-module.h`. Sorry, this is wrong. No compiler will look in that directory without a suitable -I option, so this is a change that will break previous (and correct) behavior. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-10 3:29 ` Eli Zaretskii @ 2024-12-11 3:23 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-11 13:01 ` Eli Zaretskii ` (2 more replies) 0 siblings, 3 replies; 37+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-11 3:23 UTC (permalink / raw) To: help-gnu-emacs >> > As I tried to explain, if emacs-module.h is not installed in its >> > intended place, we cannot know where it is installed. >> The patch below would make sure that `emacs-module.h` is always >> available at `$(data-directory)/include/emacs-module.h`. > Sorry, this is wrong. [...] this is a change that will break previous > (and correct) behavior. I don't see how it would break anything: the .h file is still *also* copied to the $(includedir) for those people who want to compile their module outside of Emacs. > No compiler will look in that directory without a suitable -I option, That's OK: the sole purpose of the change is to let ELPA packages call `gcc` with such a `-I`! Stefan ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-11 3:23 ` Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-11 13:01 ` Eli Zaretskii 2024-12-19 23:50 ` Björn Bidar [not found] ` <87ttazmdvc.fsf@> 2 siblings, 0 replies; 37+ messages in thread From: Eli Zaretskii @ 2024-12-11 13:01 UTC (permalink / raw) To: help-gnu-emacs > Date: Tue, 10 Dec 2024 22:23:05 -0500 > From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> > > >> > As I tried to explain, if emacs-module.h is not installed in its > >> > intended place, we cannot know where it is installed. > >> The patch below would make sure that `emacs-module.h` is always > >> available at `$(data-directory)/include/emacs-module.h`. > > Sorry, this is wrong. [...] this is a change that will break previous > > (and correct) behavior. > > I don't see how it would break anything: the .h file is still *also* > copied to the $(includedir) for those people who want to compile their > module outside of Emacs. That makes this easier to accept, but there are still issues. > > No compiler will look in that directory without a suitable -I option, > > That's OK: the sole purpose of the change is to let ELPA packages call > `gcc` with such a `-I`! Let's discuss this in a proper place, not here, okay? In particular, I'd like to hear more opinions and data points, from people who don't necessarily read this forum. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-11 3:23 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-11 13:01 ` Eli Zaretskii @ 2024-12-19 23:50 ` Björn Bidar [not found] ` <87ttazmdvc.fsf@> 2 siblings, 0 replies; 37+ messages in thread From: Björn Bidar @ 2024-12-19 23:50 UTC (permalink / raw) To: Stefan Monnier via Users list for the GNU Emacs text editor Cc: Stefan Monnier Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes: >>> > As I tried to explain, if emacs-module.h is not installed in its >>> > intended place, we cannot know where it is installed. >>> The patch below would make sure that `emacs-module.h` is always >>> available at `$(data-directory)/include/emacs-module.h`. >> Sorry, this is wrong. [...] this is a change that will break previous >> (and correct) behavior. > > I don't see how it would break anything: the .h file is still *also* > copied to the $(includedir) for those people who want to compile their > module outside of Emacs. > >> No compiler will look in that directory without a suitable -I option, > > That's OK: the sole purpose of the change is to let ELPA packages call > `gcc` with such a `-I`! > Which is wrong for Unix-like systems except on macOS. It's debatable if packages should compile their native modules themselves but if they do they shouldn't change all systems just to accommodate macOS and Windows. Why not install the Emacs module header to PREFIX/include on these platforms and deduct the path of the header similarly to how eln-dest-dir is determined? ^ permalink raw reply [flat|nested] 37+ messages in thread
[parent not found: <87ttazmdvc.fsf@>]
* Re: Retrieving the "include" directory for Emacs Modules [not found] ` <87ttazmdvc.fsf@> @ 2024-12-20 7:09 ` Eli Zaretskii 2024-12-20 9:01 ` Basile Starynkevitch 2024-12-23 0:47 ` Björn Bidar 2024-12-20 15:41 ` Stefan Monnier 1 sibling, 2 replies; 37+ messages in thread From: Eli Zaretskii @ 2024-12-20 7:09 UTC (permalink / raw) To: help-gnu-emacs > From: Björn Bidar <bjorn.bidar@thaodan.de> > Cc: Stefan Monnier <monnier@iro.umontreal.ca> > Date: Fri, 20 Dec 2024 01:50:31 +0200 > > Why not install the Emacs module header to PREFIX/include on these > platforms We already do that. > and deduct the path of the header similarly to how eln-dest-dir is > determined? This very complicated, due to the various ways people install Emacs, the use of symlinks, and other similar issues. We work very hard to find the eln files; adding yet another similar (but different) code path at startup is not my idea of fun. And again, this list is the wrong place to discuss these issues. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-20 7:09 ` Eli Zaretskii @ 2024-12-20 9:01 ` Basile Starynkevitch 2024-12-23 0:47 ` Björn Bidar 1 sibling, 0 replies; 37+ messages in thread From: Basile Starynkevitch @ 2024-12-20 9:01 UTC (permalink / raw) To: Eli Zaretskii, help-gnu-emacs On Fri, 2024-12-20 at 09:09 +0200, Eli Zaretskii wrote: > > From: Björn Bidar <bjorn.bidar@thaodan.de> > > Cc: Stefan Monnier <monnier@iro.umontreal.ca> > > Date: Fri, 20 Dec 2024 01:50:31 +0200 > > > > Why not install the Emacs module header to PREFIX/include on these > > platforms > > We already do that. A suggestion (perhaps a stupid one) might be to 1. have some C function (or C #define) in PREFIX/include/emacs-module.h give the installed PREFIX string. On my Linux Mint 22 (x86-64) desktop the system file /usr/include/emacs-module.h is provided by package emacs-common and apparently don't have any such thing (I didn't look inside the #include-d files). Of course I mean something better and more robust than #define EMACS_INCLUDE_FILE __FILE__ 2. have an Elisp builtin function (maybe there is one already but C-h a don't find it) which returns the Elisp string giving the prefix. BTW I just git clone-d https://git.savannah.gnu.org/git/emacs.git into my desktop's /usr/src/Editors/emacs directory (GNU emacs commit is 926a9c864adc29f056) and it fails to build after an autogen.sh and a './configure' '--program-suffix=-trunk' '--with-x-toolkit=gtk3' \ '--with-native-compilation' '--with-sqlite3' '--with-modules' \ '--with-gpm' '--disable-silent-rules' '--without-rsvg' \ 'CFLAGS=-O2 -g' 'CC=/usr/bin/gcc-14' the failure message is: checking for gcc_jit_context_acquire in -lgccjit... yes checking libgccjit.h usability... yes checking libgccjit.h presence... yes checking for libgccjit.h... yes configure: error: The installed libgccjit failed to compile and run a test program using the libgccjit library; see config.log for the details of the failure. But libgccjit is installed in /usr/lib/gcc/x86_64-linux-gnu/14/include/libgccjit.h I also did compile gcc-15-20241215 from source code, so I also do have a /usr/local/include/libgccjit.h file My emacs config.log file can be downloaded by you before mid-january 2025 (at least on Linux) using wget http://starynkevitch.net/Basile/emacs-926a9c864adc29f0-config.log and its md5sum is 118c070dae8805c5c217a05b36659c18 At last my GPL licensed open source project is an inference engine on https://github.com/RefPerSys/RefPerSys (coded in C++ and work in progress). I eventually hope to make that RefPerSys (REFlexive PERsistent SYStem) a GNU project and I even hope to have some students (worldwide) contributing a bit to it. Regards from near Paris in France. NB. 15 years ago I contributed to GCC (plugin machinery). -- Basile STARYNKEVITCH <basile@starynkevitch.net> 8 rue de la Faïencerie 92340 Bourg-la-Reine, France http://starynkevitch.net/Basile & https://github.com/bstarynk ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-20 7:09 ` Eli Zaretskii 2024-12-20 9:01 ` Basile Starynkevitch @ 2024-12-23 0:47 ` Björn Bidar 1 sibling, 0 replies; 37+ messages in thread From: Björn Bidar @ 2024-12-23 0:47 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs Eli Zaretskii <eliz@gnu.org> writes: >> From: Björn Bidar <bjorn.bidar@thaodan.de> >> Cc: Stefan Monnier <monnier@iro.umontreal.ca> >> Date: Fri, 20 Dec 2024 01:50:31 +0200 >> >> Why not install the Emacs module header to PREFIX/include on these >> platforms > > We already do that. So for example Emacs.app contains the module header in Emacs.app/include? ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules [not found] ` <87ttazmdvc.fsf@> 2024-12-20 7:09 ` Eli Zaretskii @ 2024-12-20 15:41 ` Stefan Monnier 2024-12-23 1:00 ` Björn Bidar [not found] ` <871pxzxlfe.fsf@> 1 sibling, 2 replies; 37+ messages in thread From: Stefan Monnier @ 2024-12-20 15:41 UTC (permalink / raw) To: Björn Bidar Cc: Stefan Monnier via Users list for the GNU Emacs text editor >> That's OK: the sole purpose of the change is to let ELPA packages call >> `gcc` with such a `-I`! > Which is wrong for Unix-like systems except on macOS. In which sense would it be wrong? I can see an argument that such a `-I` would tend to be redundant on systems where Emacs was "installed properly", but even on those systems I fail to see what would be "wrong" about it. > It's debatable if packages should compile their native modules > themselves IME it's what most users expect when they install (via `package.el`) packages that come with a module, and it's also what most of the developers of those packages want to offer to their users. I have no intention to impose such an approach as the only supported way to install a module, but I don't see what's debatable about providing good support for packages to be able to compile their own modules. Stefan ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-20 15:41 ` Stefan Monnier @ 2024-12-23 1:00 ` Björn Bidar [not found] ` <871pxzxlfe.fsf@> 1 sibling, 0 replies; 37+ messages in thread From: Björn Bidar @ 2024-12-23 1:00 UTC (permalink / raw) To: Stefan Monnier Cc: Stefan Monnier via Users list for the GNU Emacs text editor Stefan Monnier <monnier@iro.umontreal.ca> writes: >>> That's OK: the sole purpose of the change is to let ELPA packages call >>> `gcc` with such a `-I`! >> Which is wrong for Unix-like systems except on macOS. > > In which sense would it be wrong? > I can see an argument that such a `-I` would tend to be redundant on > systems where Emacs was "installed properly", but even on those systems > I fail to see what would be "wrong" about it. Headers don't go the Emacs data directory but in the include directory, usually /usr/include or /usr/local/include. >> It's debatable if packages should compile their native modules >> themselves > > IME it's what most users expect when they install (via `package.el`) > packages that come with a module, and it's also what most of the > developers of those packages want to offer to their users. > I have no intention to impose such an approach as the only supported way > to install a module, but I don't see what's debatable about providing > good support for packages to be able to compile their own modules. I don't think about imposing anything but keeping in mind that modules built arbitrary native code which can bring it's own issues especially when external dependencies come into play. Most packages which use native modules have to be adjusted to not built the native module for themselves or from where to load the native-module, some don't from load-path or no load-path for native modules (they are not installed to datadir). I wonder if there's something that could be learned from XEmacs approach of emodules which were very similar. Especially the idea of ellcc[1] sounds very good in this context. -- [1] http://xemacs.org/Documentation/21.5/html/emodules_2.html#Using-ellcc ^ permalink raw reply [flat|nested] 37+ messages in thread
[parent not found: <871pxzxlfe.fsf@>]
* Re: Retrieving the "include" directory for Emacs Modules [not found] ` <871pxzxlfe.fsf@> @ 2024-12-24 5:06 ` Stefan Monnier 2024-12-24 12:36 ` Eli Zaretskii 0 siblings, 1 reply; 37+ messages in thread From: Stefan Monnier @ 2024-12-24 5:06 UTC (permalink / raw) To: Björn Bidar Cc: Stefan Monnier via Users list for the GNU Emacs text editor >>>> That's OK: the sole purpose of the change is to let ELPA packages call >>>> `gcc` with such a `-I`! >>> Which is wrong for Unix-like systems except on macOS. >> In which sense would it be wrong? >> I can see an argument that such a `-I` would tend to be redundant on >> systems where Emacs was "installed properly", but even on those systems >> I fail to see what would be "wrong" about it. > Headers don't go the Emacs data directory but in the include directory, > usually /usr/include or /usr/local/include. "Unusual" doesn't mean "wrong". So, I don't think it's a valid description of something that would be "wrong" about it. [ BTW, `locate '*.h' | sed 's|[^/]*$||' | sort -u` on this Debian system suggests Emacs would be far from the only package to place header files outside of `/usr/include` or `/usr/local/include`. ] > I don't think about imposing anything but keeping in mind that modules > built arbitrary native code which can bring it's own issues especially > when external dependencies come into play. Indeed, beside finding Emacs's own header file, there can be various other hurdles to making a module that can be built on "all" systems. > I wonder if there's something that could be learned from XEmacs approach > of emodules which were very similar. I'd be surprised if there isn't something to learn from them, indeed. > Especially the idea of ellcc[1] sounds very good in this context. AFAICT this deals with the issue of how to build a "shared lib" kind of object file, IOW something that solves the same kinds of problem that Libtool aims to solve, right? Maybe we should develop a "module-helper" package which provides various helpers to build modules. Stefan ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-24 5:06 ` Stefan Monnier @ 2024-12-24 12:36 ` Eli Zaretskii 2024-12-24 15:30 ` Stefan Monnier via Users list for the GNU Emacs text editor 0 siblings, 1 reply; 37+ messages in thread From: Eli Zaretskii @ 2024-12-24 12:36 UTC (permalink / raw) To: help-gnu-emacs > From: Stefan Monnier <monnier@iro.umontreal.ca> > Cc: Stefan Monnier via Users list for the GNU Emacs text editor > <help-gnu-emacs@gnu.org> > Date: Tue, 24 Dec 2024 00:06:07 -0500 > > [ BTW, `locate '*.h' | sed 's|[^/]*$||' | sort -u` on this Debian system > suggests Emacs would be far from the only package to place header files > outside of `/usr/include` or `/usr/local/include`. ] Careful: the above might pick up header files private to source distributions if you have them on your system (i.e., if you build packages locally from sources). By contrast, this discussion is about _public_ header files, ones installed with the purpose of letting other packages interface with the package whose header file is installed. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-24 12:36 ` Eli Zaretskii @ 2024-12-24 15:30 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-24 16:38 ` Eli Zaretskii 0 siblings, 1 reply; 37+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-24 15:30 UTC (permalink / raw) To: help-gnu-emacs > Careful: the above might pick up header files private to source > distributions if you have them on your system (i.e., if you build > packages locally from sources). By contrast, this discussion is about > _public_ header files, ones installed with the purpose of letting > other packages interface with the package whose header file is > installed. I'll let you judge. Stefan % locate '*.h' | sed 's|[^/]*$||' | sort -u | grep -v 'monnier\|/usr/include' /usr/lib/clisp-2.49.93+/base/ /usr/lib/clisp-2.49.93+/linkkit/ /usr/lib/gcc/x86_64-linux-gnu/10/include/ /usr/lib/gcc/x86_64-linux-gnu/10/include/sanitizer/ /usr/lib/gcc/x86_64-linux-gnu/12/include/ /usr/lib/gcc/x86_64-linux-gnu/12/include/sanitizer/ /usr/lib/ghc/ /usr/lib/ghc/base-4.15.1.0/include/ /usr/lib/ghc/bytestring-0.10.12.1/include/ /usr/lib/ghc/ghc-9.0.2/include/ /usr/lib/ghc/ghc-bignum-1.1/include/ /usr/lib/ghc/include/ /usr/lib/ghc/include/rts/ /usr/lib/ghc/include/rts/prof/ /usr/lib/ghc/include/rts/storage/ /usr/lib/ghc/include/stg/ /usr/lib/ghc/process-1.6.13.2/include/ /usr/lib/ghc/time-1.9.3/include/ /usr/lib/ghc/unix-2.7.2.2/include/ /usr/lib/gprolog/include/ /usr/lib/grub/i386-pc/ /usr/lib/grub/x86_64-efi/ /usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-9.0.2/primitive-0.7.3.0-EikPDi9CXNiB9f5MDJybeY/include/ /usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-9.0.2/vector-0.12.3.1-TXkE6leK98EdYcmdk29JF/include/ /usr/lib/jvm/java-17-openjdk-amd64/include/ /usr/lib/jvm/java-17-openjdk-amd64/include/linux/ /usr/lib/llvm-14/lib/clang/14.0.6/include/ /usr/lib/llvm-14/lib/clang/14.0.6/include/openmp_wrappers/ /usr/lib/llvm-14/lib/clang/14.0.6/include/ppc_wrappers/ /usr/lib/llvm-14/lib/clang/14.0.6/include/xray/ /usr/lib/ocaml/caml/ /usr/lib/ocaml/zarith/ /usr/lib/python3/dist-packages/dulwich/ /usr/lib/python3/dist-packages/greenlet/ /usr/lib/python3/dist-packages/greenlet/platform/ /usr/lib/python3/dist-packages/lxml/ /usr/lib/python3/dist-packages/lxml/includes/ /usr/lib/swi-prolog/include/ /usr/lib/swi-prolog/include/sicstus/ /usr/lib/swi-prolog/include/Yap/ /usr/lib/x86_64-linux-gnu/dbus-1.0/include/dbus/ /usr/lib/x86_64-linux-gnu/glib-2.0/include/ /usr/lib/x86_64-linux-gnu/perl/5.36.0/CORE/ /usr/lib/x86_64-linux-gnu/perl5/5.36/B/Hooks/OP/Check/Install/ /usr/lib/x86_64-linux-gnu/perl5/5.36/Cairo/Install/ /usr/lib/x86_64-linux-gnu/perl5/5.36/Encode/ /usr/lib/x86_64-linux-gnu/perl5/5.36/Glib/Install/ /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/ /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/m/ /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/s/ /usr/share/cmake-3.25/include/ /usr/share/cmake-3.25/Modules/ /usr/share/cups/ppdc/ /usr/share/doc/bison/examples/c/mfcalc/ /usr/share/doc/guile-3.0-dev/examples/compat/ /usr/share/doc/libzstd-dev/examples/ /usr/share/doc/nettle-dev/examples/ /usr/share/doc/printer-driver-pnm2ppa/pl/ /usr/share/doc/zlib1g-dev/examples/ /usr/share/gettext/ /usr/share/go-1.19/misc/cgo/life/testdata/ /usr/share/go-1.19/misc/cgo/test/ /usr/share/go-1.19/misc/cgo/testplugin/testdata/issue25756/plugin/ /usr/share/go-1.19/misc/cgo/testsovar/testdata/ /usr/share/go-1.19/misc/cgo/test/testdata/gcc68255/ /usr/share/go-1.19/misc/cgo/test/testdata/issue20266/ /usr/share/go-1.19/misc/cgo/test/testdata/issue26213/ /usr/share/go-1.19/misc/cgo/test/testdata/issue27054/ /usr/share/go-1.19/misc/swig/callback/ /usr/share/go-1.19/pkg/include/ /usr/share/go-1.19/src/crypto/internal/boring/ /usr/share/go-1.19/src/debug/dwarf/testdata/ /usr/share/go-1.19/src/debug/gosym/testdata/ /usr/share/go-1.19/src/runtime/ /usr/share/go-1.19/src/runtime/cgo/ /usr/share/grub/ /usr/share/libtool/ /usr/share/libtool/libltdl/ /usr/share/perl/5.36.0/Encode/ /usr/share/smartmontools/ /usr/src/libdvd-pkg/build/ /usr/src/libdvd-pkg/build/msvc/ /usr/src/libdvd-pkg/build/src/ /usr/src/libdvd-pkg/build/src/dvdcss/ /usr/src/linux-apfs-rw-0.3.0-1/ /usr/src/linux-apfs-rw-0.3.0-1/lzfse/ /var/lib/smartmontools/drivedb/ % ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-24 15:30 ` Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-24 16:38 ` Eli Zaretskii 2024-12-24 20:39 ` Björn Bidar 0 siblings, 1 reply; 37+ messages in thread From: Eli Zaretskii @ 2024-12-24 16:38 UTC (permalink / raw) To: help-gnu-emacs > Date: Tue, 24 Dec 2024 10:30:41 -0500 > From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> > > > Careful: the above might pick up header files private to source > > distributions if you have them on your system (i.e., if you build > > packages locally from sources). By contrast, this discussion is about > > _public_ header files, ones installed with the purpose of letting > > other packages interface with the package whose header file is > > installed. > > I'll let you judge. > > > Stefan > > > % locate '*.h' | sed 's|[^/]*$||' | sort -u | grep -v 'monnier\|/usr/include' > /usr/lib/clisp-2.49.93+/base/ > /usr/lib/clisp-2.49.93+/linkkit/ > /usr/lib/gcc/x86_64-linux-gnu/10/include/ > /usr/lib/gcc/x86_64-linux-gnu/10/include/sanitizer/ > /usr/lib/gcc/x86_64-linux-gnu/12/include/ > /usr/lib/gcc/x86_64-linux-gnu/12/include/sanitizer/ > /usr/lib/ghc/ > /usr/lib/ghc/base-4.15.1.0/include/ > /usr/lib/ghc/bytestring-0.10.12.1/include/ > /usr/lib/ghc/ghc-9.0.2/include/ > /usr/lib/ghc/ghc-bignum-1.1/include/ > /usr/lib/ghc/include/ > /usr/lib/ghc/include/rts/ > /usr/lib/ghc/include/rts/prof/ > /usr/lib/ghc/include/rts/storage/ > /usr/lib/ghc/include/stg/ > /usr/lib/ghc/process-1.6.13.2/include/ > /usr/lib/ghc/time-1.9.3/include/ > /usr/lib/ghc/unix-2.7.2.2/include/ > /usr/lib/gprolog/include/ > /usr/lib/grub/i386-pc/ > /usr/lib/grub/x86_64-efi/ > /usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-9.0.2/primitive-0.7.3.0-EikPDi9CXNiB9f5MDJybeY/include/ > /usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-9.0.2/vector-0.12.3.1-TXkE6leK98EdYcmdk29JF/include/ > /usr/lib/jvm/java-17-openjdk-amd64/include/ > /usr/lib/jvm/java-17-openjdk-amd64/include/linux/ > /usr/lib/llvm-14/lib/clang/14.0.6/include/ > /usr/lib/llvm-14/lib/clang/14.0.6/include/openmp_wrappers/ > /usr/lib/llvm-14/lib/clang/14.0.6/include/ppc_wrappers/ > /usr/lib/llvm-14/lib/clang/14.0.6/include/xray/ > /usr/lib/ocaml/caml/ > /usr/lib/ocaml/zarith/ > /usr/lib/python3/dist-packages/dulwich/ > /usr/lib/python3/dist-packages/greenlet/ > /usr/lib/python3/dist-packages/greenlet/platform/ > /usr/lib/python3/dist-packages/lxml/ > /usr/lib/python3/dist-packages/lxml/includes/ > /usr/lib/swi-prolog/include/ > /usr/lib/swi-prolog/include/sicstus/ > /usr/lib/swi-prolog/include/Yap/ > /usr/lib/x86_64-linux-gnu/dbus-1.0/include/dbus/ > /usr/lib/x86_64-linux-gnu/glib-2.0/include/ > /usr/lib/x86_64-linux-gnu/perl/5.36.0/CORE/ > /usr/lib/x86_64-linux-gnu/perl5/5.36/B/Hooks/OP/Check/Install/ > /usr/lib/x86_64-linux-gnu/perl5/5.36/Cairo/Install/ > /usr/lib/x86_64-linux-gnu/perl5/5.36/Encode/ > /usr/lib/x86_64-linux-gnu/perl5/5.36/Glib/Install/ > /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/ > /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/m/ > /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/s/ > /usr/share/cmake-3.25/include/ > /usr/share/cmake-3.25/Modules/ > /usr/share/cups/ppdc/ > /usr/share/doc/bison/examples/c/mfcalc/ > /usr/share/doc/guile-3.0-dev/examples/compat/ > /usr/share/doc/libzstd-dev/examples/ > /usr/share/doc/nettle-dev/examples/ > /usr/share/doc/printer-driver-pnm2ppa/pl/ > /usr/share/doc/zlib1g-dev/examples/ > /usr/share/gettext/ > /usr/share/go-1.19/misc/cgo/life/testdata/ > /usr/share/go-1.19/misc/cgo/test/ > /usr/share/go-1.19/misc/cgo/testplugin/testdata/issue25756/plugin/ > /usr/share/go-1.19/misc/cgo/testsovar/testdata/ > /usr/share/go-1.19/misc/cgo/test/testdata/gcc68255/ > /usr/share/go-1.19/misc/cgo/test/testdata/issue20266/ > /usr/share/go-1.19/misc/cgo/test/testdata/issue26213/ > /usr/share/go-1.19/misc/cgo/test/testdata/issue27054/ > /usr/share/go-1.19/misc/swig/callback/ > /usr/share/go-1.19/pkg/include/ > /usr/share/go-1.19/src/crypto/internal/boring/ > /usr/share/go-1.19/src/debug/dwarf/testdata/ > /usr/share/go-1.19/src/debug/gosym/testdata/ > /usr/share/go-1.19/src/runtime/ > /usr/share/go-1.19/src/runtime/cgo/ > /usr/share/grub/ > /usr/share/libtool/ > /usr/share/libtool/libltdl/ > /usr/share/perl/5.36.0/Encode/ > /usr/share/smartmontools/ > /usr/src/libdvd-pkg/build/ > /usr/src/libdvd-pkg/build/msvc/ > /usr/src/libdvd-pkg/build/src/ > /usr/src/libdvd-pkg/build/src/dvdcss/ > /usr/src/linux-apfs-rw-0.3.0-1/ > /usr/src/linux-apfs-rw-0.3.0-1/lzfse/ > /var/lib/smartmontools/drivedb/ > % Those under /usr/lib are looked in by the relevant compilers (they are include directories private to those compilers, hard-coded into them when they are built). Those under /usr/share are private to the relevant packages, and are either examples or test suites (thus AFAIU unrelated to the issue at hand here). Those under /usr/src are what I mentioned: private headers needed to build a package. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-24 16:38 ` Eli Zaretskii @ 2024-12-24 20:39 ` Björn Bidar 0 siblings, 0 replies; 37+ messages in thread From: Björn Bidar @ 2024-12-24 20:39 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs Eli Zaretskii <eliz@gnu.org> writes: >> Date: Tue, 24 Dec 2024 10:30:41 -0500 >> From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> >> >> > Careful: the above might pick up header files private to source >> > distributions if you have them on your system (i.e., if you build >> > packages locally from sources). By contrast, this discussion is about >> > _public_ header files, ones installed with the purpose of letting >> > other packages interface with the package whose header file is >> > installed. >> >> I'll let you judge. >> >> >> Stefan >> >> >> % locate '*.h' | sed 's|[^/]*$||' | sort -u | grep -v 'monnier\|/usr/include' >> /usr/lib/clisp-2.49.93+/base/ >> /usr/lib/clisp-2.49.93+/linkkit/ >> /usr/lib/gcc/x86_64-linux-gnu/10/include/ >> /usr/lib/gcc/x86_64-linux-gnu/10/include/sanitizer/ >> /usr/lib/gcc/x86_64-linux-gnu/12/include/ >> /usr/lib/gcc/x86_64-linux-gnu/12/include/sanitizer/ >> /usr/lib/ghc/ >> /usr/lib/ghc/base-4.15.1.0/include/ >> /usr/lib/ghc/bytestring-0.10.12.1/include/ >> /usr/lib/ghc/ghc-9.0.2/include/ >> /usr/lib/ghc/ghc-bignum-1.1/include/ >> /usr/lib/ghc/include/ >> /usr/lib/ghc/include/rts/ >> /usr/lib/ghc/include/rts/prof/ >> /usr/lib/ghc/include/rts/storage/ >> /usr/lib/ghc/include/stg/ >> /usr/lib/ghc/process-1.6.13.2/include/ >> /usr/lib/ghc/time-1.9.3/include/ >> /usr/lib/ghc/unix-2.7.2.2/include/ >> /usr/lib/gprolog/include/ >> /usr/lib/grub/i386-pc/ >> /usr/lib/grub/x86_64-efi/ >> /usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-9.0.2/primitive-0.7.3.0-EikPDi9CXNiB9f5MDJybeY/include/ >> /usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-9.0.2/vector-0.12.3.1-TXkE6leK98EdYcmdk29JF/include/ >> /usr/lib/jvm/java-17-openjdk-amd64/include/ >> /usr/lib/jvm/java-17-openjdk-amd64/include/linux/ >> /usr/lib/llvm-14/lib/clang/14.0.6/include/ >> /usr/lib/llvm-14/lib/clang/14.0.6/include/openmp_wrappers/ >> /usr/lib/llvm-14/lib/clang/14.0.6/include/ppc_wrappers/ >> /usr/lib/llvm-14/lib/clang/14.0.6/include/xray/ >> /usr/lib/ocaml/caml/ >> /usr/lib/ocaml/zarith/ >> /usr/lib/python3/dist-packages/dulwich/ >> /usr/lib/python3/dist-packages/greenlet/ >> /usr/lib/python3/dist-packages/greenlet/platform/ >> /usr/lib/python3/dist-packages/lxml/ >> /usr/lib/python3/dist-packages/lxml/includes/ >> /usr/lib/swi-prolog/include/ >> /usr/lib/swi-prolog/include/sicstus/ >> /usr/lib/swi-prolog/include/Yap/ >> /usr/lib/x86_64-linux-gnu/dbus-1.0/include/dbus/ >> /usr/lib/x86_64-linux-gnu/glib-2.0/include/ >> /usr/lib/x86_64-linux-gnu/perl/5.36.0/CORE/ >> /usr/lib/x86_64-linux-gnu/perl5/5.36/B/Hooks/OP/Check/Install/ >> /usr/lib/x86_64-linux-gnu/perl5/5.36/Cairo/Install/ >> /usr/lib/x86_64-linux-gnu/perl5/5.36/Encode/ >> /usr/lib/x86_64-linux-gnu/perl5/5.36/Glib/Install/ >> /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/ >> /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/m/ >> /usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/s/ >> /usr/share/cmake-3.25/include/ >> /usr/share/cmake-3.25/Modules/ Those are cmake test headers. >> /usr/share/cups/ppdc/ >> /usr/share/doc/bison/examples/c/mfcalc/ >> /usr/share/doc/guile-3.0-dev/examples/compat/ >> /usr/share/doc/libzstd-dev/examples/ >> /usr/share/doc/nettle-dev/examples/ >> /usr/share/doc/printer-driver-pnm2ppa/pl/ >> /usr/share/doc/zlib1g-dev/examples/ >> /usr/share/gettext/ >> /usr/share/go-1.19/misc/cgo/life/testdata/ >> /usr/share/go-1.19/misc/cgo/test/ >> /usr/share/go-1.19/misc/cgo/testplugin/testdata/issue25756/plugin/ >> /usr/share/go-1.19/misc/cgo/testsovar/testdata/ >> /usr/share/go-1.19/misc/cgo/test/testdata/gcc68255/ >> /usr/share/go-1.19/misc/cgo/test/testdata/issue20266/ >> /usr/share/go-1.19/misc/cgo/test/testdata/issue26213/ >> /usr/share/go-1.19/misc/cgo/test/testdata/issue27054/ >> /usr/share/go-1.19/misc/swig/callback/ >> /usr/share/go-1.19/pkg/include/ >> /usr/share/go-1.19/src/crypto/internal/boring/ >> /usr/share/go-1.19/src/debug/dwarf/testdata/ >> /usr/share/go-1.19/src/debug/gosym/testdata/ >> /usr/share/go-1.19/src/runtime/ >> /usr/share/go-1.19/src/runtime/cgo/ >> /usr/share/grub/ >> /usr/share/libtool/ >> /usr/share/libtool/libltdl/ >> /usr/share/perl/5.36.0/Encode/ >> /usr/share/smartmontools/ >> /usr/src/libdvd-pkg/build/ >> /usr/src/libdvd-pkg/build/msvc/ >> /usr/src/libdvd-pkg/build/src/ >> /usr/src/libdvd-pkg/build/src/dvdcss/ >> /usr/src/linux-apfs-rw-0.3.0-1/ >> /usr/src/linux-apfs-rw-0.3.0-1/lzfse/ >> /var/lib/smartmontools/drivedb/ >> % > > Those under /usr/lib are looked in by the relevant compilers (they are > include directories private to those compilers, hard-coded into them > when they are built). Those under /usr/share are private to the > relevant packages, and are either examples or test suites (thus AFAIU > unrelated to the issue at hand here). Those under /usr/src are what I > mentioned: private headers needed to build a package. In addition some of them could be overlooked by distribution packagers ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-09 14:56 ` Eli Zaretskii 2024-12-09 15:50 ` Rudolf Schlatte 2024-12-09 22:10 ` Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-22 22:17 ` Arsen Arsenović 2 siblings, 0 replies; 37+ messages in thread From: Arsen Arsenović @ 2024-12-22 22:17 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 1532 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> From: Marco Antoniotti <marcoxa@gmail.com> >> Date: Mon, 9 Dec 2024 10:58:57 +0100 >> >> On my Mac, If I install emacs as a "formula" (i.e., not a s an app) things >> seem installed as they should be. OTOH the brew "cask" (which installs a >> .app in the Application directory) seems to create something that Apple >> likes, but that STILL may be told to have a pointer to the include >> directory as it does to the data-directory. >> >> This is obviously something that the brew folks should deal with, but the >> notion of having a variable that tracks the include directory still has >> merit. At least as an extra guideline to people like the brew maintainers. > > As I tried to explain, if emacs-module.h is not installed in its > intended place, we cannot know where it is installed. We only know > that from the default installation locations we have in our Makefiles, > but if some distros modify that, we cannot know. > > And I still contend that the correct installation should put this file > where all the other header files are, and then the compiler will > always find it. Users who don't want to fight the uphill battle > against brew could simply copy the file to the compiler's include > directory, and be done. Could I suggest installing a .pc file alongside Emacs that describes this also? That way, if distros modify it, they have a method of notifying consumers of the modification also. Have a lovely day. -- Arsen Arsenović [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 381 bytes --] ^ permalink raw reply [flat|nested] 37+ messages in thread
[parent not found: <mailman.81.1734714033.1948.help-gnu-emacs@gnu.org>]
* Re: Retrieving the "include" directory for Emacs Modules [not found] <mailman.81.1734714033.1948.help-gnu-emacs@gnu.org> @ 2024-12-21 20:04 ` Marco Antoniotti 2024-12-23 20:15 ` Björn Bidar [not found] ` <6769c4ea.170a0220.d60c5.1423SMTPIN_ADDED_BROKEN@mx.google.com> 0 siblings, 2 replies; 37+ messages in thread From: Marco Antoniotti @ 2024-12-21 20:04 UTC (permalink / raw) To: help-gnu-emacs On Fri, Dec 20, 2024 at 6:02 PM <help-gnu-emacs-request@gnu.org> wrote: > > Message: 2 > Date: Fri, 20 Dec 2024 10:41:08 -0500 > From: Stefan Monnier <monnier@iro.umontreal.ca> > To: Björn Bidar <bjorn.bidar@thaodan.de> > Cc: Stefan Monnier via Users list for the GNU Emacs text editor > <help-gnu-emacs@gnu.org> > Subject: Re: Retrieving the "include" directory for Emacs Modules > Message-ID: <jwvmsgqjrng.fsf-monnier+emacs@gnu.org> > Content-Type: text/plain > > >> That's OK: the sole purpose of the change is to let ELPA packages call > >> `gcc` with such a `-I`! > > Which is wrong for Unix-like systems except on macOS. > > In which sense would it be wrong? > I can see an argument that such a `-I` would tend to be redundant on > systems where Emacs was "installed properly", but even on those systems > I fail to see what would be "wrong" about it. > I obviously agree. I would also contend that "Emacs installed properly" should mean "installed according to the standards of the platform". Now, on Windows this means (usually) "C:/Program Files/Emacs/emacs-MM.mm/", with subdirs bin, include, lib. libexec and share. This is not so far-off UN*X; it is "standard" (as per Microsoft) and yet it is not what UN*X people, and, it appears, some Emacs people, would consider "proper". On Mac OS, https://emacsformacosx.com/ does a very good job of providing batteries-included Emacs. Its installation is, per Apple's ukazes, in /Applicatiions/Emacs.app/Contents/Resources. Note that this is a "simplified" Apple installation, but surely it is "proper" under Mac OS. Let me weigh in on another topic. I teach and I have students come in (second year CS) with all sorts of editors installed, Sublime, VSCode, Vim, Eclipse, Notepad, whatever; no one uses Emacs. First thing I do is to tell them to "install Emacs". Do you (Björn) think that, apart from the very hard core "I-already-know-Rust-and-C-sucks-because-I-recompiled-the-Linux-kernel-when-I-was-9-yo-on-my-Rasperry-pi" three or four guys (they are obviously male) the majority is going to "compile and install Emacs"? They go to https://emacsformacosx.com/ and to the https://www.gnu.org/software/emacs/download.html sites and download the installers. Or they use homebrew, snap or apt. Bottom line, if you want our beloved editor to be used, lighten up. (Yes, I am patronizing; sorry; I am a boomer: TOWANDA :) ). > It's debatable if packages should compile their native modules > > themselves > > IME it's what most users expect when they install (via `package.el`) > packages that come with a module, and it's also what most of the > developers of those packages want to offer to their users. > I have no intention to impose such an approach as the only supported way > to install a module, but I don't see what's debatable about providing > good support for packages to be able to compile their own modules. > Exactly. Two thumbs up! TRT is to make the system as "open" as possible, by playing ball with the platforms out there (at least Windows and Mac OS). People will find all sorts of ways to use the C compiler that they have at hand; and no, these days the C compiler is not necessarily gcc, and you should not assume it is. That is why you need to expose the "Emacs configuration"; which means, at a minimum, the 'include' directory for the header file(s) to build dynamic Emacs modules. Having a bunch of 'emacs-*' elisp variables/constants that can be queried would be very helpful (hint: data-directory could be aliased to emacs-data-directory). I know this should move to the development list. All the best Marco PS Sorry Stefan, the "you" in the answer is not you personally; I believe you are a French speaker, if you are, you know about 'tu' and 'vous' :) -- Marco Antoniotti Somewhere over the Rainbow ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-21 20:04 ` Marco Antoniotti @ 2024-12-23 20:15 ` Björn Bidar [not found] ` <6769c4ea.170a0220.d60c5.1423SMTPIN_ADDED_BROKEN@mx.google.com> 1 sibling, 0 replies; 37+ messages in thread From: Björn Bidar @ 2024-12-23 20:15 UTC (permalink / raw) To: Marco Antoniotti; +Cc: help-gnu-emacs Marco Antoniotti <marcoxa@gmail.com> writes: > On Fri, Dec 20, 2024 at 6:02 PM <help-gnu-emacs-request@gnu.org> wrote: > >> >> Message: 2 >> Date: Fri, 20 Dec 2024 10:41:08 -0500 >> From: Stefan Monnier <monnier@iro.umontreal.ca> >> To: Björn Bidar <bjorn.bidar@thaodan.de> >> Cc: Stefan Monnier via Users list for the GNU Emacs text editor >> <help-gnu-emacs@gnu.org> >> Subject: Re: Retrieving the "include" directory for Emacs Modules >> Message-ID: <jwvmsgqjrng.fsf-monnier+emacs@gnu.org> >> Content-Type: text/plain >> >> >> That's OK: the sole purpose of the change is to let ELPA packages call >> >> `gcc` with such a `-I`! >> > Which is wrong for Unix-like systems except on macOS. >> >> In which sense would it be wrong? >> I can see an argument that such a `-I` would tend to be redundant on >> systems where Emacs was "installed properly", but even on those systems >> I fail to see what would be "wrong" about it. >> > > I obviously agree. I would also contend that "Emacs installed properly" > should mean "installed according to the standards of the platform". The proposal was add the module header to datadir not "installed according to the standards of the platform". > Now, on Windows this means (usually) "C:/Program Files/Emacs/emacs-MM.mm/", > with subdirs bin, include, lib. libexec and share. > This is not so far-off UN*X; it is "standard" (as per Microsoft) and yet it > is not what UN*X people, and, it appears, some Emacs people, would consider > "proper". That's off-topic. > On Mac OS, https://emacsformacosx.com/ does a very good job of providing > batteries-included Emacs. Its installation is, per Apple's ukazes, in > /Applicatiions/Emacs.app/Contents/Resources. Note that this is a > "simplified" Apple installation, but surely it is "proper" under Mac OS. > > Let me weigh in on another topic. I teach and I have students come in > (second year CS) with all sorts of editors installed, Sublime, VSCode, Vim, > Eclipse, Notepad, whatever; no one uses Emacs. > > First thing I do is to tell them to "install Emacs". > > Do you (Björn) think that, apart from the very hard core > "I-already-know-Rust-and-C-sucks-because-I-recompiled-the-Linux-kernel-when-I-was-9-yo-on-my-Rasperry-pi" > three or four guys (they are obviously male) the majority is going to > "compile and install Emacs"? They go to https://emacsformacosx.com/ and to > the https://www.gnu.org/software/emacs/download.html sites and download the > installers. Or they use homebrew, snap or apt. Such language is out of place here or anywhere else.. Especially language which assumes gender stereotypes. > Bottom line, if you want our beloved editor to be used, lighten up. (Yes, > I am patronizing; sorry; I am a boomer: TOWANDA :) ). > >> It's debatable if packages should compile their native modules >> > themselves >> >> IME it's what most users expect when they install (via `package.el`) >> packages that come with a module, and it's also what most of the >> developers of those packages want to offer to their users. >> I have no intention to impose such an approach as the only supported way >> to install a module, but I don't see what's debatable about providing >> good support for packages to be able to compile their own modules. >> > > Exactly. Two thumbs up! TRT is to make the system as "open" as possible, > by playing ball with the platforms out there (at least Windows and Mac > OS). People will find all sorts of ways to use the C compiler that they > have at hand; and no, these days the C compiler is not necessarily gcc, and > you should not assume it is. Where GCC assumed somewhere besides writing GCC when CC was meant? These days it has shifted from assuming CC is GCC that CC is Clang in those projects that do mainly use Clang such as Chromium. Emacs requires libgccjit for native compilation in this context is could be very much assumed that CC is GCC. > That is why you need to expose the "Emacs configuration"; which means, at a > minimum, the 'include' directory for the header file(s) to build dynamic > Emacs modules. Having a bunch of 'emacs-*' elisp variables/constants that > can be queried would be very helpful (hint: data-directory could be aliased > to emacs-data-directory). I know this should move to the development list. At least for the compiler configuration should not be needed as CC is used on Unixi systems, on Windows that's an entirely different thing. There's no need to define a variable for the include directory if the include folder the header is in is installed into to the prefix directory of the Emacs installation i.e. /usr on most Unixes, in the NextStep build Emacs.app and on Windows In any case issues like could be resolved with something similar to XEmacs's elcc. ^ permalink raw reply [flat|nested] 37+ messages in thread
[parent not found: <6769c4ea.170a0220.d60c5.1423SMTPIN_ADDED_BROKEN@mx.google.com>]
* Re: Retrieving the "include" directory for Emacs Modules [not found] ` <6769c4ea.170a0220.d60c5.1423SMTPIN_ADDED_BROKEN@mx.google.com> @ 2024-12-23 20:56 ` Marco Antoniotti 2024-12-24 5:58 ` Stefan Monnier via Users list for the GNU Emacs text editor 0 siblings, 1 reply; 37+ messages in thread From: Marco Antoniotti @ 2024-12-23 20:56 UTC (permalink / raw) To: Björn Bidar; +Cc: help-gnu-emacs Hi, after having looked into XEmacs elcc, i'd say that it may work. Alas, that would mean to distribute and maintain a different tool. On Mon, Dec 23, 2024 at 9:15 PM Björn Bidar <bjorn.bidar@thaodan.de> wrote: Marco Antoniotti <marcoxa@gmail.com> writes: > > > On Fri, Dec 20, 2024 at 6:02 PM <help-gnu-emacs-request@gnu.org> wrote: > > > >> > >> Message: 2 > >> Date: Fri, 20 Dec 2024 10:41:08 -0500 > >> From: Stefan Monnier <monnier@iro.umontreal.ca> > >> To: Björn Bidar <bjorn.bidar@thaodan.de> > >> Cc: Stefan Monnier via Users list for the GNU Emacs text editor > >> <help-gnu-emacs@gnu.org> > >> Subject: Re: Retrieving the "include" directory for Emacs Modules > >> Message-ID: <jwvmsgqjrng.fsf-monnier+emacs@gnu.org> > >> Content-Type: text/plain > >> > >> >> That's OK: the sole purpose of the change is to let ELPA packages > call > >> >> `gcc` with such a `-I`! > >> > Which is wrong for Unix-like systems except on macOS. > >> > >> In which sense would it be wrong? > >> I can see an argument that such a `-I` would tend to be redundant on > >> systems where Emacs was "installed properly", but even on those systems > >> I fail to see what would be "wrong" about it. > >> > > > > I obviously agree. I would also contend that "Emacs installed properly" > > should mean "installed according to the standards of the platform". > > > The proposal was add the module header to datadir not "installed > according to the standards of the platform". > Nope. The proposal is to expose the Emacs installation 'include' directory in such a way that it is possible to ask a batch emacs where it is so that you can then use these values in your favorite build system. > > > Now, on Windows this means (usually) "C:/Program > Files/Emacs/emacs-MM.mm/", > > with subdirs bin, include, lib. libexec and share. > > This is not so far-off UN*X; it is "standard" (as per Microsoft) and yet > it > > is not what UN*X people, and, it appears, some Emacs people, would > consider > > "proper". > > That's off-topic. > It surely does not seem so, given the previous discussion. > > > On Mac OS, https://emacsformacosx.com/ does a very good job of providing > > batteries-included Emacs. Its installation is, per Apple's ukazes, in > > /Applicatiions/Emacs.app/Contents/Resources. Note that this is a > > "simplified" Apple installation, but surely it is "proper" under Mac OS. > > > > Let me weigh in on another topic. I teach and I have students come in > > (second year CS) with all sorts of editors installed, Sublime, VSCode, > Vim, > > Eclipse, Notepad, whatever; no one uses Emacs. > > > > First thing I do is to tell them to "install Emacs". > > > > Do you (Björn) think that, apart from the very hard core > > > "I-already-know-Rust-and-C-sucks-because-I-recompiled-the-Linux-kernel-when-I-was-9-yo-on-my-Rasperry-pi" > > three or four guys (they are obviously male) the majority is going to > > "compile and install Emacs"? They go to https://emacsformacosx.com/ > and to > > the https://www.gnu.org/software/emacs/download.html sites and download > the > > installers. Or they use homebrew, snap or apt. > > > Such language is out of place here or anywhere else.. Especially > language which assumes gender stereotypes. > Sorry. I tend to observe and use humor. If you have other data points with proper statistics (number of women who think that C sucks because they like Rust), I will update the jokes. > > Bottom line, if you want our beloved editor to be used, lighten up. > (Yes, > > I am patronizing; sorry; I am a boomer: TOWANDA :) ). > > > >> It's debatable if packages should compile their native modules > >> > themselves > >> > >> IME it's what most users expect when they install (via `package.el`) > >> packages that come with a module, and it's also what most of the > >> developers of those packages want to offer to their users. > >> I have no intention to impose such an approach as the only supported way > >> to install a module, but I don't see what's debatable about providing > >> good support for packages to be able to compile their own modules. > >> > > > > Exactly. Two thumbs up! TRT is to make the system as "open" as possible, > > by playing ball with the platforms out there (at least Windows and Mac > > OS). People will find all sorts of ways to use the C compiler that they > > have at hand; and no, these days the C compiler is not necessarily gcc, > and > > you should not assume it is. > > Where GCC assumed somewhere besides writing GCC when CC was meant? > These days it has shifted from assuming CC is GCC that CC is Clang in > those projects that do mainly use Clang such as Chromium. > Emacs requires libgccjit for native compilation in this context is could > be very much assumed that CC is GCC. > I just tested my emacs module compiling with the MSVS toolchain. Works like a charm, just like the clang setup on Mac OS; but I must hard code the Emacs 'include' directory, which I just happen to know where it is. > > > That is why you need to expose the "Emacs configuration"; which means, > at a > > minimum, the 'include' directory for the header file(s) to build dynamic > > Emacs modules. Having a bunch of 'emacs-*' elisp variables/constants > that > > can be queried would be very helpful (hint: data-directory could be > aliased > > to emacs-data-directory). I know this should move to the development > list. > > At least for the compiler configuration should not be needed as CC is > used on Unixi systems, on Windows that's an entirely different thing. > There's no need to define a variable for the include directory if the > include folder the header is in is installed into to the prefix directory > of the Emacs > installation i.e. /usr on most Unixes, in the NextStep build Emacs.app > and on Windows > That's exactly why we need to expose the location of the 'include', plus I believe the maintainer of https://emacsformacos.com/ has a different opinion. The whole point is that Emacs must be usable everywhere and that its use must be made as easy as possible, for the case at hand, module writers. Your argument is just "we must stick to unixi setups"; the counterargument is that exposing constants that tell a user how Emacs is installed on a given platform is not that big of a deal and gives leverage and freedom to emacs module writers, and probably to package writers as well. > > In any case issues like could be resolved with something similar to > XEmacs's elcc. > Maybe. Maybe not. Happy Holidays -- Marco Antoniotti Somewhere over the Rainbow ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-23 20:56 ` Marco Antoniotti @ 2024-12-24 5:58 ` Stefan Monnier via Users list for the GNU Emacs text editor 0 siblings, 0 replies; 37+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-24 5:58 UTC (permalink / raw) To: help-gnu-emacs > after having looked into XEmacs elcc, i'd say that it may work. Alas, that > would mean to distribute and maintain a different tool. Your ELPA package will need to find that `elcc` tool and that `elcc` tool will in turn need to find the header file. If Emacs was installed in a "Portable" style (e.g. a tarball untar'd at some arbitrary location), then those two steps will face the exact same problem we're discussing. Stefan ^ permalink raw reply [flat|nested] 37+ messages in thread
[parent not found: <mailman.87.1733936470.18564.help-gnu-emacs@gnu.org>]
* Re: Retrieving the "include" directory for Emacs Modules [not found] <mailman.87.1733936470.18564.help-gnu-emacs@gnu.org> @ 2024-12-13 11:43 ` Marco Antoniotti 2024-12-13 12:23 ` Eli Zaretskii 0 siblings, 1 reply; 37+ messages in thread From: Marco Antoniotti @ 2024-12-13 11:43 UTC (permalink / raw) To: help-gnu-emacs Hi Eli What would be a proper place? Marco On Wed, Dec 11, 2024 at 6:03 PM <help-gnu-emacs-request@gnu.org> wrote: > Send help-gnu-emacs mailing list submissions to > help-gnu-emacs@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/help-gnu-emacs > or, via email, send a message with subject or body 'help' to > help-gnu-emacs-request@gnu.org > > You can reach the person managing the list at > help-gnu-emacs-owner@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of help-gnu-emacs digest..." > > > Today's Topics: > > 1. Re: Retrieving the "include" directory for Emacs Modules > (Eli Zaretskii) > 2. Why does saving a buffer to a new file clear local variables? > (Patrick Nicodemus) > 3. Gnus: Permanently killing a thread? (Christopher Howard) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 11 Dec 2024 15:01:44 +0200 > From: Eli Zaretskii <eliz@gnu.org> > To: help-gnu-emacs@gnu.org > Subject: Re: Retrieving the "include" directory for Emacs Modules > Message-ID: <86bjxi4blz.fsf@gnu.org> > > > Date: Tue, 10 Dec 2024 22:23:05 -0500 > > From: Stefan Monnier via Users list for the GNU Emacs text editor < > help-gnu-emacs@gnu.org> > > > > >> > As I tried to explain, if emacs-module.h is not installed in its > > >> > intended place, we cannot know where it is installed. > > >> The patch below would make sure that `emacs-module.h` is always > > >> available at `$(data-directory)/include/emacs-module.h`. > > > Sorry, this is wrong. [...] this is a change that will break previous > > > (and correct) behavior. > > > > I don't see how it would break anything: the .h file is still *also* > > copied to the $(includedir) for those people who want to compile their > > module outside of Emacs. > > That makes this easier to accept, but there are still issues. > > > > No compiler will look in that directory without a suitable -I option, > > > > That's OK: the sole purpose of the change is to let ELPA packages call > > `gcc` with such a `-I`! > > Let's discuss this in a proper place, not here, okay? In particular, > I'd like to hear more opinions and data points, from people who don't > necessarily read this forum. > > > > ------------------------------ > > Message: 2 > Date: Tue, 10 Dec 2024 23:05:00 -0500 > From: Patrick Nicodemus <gadget142@gmail.com> > To: help-gnu-emacs@gnu.org > Subject: Why does saving a buffer to a new file clear local variables? > Message-ID: > <CADZEZBZbKRo7uHpqjOBTADhQcUG5U= > H+RuZOOwd7DRdtLE_s5A@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > If I create a new buffer like (get-buffer-create "tmpbuf"), > switch to the buffer, and execute the commands > (make-variable-buffer-local "abc") > (setq abc 3) > and then save the buffer to, say, "tmpbuf", then abc becomes nil. > Why is this the case? > Is this behavior documented anywhere? > I checked that it doesn't change the major mode. It is "Fundamental" before > and after saving. > > > ------------------------------ > > Message: 3 > Date: Wed, 11 Dec 2024 07:52:38 -0900 > From: Christopher Howard <christopher@librehacker.com> > To: Help Gnu Emacs Mailing List <help-gnu-emacs@gnu.org> > Subject: Gnus: Permanently killing a thread? > Message-ID: <87ldwmgo15.fsf@librehacker.com> > Content-Type: text/plain; charset=utf-8 > > Hi, in Gnus I frequently use gnus-summary-kill-same-subject (C-k) to kill > threads that are of no interest to me. However, when I am reading news the > next day, I have to deal again with new messages from that thread. I'm > wondering if I have a mechanism in Gnus to permanently hide a thread. > > In the manual, am seeing a lot of information about thread scoring, but > I'm not sure if/how that is something I can leverage toward this end. > > -- > 📛 Christopher Howard > 🚀 gemini://gem.librehacker.com > 🌐 http://gem.librehacker.com > > בראשית ברא אלהים את השמים ואת הארץ > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > https://lists.gnu.org/mailman/listinfo/help-gnu-emacs > > > ------------------------------ > > End of help-gnu-emacs Digest, Vol 265, Issue 49 > *********************************************** > -- Marco Antoniotti Somewhere over the Rainbow ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-13 11:43 ` Marco Antoniotti @ 2024-12-13 12:23 ` Eli Zaretskii 0 siblings, 0 replies; 37+ messages in thread From: Eli Zaretskii @ 2024-12-13 12:23 UTC (permalink / raw) To: help-gnu-emacs > From: Marco Antoniotti <marcoxa@gmail.com> > Date: Fri, 13 Dec 2024 12:43:03 +0100 > > Hi Eli > > What would be a proper place? emacs-devel@gnu.org ^ permalink raw reply [flat|nested] 37+ messages in thread
[parent not found: <mailman.606.1733669386.12711.help-gnu-emacs@gnu.org>]
* Re: Re: Retrieving the "include" directory for Emacs Modules [not found] <mailman.606.1733669386.12711.help-gnu-emacs@gnu.org> @ 2024-12-08 15:18 ` Marco Antoniotti 2024-12-08 15:29 ` Jean Louis 2024-12-08 16:30 ` Eli Zaretskii 0 siblings, 2 replies; 37+ messages in thread From: Marco Antoniotti @ 2024-12-08 15:18 UTC (permalink / raw) To: help-gnu-emacs Hi Eli sorry again: the behavior on Mac and Windows is different w.r.t. data-directory (see previous message). I can try on a Linux machine tomorrow. Note that I installed Emacs with brew on my Mac Case in point: if I try to install 'pq' from the package manager I get the following error. gcc -I/Users/marcoxa/.emacs.d/elpa/pq-0.2 -I -I/usr/share/emacs/29.4 -I/usr/local/include/postgresql@14 -std=gnu99 -ggdb3 -Wall -fPIC -c pq-core.c pq-core.c:19:10: fatal error: 'emacs-module.h' file not found 19 | #include <emacs-module.h> | ^~~~~~~~~~~~~~~~ 1 error generated. make: *** [pq-core.o] Error 1 which is not surprising as the include directory is not listed in the -I options. Of course, I can muck around and ensure that the C_INCLUDE_PATH has the right things in it, but the issue, as is, IMHO remains. Having said that, another reason for needing a reliable include-directory variable, is to query Emacs in batch mode (I know: iti is expensive), to run a build system outside Emacs for testing. All the best Marco On Sun, Dec 8, 2024 at 3:50 PM <help-gnu-emacs-request@gnu.org> wrote: > Send help-gnu-emacs mailing list submissions to > help-gnu-emacs@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/help-gnu-emacs > or, via email, send a message with subject or body 'help' to > help-gnu-emacs-request@gnu.org > > You can reach the person managing the list at > help-gnu-emacs-owner@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of help-gnu-emacs digest..." > > > Today's Topics: > > 1. Re: Retrieving the "include" directory for Emacs Modules > (Eli Zaretskii) > 2. Checking conditions unrelated to expression (Heime) > 3. Re: Checking conditions unrelated to expression (Thibaut Verron) > 4. Unicode and text editors (Heime) > 5. Re: Unicode and text editors (Jean Louis) > 6. Re: Unicode and text editors (Basile Starynkevitch) > 7. Re: Unicode and text editors (Heime) > 8. Re: Checking conditions unrelated to expression (Heime) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 08 Dec 2024 13:40:00 +0200 > From: Eli Zaretskii <eliz@gnu.org> > To: help-gnu-emacs@gnu.org > Subject: Re: Retrieving the "include" directory for Emacs Modules > Message-ID: <86seqyflnz.fsf@gnu.org> > > > From: Marco Antoniotti <marcoxa@gmail.com> > > Date: Sun, 8 Dec 2024 10:59:28 +0100 > > > > Sorry Eli > > > > your solution is not portable and it doesn't work on Mac and Windows > (29.2) > > > > On Mac the following works > > > > ELISP> (expand-file-name "../include" data-directory) > > "/Applications/Emacs.app/Contents/Resources/include" > > > > On Windows the include folder is "higher" up. > > "C:\Program Files\Emacs\emacs-29.2\include\" > > Sorry, I used too few "..". The correct way is > > (expand-file-name "../../../../include" data-directory) > > > Given that people (like me) are experimenting with emacs modules, I'd > lobby > > for the introduction of a 'include-direcotry' variable. > > I honestly don't understand why you need this at all. emacs-module.h > is supposed to be installed in the compilers include tree, where the > compiler looks for header files by default. So you shouldn't even > need to know where the header lives, in order to compile a module. > The module's code should just do > > #include <emacs-module.h> > > and that's it. Or what am I missing? > > > > ------------------------------ > > Message: 2 > Date: Sun, 08 Dec 2024 12:05:35 +0000 > From: Heime <heimeborgia@protonmail.com> > To: Heime via Users list for the GNU Emacs text editor > <help-gnu-emacs@gnu.org> > Subject: Checking conditions unrelated to expression > Message-ID: > > <vSFJsFKqJj6N1ZDie3BNU5VFGw2Qzcst66syykRK8mjUn0h8CnXjKVRrgmV_j7sh8keg-caCrU_YxwdujHhF6LYOTIgAZqA2lopakYfsiwI=@ > protonmail.com> > > Content-Type: text/plain; charset=utf-8 > > It looks like pcase can only be used with some variable condition > > This will check condition of featr > > (pcase featr > ('this (do-this)) > ('that (do-that)) > (_ (message "some message")) > > What if I want to check a number of conditions, not all dependent upon > featr, what should one do? > > Suppose I want to test (eq duck 'quack), cannot use a pcase because tests > are dependent upon featr. > > (pcase featr > ('this (do-this)) > ('that (do-that)) > (_ (message "some message")) > > > > > > > ------------------------------ > > Message: 3 > Date: Sun, 8 Dec 2024 13:31:01 +0100 > From: Thibaut Verron <thibaut.verron@gmail.com> > To: Heime <heimeborgia@protonmail.com> > Cc: Heime via Users list for the GNU Emacs text editor > <help-gnu-emacs@gnu.org> > Subject: Re: Checking conditions unrelated to expression > Message-ID: > <CAFsi02RoDZrEardmmuLJRqxXraBOLA= > RNQ46V8VQJr7uJf3xdA@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > Le dim. 8 déc. 2024 à 13:06, Heime via Users list for the GNU Emacs text > editor <help-gnu-emacs@gnu.org> a écrit : > > > It looks like pcase can only be used with some variable condition > > > > This will check condition of featr > > > > (pcase featr > > ('this (do-this)) > > ('that (do-that)) > > (_ (message "some message")) > > > > What if I want to check a number of conditions, not all dependent upon > > featr, what should one do? > > > > Suppose I want to test (eq duck 'quack), cannot use a pcase because tests > > are dependent upon featr. > > > > (pcase featr > > ('this (do-this)) > > ('that (do-that)) > > (_ (message "some message")) > > > > You can use a plain case-switch, rather than a pattern-matching one: > > (cond > ((eq featr 'this) (do-this)) > ((eq featr 'that) (do-that)) > ((eq duck 'quack) (do-duck)) > (t (message "blabla"))) > > https://www.gnu.org/s/emacs/manual/html_node/elisp/Conditionals.html > > You can also replace the first two cases by a pattern-matching case, if > you'd like: > > (cond > (pcase featr > ('this (do-this) t) ;; important to return non-nil in each branch > ('that (do-that) t) > (_ nil)) > ((eq duck 'quack) (do-duck)) > (t (message "blabla"))) > > > ------------------------------ > > Message: 4 > Date: Sun, 08 Dec 2024 13:16:40 +0000 > From: Heime <heimeborgia@protonmail.com> > To: Heime via Users list for the GNU Emacs text editor > <help-gnu-emacs@gnu.org> > Subject: Unicode and text editors > Message-ID: > > <nH6NYG-fnvnxkThmCS4DJ_k8YdfRu3QWxcezgZDFlw04v1VTAl9Okx3AV19GJznORt_PjYA2rqAyU4mnSNILeZdAir6kQF_CP5RMX8mcs-U=@ > protonmail.com> > > Content-Type: text/plain; charset=utf-8 > > > > I am using unicode characters in emacs. What happens when people load the > file in a different text editor? Will the characters be illegible? > > > > ------------------------------ > > Message: 5 > Date: Sun, 8 Dec 2024 16:29:41 +0300 > From: Jean Louis <bugs@gnu.support> > To: Heime <heimeborgia@protonmail.com> > Cc: Heime via Users list for the GNU Emacs text editor > <help-gnu-emacs@gnu.org> > Subject: Re: Unicode and text editors > Message-ID: <Z1WfRVgLAss9AmlJ@lco2> > Content-Type: text/plain; charset=utf-8 > > * Heime via Users list for the GNU Emacs text editor < > help-gnu-emacs@gnu.org> [2024-12-08 16:18]: > > > > > > I am using unicode characters in emacs. What happens when people load > the > > file in a different text editor? Will the characters be illegible? > > So far those editors I have inspected they accepted Unicode. > > Some editors in terminal, like Zile, Emacs clone, did not accept, I just > wish it could. > > All graphical editors I know so far accept Unicode. Some not, but are > older already, rarely used. > > -- > Jean Louis > > > > ------------------------------ > > Message: 6 > Date: Sun, 08 Dec 2024 14:31:52 +0100 > From: Basile Starynkevitch <basile@starynkevitch.net> > To: Heime <heimeborgia@protonmail.com>, Heime via Users list for the > GNU Emacs text editor <help-gnu-emacs@gnu.org> > Subject: Re: Unicode and text editors > Message-ID: > <2427ab10a48abba2c811bcb01f4e74ce3832794f.camel@starynkevitch.net> > Content-Type: text/plain; charset="UTF-8" > > On Sun, 2024-12-08 at 13:16 +0000, Heime via Users list for the GNU > Emacs text editor wrote: > > > > > > I am using unicode characters in emacs. What happens when people > > load the > > file in a different text editor? Will the characters be illegible? > > > > > I guess you mean Unicode characters with UTF-8 encoding. I will refer > to the people mentioned in your question as colleagues (but they could > be friends or customers or students or authorities or managers). Your > computer means the computer you are using (probably under Linux) for > GNU emacs. Their computer or the other computer is the one used by the > collague. > > I see several possible issues. > > The other computer don't have the required font to display some > character (like a cyrillic letter, or § ....) > > The other computer (or your colleague) don't know that the file is UTF- > 8 encoded. > > The other computer don't have any editor. > > the other computer has an editor which does not understand UTF-8 > encoding. > > The other computer has an editor requiring UTF-16 encoding. > > The file has been corrupted during transmission. > > Regards > > NB my open source project is > https://github.com/RefPerSys/RefPerSys (GPLv3+ inference engine) > > -- > Basile STARYNKEVITCH <basile@starynkevitch.net> > 8 rue de la Faïencerie > 92340 Bourg-la-Reine, France > http://starynkevitch.net/Basile & https://github.com/bstarynk > > > > ------------------------------ > > Message: 7 > Date: Sun, 08 Dec 2024 14:02:17 +0000 > From: Heime <heimeborgia@protonmail.com> > To: Basile Starynkevitch <basile@starynkevitch.net> > Cc: Heime via Users list for the GNU Emacs text editor > <help-gnu-emacs@gnu.org> > Subject: Re: Unicode and text editors > Message-ID: > > <z9SMaPjhd1MYl-O-VeHnIoH-VhBnPrpIftjSfb4G4WfrVLNAt1S_ONyxly9qqlf5IIuXpeAxBz2-sQgeTc6dSCiM6EYSWRC1aQSCn5D1DV8=@ > protonmail.com> > > Content-Type: text/plain; charset=utf-8 > > > > > > > Sent with Proton Mail secure email. > > On Monday, December 9th, 2024 at 1:31 AM, Basile Starynkevitch < > basile@starynkevitch.net> wrote: > > > On Sun, 2024-12-08 at 13:16 +0000, Heime via Users list for the GNU > > Emacs text editor wrote: > > > > > I am using unicode characters in emacs. What happens when people > > > load the > > > file in a different text editor? Will the characters be illegible? > > > > > > > > I guess you mean Unicode characters with UTF-8 encoding. > > Correct > > > I will refer > > to the people mentioned in your question as colleagues (but they could > > be friends or customers or students or authorities or managers). Your > > computer means the computer you are using (probably under Linux) for > > GNU emacs. Their computer or the other computer is the one used by the > > collague. > > > > I see several possible issues. > > > > The other computer don't have the required font to display some > > character (like a cyrillic letter, or § ....) > > > > The other computer (or your colleague) don't know that the file is UTF- > > 8 encoded. > > > > The other computer don't have any editor. > > > > the other computer has an editor which does not understand UTF-8 > > encoding. > > > > The other computer has an editor requiring UTF-16 encoding. > > Is this becoming the norm? What about emacs? > > Does emacs encourage use of unicode characters (UTF-8) in code comments > and documentation? > > > The file has been corrupted during transmission. > > > > Regards > > > > NB my open source project is > > https://github.com/RefPerSys/RefPerSys (GPLv3+ inference engine) > > > > -- > > Basile STARYNKEVITCH basile@starynkevitch.net > > > > 8 rue de la Faïencerie > > 92340 Bourg-la-Reine, France > > http://starynkevitch.net/Basile & https://github.com/bstarynk > > > > ------------------------------ > > Message: 8 > Date: Sun, 08 Dec 2024 14:49:34 +0000 > From: Heime <heimeborgia@protonmail.com> > To: thibaut.verron@gmail.com > Cc: Heime via Users list for the GNU Emacs text editor > <help-gnu-emacs@gnu.org> > Subject: Re: Checking conditions unrelated to expression > Message-ID: > > <UTDyRbxHqrNoXGWfAGt7UBstb51wLVipwk6VV-PGNMc02eax62Tj3eE8zcOCvUoRcM1PVKRXxx90U-sdkkN3cfiHHGYagAiIg9jCKYIlOgQ=@ > protonmail.com> > > Content-Type: text/plain; charset=utf-8 > > > > > > > Sent with Proton Mail secure email. > > On Monday, December 9th, 2024 at 12:31 AM, Thibaut Verron < > thibaut.verron@gmail.com> wrote: > > > Le dim. 8 déc. 2024 à 13:06, Heime via Users list for the GNU Emacs text > > editor help-gnu-emacs@gnu.org a écrit : > > > > > It looks like pcase can only be used with some variable condition > > > > > > This will check condition of featr > > > > > > (pcase featr > > > ('this (do-this)) > > > ('that (do-that)) > > > (_ (message "some message")) > > > > > > What if I want to check a number of conditions, not all dependent upon > > > featr, what should one do? > > > > > > Suppose I want to test (eq duck 'quack), cannot use a pcase because > tests > > > are dependent upon featr. > > > > > > (pcase featr > > > ('this (do-this)) > > > ('that (do-that)) > > > (_ (message "some message")) > > > > > > You can use a plain case-switch, rather than a pattern-matching one: > > > > (cond > > ((eq featr 'this) (do-this)) > > ((eq featr 'that) (do-that)) > > ((eq duck 'quack) (do-duck)) > > (t (message "blabla"))) > > > > https://www.gnu.org/s/emacs/manual/html_node/elisp/Conditionals.html > > > > You can also replace the first two cases by a pattern-matching case, if > > you'd like: > > > > (cond > > (pcase featr > > ('this (do-this) t) ;; important to return non-nil in each branch > > ('that (do-that) t) > > (_ nil)) > > ((eq duck 'quack) (do-duck)) > > (t (message "blabla"))) > > > But I cannot do the other way round, right? Cannot have a pcase using > featr > as EXP, but checking something else. > > > > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > https://lists.gnu.org/mailman/listinfo/help-gnu-emacs > > > ------------------------------ > > End of help-gnu-emacs Digest, Vol 265, Issue 36 > *********************************************** > -- Marco Antoniotti Somewhere over the Rainbow ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 15:18 ` Marco Antoniotti @ 2024-12-08 15:29 ` Jean Louis 2024-12-08 15:36 ` Marco Antoniotti 2024-12-08 16:30 ` Eli Zaretskii 1 sibling, 1 reply; 37+ messages in thread From: Jean Louis @ 2024-12-08 15:29 UTC (permalink / raw) To: Marco Antoniotti; +Cc: help-gnu-emacs * Marco Antoniotti <marcoxa@gmail.com> [2024-12-08 18:20]: > Hi Eli > > sorry again: the behavior on Mac and Windows is different w.r.t. > data-directory (see previous message). I can try on a Linux machine > tomorrow. Note that I installed Emacs with brew on my Mac > > Case in point: if I try to install 'pq' from the package manager I get the > following error. I am using emacs-libpq and I have changed: EMACS_INCLUDE_DIR := /home/data1/protected/Programming/Software/emacs/src EMACS_SRC_DIR := /home/data1/protected/Programming/Software/emacs/src in Makefile to get it compiled EMACS = emacs EMACS_VERSION := $(shell $(EMACS) -q --batch --eval "(princ emacs-version)") EMACS_MAJOR_VERSION := $(shell $(EMACS) -q --batch --eval "(princ emacs-major-version)") EMACS_INCLUDE_DIR := /home/data1/protected/Programming/Software/emacs/src EMACS_SRC_DIR := /home/data1/protected/Programming/Software/emacs/src Module works great, no complains. -- Jean Louis ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 15:29 ` Jean Louis @ 2024-12-08 15:36 ` Marco Antoniotti 2024-12-08 15:50 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-08 16:36 ` Eli Zaretskii 0 siblings, 2 replies; 37+ messages in thread From: Marco Antoniotti @ 2024-12-08 15:36 UTC (permalink / raw) To: Marco Antoniotti, help-gnu-emacs Hi I have no qualms about being able to "fix" 'pq' to make it work. But I am writing an Emacs Module and I do not want to force anybody to "fix" my setup ("It works on my machine" (tm)) In other words, I would like to be able to write EMACS_INCLUDE_DIR := $(shell $(EMACS) -q --batch --eval "(princ *em-include-directory*)") EMACS_SRC_DIR := $(shell $(EMACS) -q --batch --eval "(princ *em-scr-directory*)") All the best MA On Sun, Dec 8, 2024 at 4:29 PM Jean Louis <bugs@gnu.support> wrote: > * Marco Antoniotti <marcoxa@gmail.com> [2024-12-08 18:20]: > > Hi Eli > > > > sorry again: the behavior on Mac and Windows is different w.r.t. > > data-directory (see previous message). I can try on a Linux machine > > tomorrow. Note that I installed Emacs with brew on my Mac > > > > Case in point: if I try to install 'pq' from the package manager I get > the > > following error. > > I am using emacs-libpq and I have changed: > > EMACS_INCLUDE_DIR := /home/data1/protected/Programming/Software/emacs/src > EMACS_SRC_DIR := /home/data1/protected/Programming/Software/emacs/src > > in Makefile to get it compiled > > EMACS = emacs > EMACS_VERSION := $(shell $(EMACS) -q --batch --eval "(princ > emacs-version)") > EMACS_MAJOR_VERSION := $(shell $(EMACS) -q --batch --eval "(princ > emacs-major-version)") > EMACS_INCLUDE_DIR := /home/data1/protected/Programming/Software/emacs/src > EMACS_SRC_DIR := /home/data1/protected/Programming/Software/emacs/src > > Module works great, no complains. > > -- > Jean Louis > -- Marco Antoniotti Somewhere over the Rainbow ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 15:36 ` Marco Antoniotti @ 2024-12-08 15:50 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-08 16:36 ` Eli Zaretskii 1 sibling, 0 replies; 37+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-08 15:50 UTC (permalink / raw) To: help-gnu-emacs > EMACS_INCLUDE_DIR := $(shell $(EMACS) -q --batch --eval "(princ > *em-include-directory*)") > EMACS_SRC_DIR := $(shell $(EMACS) -q --batch --eval "(princ > *em-scr-directory*)") FWIW, when compiled from within Emacs, you'd be better served with something like: (call-process "make" nil nil nil (concat "EMACS_INCLUDE_DIR=" em-include-directory)) - Stefan ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 15:36 ` Marco Antoniotti 2024-12-08 15:50 ` Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-08 16:36 ` Eli Zaretskii 1 sibling, 0 replies; 37+ messages in thread From: Eli Zaretskii @ 2024-12-08 16:36 UTC (permalink / raw) To: help-gnu-emacs > From: Marco Antoniotti <marcoxa@gmail.com> > Date: Sun, 8 Dec 2024 16:36:09 +0100 > > I have no qualms about being able to "fix" 'pq' to make it work. > > But I am writing an Emacs Module and I do not want to force anybody to > "fix" my setup ("It works on my machine" (tm)) > > In other words, I would like to be able to write > > EMACS_INCLUDE_DIR := $(shell $(EMACS) -q --batch --eval "(princ > *em-include-directory*)") > EMACS_SRC_DIR := $(shell $(EMACS) -q --batch --eval "(princ > *em-scr-directory*)") Once again: if your Emacs is installed correctly, emacs-module.h should be in a directory where the C compiler looks by default for its header files. No -I command-line options should be needed. Just make sure to put emacs-module.h where you have stdio.h and other standard headers. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 15:18 ` Marco Antoniotti 2024-12-08 15:29 ` Jean Louis @ 2024-12-08 16:30 ` Eli Zaretskii 1 sibling, 0 replies; 37+ messages in thread From: Eli Zaretskii @ 2024-12-08 16:30 UTC (permalink / raw) To: help-gnu-emacs > From: Marco Antoniotti <marcoxa@gmail.com> > Date: Sun, 8 Dec 2024 16:18:15 +0100 > > sorry again: the behavior on Mac and Windows is different w.r.t. > data-directory (see previous message). I can try on a Linux machine > tomorrow. Note that I installed Emacs with brew on my Mac > > Case in point: if I try to install 'pq' from the package manager I get the > following error. > > gcc -I/Users/marcoxa/.emacs.d/elpa/pq-0.2 -I -I/usr/share/emacs/29.4 > -I/usr/local/include/postgresql@14 -std=gnu99 -ggdb3 -Wall -fPIC -c > pq-core.c > > pq-core.c:19:10: fatal error: 'emacs-module.h' file not found > 19 | #include <emacs-module.h> > | ^~~~~~~~~~~~~~~~ > 1 error generated. > make: *** [pq-core.o] Error 1 > > which is not surprising as the include directory is not listed in the -I > options. It shouldn't be: if the compiler cannot find emacs-module.h, then your Emacs is installed incorrectly. The installation should put emacs-module.h where the compiler looks for include files. > Of course, I can muck around and ensure that the C_INCLUDE_PATH has the > right things in it, but the issue, as is, IMHO remains. You shouldn't need to mess with C_INCLUDE_PATH, because emacs-module.h is supposed to be in the C include path to begin with. > Having said that, another reason for needing a reliable > include-directory variable, > is to query Emacs in batch mode (I know: iti is expensive), to run a build > system outside Emacs for testing. Sorry, I don't understand that: what do you mean by "to run a build system"? ^ permalink raw reply [flat|nested] 37+ messages in thread
[parent not found: <mailman.77.1733590872.28947.help-gnu-emacs@gnu.org>]
* Re: Re: Retrieving the "include" directory for Emacs Modules [not found] <mailman.77.1733590872.28947.help-gnu-emacs@gnu.org> @ 2024-12-08 9:59 ` Marco Antoniotti 2024-12-08 11:40 ` Eli Zaretskii 0 siblings, 1 reply; 37+ messages in thread From: Marco Antoniotti @ 2024-12-08 9:59 UTC (permalink / raw) To: help-gnu-emacs Sorry Eli your solution is not portable and it doesn't work on Mac and Windows (29.2) On Mac the following works ELISP> (expand-file-name "../include" data-directory) "/Applications/Emacs.app/Contents/Resources/include" On Windows the include folder is "higher" up. "C:\Program Files\Emacs\emacs-29.2\include\" Given that people (like me) are experimenting with emacs modules, I'd lobby for the introduction of a 'include-direcotry' variable. All the best Marco On Sat, Dec 7, 2024 at 6:02 PM <help-gnu-emacs-request@gnu.org> wrote: > Send help-gnu-emacs mailing list submissions to > help-gnu-emacs@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/help-gnu-emacs > or, via email, send a message with subject or body 'help' to > help-gnu-emacs-request@gnu.org > > You can reach the person managing the list at > help-gnu-emacs-owner@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of help-gnu-emacs digest..." > > > Today's Topics: > > 1. Retrieving the "include" directory for Emacs Modules > (Marco Antoniotti) > 2. Re: Retrieving the "include" directory for Emacs Modules > (Eli Zaretskii) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 7 Dec 2024 17:27:16 +0100 > From: Marco Antoniotti <marcoxa@gmail.com> > To: help-gnu-emacs@gnu.org > Subject: Retrieving the "include" directory for Emacs Modules > Message-ID: > <CAKmY7cVprXCPm6kibaCoBjWutcW2QMmRQCL= > qcARJ9Bp+1Djrg@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > Hi > > To compile Emacs C modules we need the proper 'include' directory. I.e., > we need to stick that information into Makefiles. > > We do have lisp-directory (and we can surmise the location of the include > directory from it), but it would be nice to have something like > em-include-directory (the em- prefix for "Emacs Module"). > > Meanwhile, any idea about how to make this somewhat portable? > > Any idea? > > -- > Marco Antoniotti > Somewhere over the Rainbow > > > ------------------------------ > > Message: 2 > Date: Sat, 07 Dec 2024 18:43:19 +0200 > From: Eli Zaretskii <eliz@gnu.org> > To: help-gnu-emacs@gnu.org > Subject: Re: Retrieving the "include" directory for Emacs Modules > Message-ID: <86zfl7h2ag.fsf@gnu.org> > > > From: Marco Antoniotti <marcoxa@gmail.com> > > Date: Sat, 7 Dec 2024 17:27:16 +0100 > > > > To compile Emacs C modules we need the proper 'include' directory. I.e., > > we need to stick that information into Makefiles. > > > > We do have lisp-directory (and we can surmise the location of the include > > directory from it), but it would be nice to have something like > > em-include-directory (the em- prefix for "Emacs Module"). > > Isn't that > > (expand-file-name "../../../include" data-directory) > > ? > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > https://lists.gnu.org/mailman/listinfo/help-gnu-emacs > > > ------------------------------ > > End of help-gnu-emacs Digest, Vol 265, Issue 33 > *********************************************** > -- Marco Antoniotti Somewhere over the Rainbow ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 9:59 ` Marco Antoniotti @ 2024-12-08 11:40 ` Eli Zaretskii 2024-12-08 15:47 ` Stefan Monnier via Users list for the GNU Emacs text editor 0 siblings, 1 reply; 37+ messages in thread From: Eli Zaretskii @ 2024-12-08 11:40 UTC (permalink / raw) To: help-gnu-emacs > From: Marco Antoniotti <marcoxa@gmail.com> > Date: Sun, 8 Dec 2024 10:59:28 +0100 > > Sorry Eli > > your solution is not portable and it doesn't work on Mac and Windows (29.2) > > On Mac the following works > > ELISP> (expand-file-name "../include" data-directory) > "/Applications/Emacs.app/Contents/Resources/include" > > On Windows the include folder is "higher" up. > "C:\Program Files\Emacs\emacs-29.2\include\" Sorry, I used too few "..". The correct way is (expand-file-name "../../../../include" data-directory) > Given that people (like me) are experimenting with emacs modules, I'd lobby > for the introduction of a 'include-direcotry' variable. I honestly don't understand why you need this at all. emacs-module.h is supposed to be installed in the compilers include tree, where the compiler looks for header files by default. So you shouldn't even need to know where the header lives, in order to compile a module. The module's code should just do #include <emacs-module.h> and that's it. Or what am I missing? ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 11:40 ` Eli Zaretskii @ 2024-12-08 15:47 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-08 16:39 ` Eli Zaretskii 0 siblings, 1 reply; 37+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-08 15:47 UTC (permalink / raw) To: help-gnu-emacs > I honestly don't understand why you need this at all. emacs-module.h > is supposed to be installed in the compilers include tree, where the > compiler looks for header files by default. So you shouldn't even > need to know where the header lives, in order to compile a module. > The module's code should just do > > #include <emacs-module.h> > > and that's it. Or what am I missing? That presumes that Emacs is installed system-wide (and "properly"). When the compilation of the module is initiated from within Emacs, it would make a lot of sense for this "ambient" Emacs to be able to tell `make/gcc/younameit` explicitly and reliably where its own `emacs-module.h` can be found. Stefan ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 15:47 ` Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-08 16:39 ` Eli Zaretskii 2024-12-08 16:48 ` Stefan Monnier via Users list for the GNU Emacs text editor 0 siblings, 1 reply; 37+ messages in thread From: Eli Zaretskii @ 2024-12-08 16:39 UTC (permalink / raw) To: help-gnu-emacs > Date: Sun, 08 Dec 2024 10:47:54 -0500 > From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> > > > I honestly don't understand why you need this at all. emacs-module.h > > is supposed to be installed in the compilers include tree, where the > > compiler looks for header files by default. So you shouldn't even > > need to know where the header lives, in order to compile a module. > > The module's code should just do > > > > #include <emacs-module.h> > > > > and that's it. Or what am I missing? > > That presumes that Emacs is installed system-wide (and "properly"). What other way is there to install Emacs? > When the compilation of the module is initiated from within Emacs, it > would make a lot of sense for this "ambient" Emacs to be able to tell > `make/gcc/younameit` explicitly and reliably where its own > `emacs-module.h` can be found. But if Emacs is "not installed properly", we don't know that. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 16:39 ` Eli Zaretskii @ 2024-12-08 16:48 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-08 17:46 ` Eli Zaretskii 0 siblings, 1 reply; 37+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-08 16:48 UTC (permalink / raw) To: help-gnu-emacs >> > I honestly don't understand why you need this at all. emacs-module.h >> > is supposed to be installed in the compilers include tree, where the >> > compiler looks for header files by default. So you shouldn't even >> > need to know where the header lives, in order to compile a module. >> > The module's code should just do >> > >> > #include <emacs-module.h> >> > >> > and that's it. Or what am I missing? >> >> That presumes that Emacs is installed system-wide (and "properly"). > > What other way is there to install Emacs? Compile manually and run from the build tree? Uncompress a downloaded pre-compiled archive into a directory and just use it from there (AFAIK, very common under macOS and Windows)? With luck on some systems the C (or other) compiler is installed in a similar way (i.e. in its own subdirectory, siloed from Emacs). >> When the compilation of the module is initiated from within Emacs, it >> would make a lot of sense for this "ambient" Emacs to be able to tell >> `make/gcc/younameit` explicitly and reliably where its own >> `emacs-module.h` can be found. > But if Emacs is "not installed properly", we don't know that. Emacs *should* know that, just like it knows where is its `lisp-directory`. Stefan ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 16:48 ` Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-08 17:46 ` Eli Zaretskii 2024-12-09 14:11 ` Stefan Monnier via Users list for the GNU Emacs text editor 0 siblings, 1 reply; 37+ messages in thread From: Eli Zaretskii @ 2024-12-08 17:46 UTC (permalink / raw) To: help-gnu-emacs > Date: Sun, 08 Dec 2024 11:48:24 -0500 > From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> > > >> > #include <emacs-module.h> > >> > > >> > and that's it. Or what am I missing? > >> > >> That presumes that Emacs is installed system-wide (and "properly"). > > > > What other way is there to install Emacs? > > Compile manually and run from the build tree? That's called "run uninstalled". And in that case, the user who does that knows very well where the header lives: in the same directory from which he/she runs Emacs. > Uncompress a downloaded pre-compiled archive into a directory and just > use it from there (AFAIK, very common under macOS and Windows)? If that doesn't place emacs-module.h in the system-wide include directory, it is a broken installation. > With luck on some systems the C (or other) compiler is installed in > a similar way (i.e. in its own subdirectory, siloed from Emacs). That's not how multi-package installation should be organized if the user wants the packages to cooperate. > >> When the compilation of the module is initiated from within Emacs, it > >> would make a lot of sense for this "ambient" Emacs to be able to tell > >> `make/gcc/younameit` explicitly and reliably where its own > >> `emacs-module.h` can be found. > > But if Emacs is "not installed properly", we don't know that. > > Emacs *should* know that, just like it knows where is its > `lisp-directory`. That's impractical expectation. Recall how hard we worked to find the pdumper file and the preloaded *.eln files, what with all the tricks people use when installing Emacs. I'm not interested in adding another burden to our maintenance so that Emacs will paper over broken installations. Sorry. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-08 17:46 ` Eli Zaretskii @ 2024-12-09 14:11 ` Stefan Monnier via Users list for the GNU Emacs text editor 0 siblings, 0 replies; 37+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-09 14:11 UTC (permalink / raw) To: help-gnu-emacs >> Compile manually and run from the build tree? > That's called "run uninstalled". And in that case, the user who does > that knows very well where the header lives: in the same directory > from which he/she runs Emacs. Why would they know that? I mean, of course, some will, but many people compile their own Emacs just to live on the bleeding edge and may never really look at the C code. [ Personally, I knew that *an* `emacs-module.h` file lived in there, but I wasn't 100% sure it's the right one to use (I expected there might be another one in some other directory). ] >> Uncompress a downloaded pre-compiled archive into a directory and just >> use it from there (AFAIK, very common under macOS and Windows)? > If that doesn't place emacs-module.h in the system-wide include > directory, it is a broken installation. If the user doesn't have administrator rights, then the installation can't really be blamed for not adding itself to a system-wide include directory. >> Emacs *should* know that, just like it knows where is its >> `lisp-directory`. > That's impractical expectation. We decide where the .h file is put, so it's really not. > Recall how hard we worked to find the pdumper file and the preloaded > *.eln files, what with all the tricks people use when > installing Emacs. Yup. And we don't need anything *more*. We just need to place the include file at a place that's easy to find once we know the rest. E.g. it could be `$(data-directory)/module-include`. > I'm not interested in adding another burden to our maintenance so that > Emacs will paper over broken installations. The system-wide install may have an older version of Emacs than the one from which we want to compile a module. It's good that we expose `emacs-module.h` system-wide, but I think it's even more important for Emacs to be able to compile its own modules without having to rely on that. Stefan ^ permalink raw reply [flat|nested] 37+ messages in thread
* Retrieving the "include" directory for Emacs Modules @ 2024-12-07 16:27 Marco Antoniotti 2024-12-07 16:43 ` Eli Zaretskii 2024-12-07 19:09 ` Björn Bidar 0 siblings, 2 replies; 37+ messages in thread From: Marco Antoniotti @ 2024-12-07 16:27 UTC (permalink / raw) To: help-gnu-emacs Hi To compile Emacs C modules we need the proper 'include' directory. I.e., we need to stick that information into Makefiles. We do have lisp-directory (and we can surmise the location of the include directory from it), but it would be nice to have something like em-include-directory (the em- prefix for "Emacs Module"). Meanwhile, any idea about how to make this somewhat portable? Any idea? -- Marco Antoniotti Somewhere over the Rainbow ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-07 16:27 Marco Antoniotti @ 2024-12-07 16:43 ` Eli Zaretskii 2024-12-07 19:09 ` Björn Bidar 1 sibling, 0 replies; 37+ messages in thread From: Eli Zaretskii @ 2024-12-07 16:43 UTC (permalink / raw) To: help-gnu-emacs > From: Marco Antoniotti <marcoxa@gmail.com> > Date: Sat, 7 Dec 2024 17:27:16 +0100 > > To compile Emacs C modules we need the proper 'include' directory. I.e., > we need to stick that information into Makefiles. > > We do have lisp-directory (and we can surmise the location of the include > directory from it), but it would be nice to have something like > em-include-directory (the em- prefix for "Emacs Module"). Isn't that (expand-file-name "../../../include" data-directory) ? ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Retrieving the "include" directory for Emacs Modules 2024-12-07 16:27 Marco Antoniotti 2024-12-07 16:43 ` Eli Zaretskii @ 2024-12-07 19:09 ` Björn Bidar 1 sibling, 0 replies; 37+ messages in thread From: Björn Bidar @ 2024-12-07 19:09 UTC (permalink / raw) To: Marco Antoniotti; +Cc: help-gnu-emacs Marco Antoniotti <marcoxa@gmail.com> writes: > Hi > > To compile Emacs C modules we need the proper 'include' directory. I.e., > we need to stick that information into Makefiles. > > We do have lisp-directory (and we can surmise the location of the include > directory from it), but it would be nice to have something like > em-include-directory (the em- prefix for "Emacs Module"). > > Meanwhile, any idea about how to make this somewhat portable? You mean in the makefile or in lisp? If it's in the makefile you should find out the directory the makefile is in and then go from there. E.g.: MAKEFILEDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) CFLAGS += -I$(MAKEFILEDIR)/include ^ permalink raw reply [flat|nested] 37+ messages in thread
end of thread, other threads:[~2024-12-24 20:39 UTC | newest] Thread overview: 37+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <mailman.624.1733687129.13738.help-gnu-emacs@gnu.org> 2024-12-09 9:58 ` Retrieving the "include" directory for Emacs Modules Marco Antoniotti 2024-12-09 14:56 ` Eli Zaretskii 2024-12-09 15:50 ` Rudolf Schlatte 2024-12-09 22:10 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-10 3:29 ` Eli Zaretskii 2024-12-11 3:23 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-11 13:01 ` Eli Zaretskii 2024-12-19 23:50 ` Björn Bidar [not found] ` <87ttazmdvc.fsf@> 2024-12-20 7:09 ` Eli Zaretskii 2024-12-20 9:01 ` Basile Starynkevitch 2024-12-23 0:47 ` Björn Bidar 2024-12-20 15:41 ` Stefan Monnier 2024-12-23 1:00 ` Björn Bidar [not found] ` <871pxzxlfe.fsf@> 2024-12-24 5:06 ` Stefan Monnier 2024-12-24 12:36 ` Eli Zaretskii 2024-12-24 15:30 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-24 16:38 ` Eli Zaretskii 2024-12-24 20:39 ` Björn Bidar 2024-12-22 22:17 ` Arsen Arsenović [not found] <mailman.81.1734714033.1948.help-gnu-emacs@gnu.org> 2024-12-21 20:04 ` Marco Antoniotti 2024-12-23 20:15 ` Björn Bidar [not found] ` <6769c4ea.170a0220.d60c5.1423SMTPIN_ADDED_BROKEN@mx.google.com> 2024-12-23 20:56 ` Marco Antoniotti 2024-12-24 5:58 ` Stefan Monnier via Users list for the GNU Emacs text editor [not found] <mailman.87.1733936470.18564.help-gnu-emacs@gnu.org> 2024-12-13 11:43 ` Marco Antoniotti 2024-12-13 12:23 ` Eli Zaretskii [not found] <mailman.606.1733669386.12711.help-gnu-emacs@gnu.org> 2024-12-08 15:18 ` Marco Antoniotti 2024-12-08 15:29 ` Jean Louis 2024-12-08 15:36 ` Marco Antoniotti 2024-12-08 15:50 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-08 16:36 ` Eli Zaretskii 2024-12-08 16:30 ` Eli Zaretskii [not found] <mailman.77.1733590872.28947.help-gnu-emacs@gnu.org> 2024-12-08 9:59 ` Marco Antoniotti 2024-12-08 11:40 ` Eli Zaretskii 2024-12-08 15:47 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-08 16:39 ` Eli Zaretskii 2024-12-08 16:48 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-08 17:46 ` Eli Zaretskii 2024-12-09 14:11 ` Stefan Monnier via Users list for the GNU Emacs text editor 2024-12-07 16:27 Marco Antoniotti 2024-12-07 16:43 ` Eli Zaretskii 2024-12-07 19:09 ` Björn Bidar
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.