From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Patrick Mahan Newsgroups: gmane.emacs.help Subject: Re: PWD is not seen by my emacs installation Date: Wed, 30 Aug 2023 16:43:51 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29796"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: =?UTF-8?Q?Rudolf_Adamkovi=C4=8D?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 31 01:44:58 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qbUrp-0007XX-4g for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 31 Aug 2023 01:44:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbUr4-0007R8-Qo; Wed, 30 Aug 2023 19:44:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbUr3-0007Qe-AN for help-gnu-emacs@gnu.org; Wed, 30 Aug 2023 19:44:09 -0400 Original-Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbUr0-0003TI-FC for help-gnu-emacs@gnu.org; Wed, 30 Aug 2023 19:44:08 -0400 Original-Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3a850f07fadso112487b6e.2 for ; Wed, 30 Aug 2023 16:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693439042; x=1694043842; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FUIQxHkZNW4zJBVsgLF7Dap2DUX4sTN3xyX8LoAYEi4=; b=DxbFy1QjOd8nnyi+4jUnIm3cTYiy8Jot7oE8v0OIY+fsErQwlqhDUtok/am50MuGbt krdTXFs6fFm8mc9qRP0q6P/7aC19F87wrErLsS/Y+CLvtsarjzdDm3FT21jJ6PbdbPv8 wWHRM4cG1Z3aQ0v2JMYFzOrVKxx45PfSD/ncpmRZdRCk2nq9KaSbQv1CbsSkGkHX9ERL EVw8WeMhwxfXjkS8HOMl0sjqAfTVJZDSMVgOz0U5QZrYcipwJEUF+RY9K0RuBnruiYv2 bFQDLePOpCXsBHOxirPInYcstgLG17McAKeauux2HXT/rgXzYlGLQ+Ga3MhdOmgeVDnG WLxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693439042; x=1694043842; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FUIQxHkZNW4zJBVsgLF7Dap2DUX4sTN3xyX8LoAYEi4=; b=e8gleiGzC3DPZHFjjKi5voU3GDD9CKFE8TdnLPngoy070YJ+LZcAJ7fGKf4TXswDZq zbFIG67RUYfgVm+dPvDN0YFNNNHjzhZhpTSTYWIDm0ComDjki1yzQ6osKWZs+R84vxmc C9tsV0f6eqIpW9ziJ1dNyXgytQ54B8aqzT/8zdCLusHXICYo5WZJ38d1Lxl76H5p3TEL vBsRPCOA7FGk2JkLme0TB6naUjtPd6bpWFse0BvJMvLEN67kNP06KD91P1Vqz9zR2nwV Gcl6tFgNMTzfh/no2YA4wIMmANcA7T4xpS8/8kEYsLR7EHTCLxkUkUWYtecqdkV3rdvT x+SA== X-Gm-Message-State: AOJu0Yw6QV8zvzmpbNbD5zKyl8GfXo20e8x4dN1raX6cVn8j28G3wzjt j9shTcSQ8RT0VxXhsVPQ0badaAEco40vUMankxA= X-Google-Smtp-Source: AGHT+IGDTYI6Z9cyN2L+1drJFphQdTcz6tOuW7A5xrb/w3AxzOhvuGxiljxrBKEgot7cc714fhVtmTa6bok6OJlwj0w= X-Received: by 2002:a05:6808:1288:b0:3a7:4878:235a with SMTP id a8-20020a056808128800b003a74878235amr5335182oiw.29.1693439042183; Wed, 30 Aug 2023 16:44:02 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::22b; envelope-from=plmahan@gmail.com; helo=mail-oi1-x22b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145037 Archived-At: Thanks for sharing. Patrick On Wed, Aug 30, 2023 at 3:30=E2=80=AFPM Rudolf Adamkovi=C4=8D wrote: > Patrick Mahan writes: > > > Hardware - > > > > Macbook Pro 14" (Apple M1 Pro) > > Mac OS 13.1 (Ventura) > > I am on the same system, with the same > problem, and I solved it as follows... > > From my literate configuration file: > > [...] > > Copy the =3D$PATH=3D, =3D$MANPATH=3D, and =3DLC_ALL=3D > variables from the interactive login shell to > Emacs. This is necessary on macOS, as its > GUI starts programs within a minimal > environment. > > In practice, this fixes various problems, > such as the =3D*compilation*=3D buffer not > finding =3Demacs=3D, =3Dfortune=3D not finding > =3Dstrfile=3D, =3Dgeiser-mode=3D not finding =3Dguile=3D, > =3Demacs=3D not finding =3Dgcc=3D for native > compilation, as well as, spurious =3Dlocale=3D > warnings. > > #+BEGIN_SRC emacs-lisp :eval no :tangle ~/.emacs > (when (eq window-system 'ns) > (defun shell-get-environment-variable+ (variable) > "Return the value of VARIABLE from login shell." > (shell-command-to-string > (format "$SHELL --login -c 'echo -n $%s'" variable))) > ;; > ;; Set the path variable. > (let* ((path "PATH") > (path-value (shell-get-environment-variable+ path))) > (setenv path path-value) > (setq exec-path (split-string path-value path-separator))) > ;; > ;; Set the locale. > (let* ((variable "LC_ALL") > (variable-value (shell-get-environment-variable+ variable))) > (setenv variable variable-value))) > #+END_SRC > > P.S. 1: My code launches the login shell > twice instead of once, which is something to > improve. > > P.S. 2: It would be useful to have a command > that does this in vanilla Emacs. > > Rudy > -- > "Programming reliably -- must be an activity > of an undeniably mathematical nature [=E2=80=A6] You > see, mathematics is about thinking, and doing > mathematics is always trying to think as well > as possible." -- Edsger W. Dijkstra, 1981 > > Rudolf Adamkovi=C4=8D [he/him] > Studenohorsk=C3=A1 25 > 84103 Bratislava > Slovakia >