unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Marco Antoniotti <marcoxa@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Re: Retrieving the "include" directory for Emacs Modules
Date: Sun, 8 Dec 2024 16:18:15 +0100	[thread overview]
Message-ID: <CAKmY7cU97HWRkhMCtj53jbG6=CXVvy1mWrNecrnLG1NYmZ2PFg@mail.gmail.com> (raw)
In-Reply-To: <mailman.606.1733669386.12711.help-gnu-emacs@gnu.org>

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


       reply	other threads:[~2024-12-08 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.606.1733669386.12711.help-gnu-emacs@gnu.org>
2024-12-08 15:18 ` Marco Antoniotti [this message]
2024-12-08 15:29   ` Re: Retrieving the "include" directory for Emacs Modules 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

Reply instructions:

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

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

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

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

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

  git send-email \
    --in-reply-to='CAKmY7cU97HWRkhMCtj53jbG6=CXVvy1mWrNecrnLG1NYmZ2PFg@mail.gmail.com' \
    --to=marcoxa@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).