From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= Newsgroups: gmane.emacs.help Subject: Re: PWD is not seen by my emacs installation Date: Thu, 31 Aug 2023 00:29:40 +0200 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="30968"; mail-complaints-to="usenet@ciao.gmane.io" To: Patrick Mahan , Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 31 00:30:51 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 1qbTi6-0007ok-St for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 31 Aug 2023 00:30:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbThP-00040r-RL; Wed, 30 Aug 2023 18:30:07 -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 1qbThP-0003yV-1z for help-gnu-emacs@gnu.org; Wed, 30 Aug 2023 18:30:07 -0400 Original-Received: from pv50p00im-ztdg10021901.me.com ([17.58.6.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbThM-000644-HO for help-gnu-emacs@gnu.org; Wed, 30 Aug 2023 18:30:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1693434603; bh=ttTPYNRh83M9O+QLDMQX2A+hSuoVuyn2rwX9N8MvIh4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=AbuaNKkfvzLRIiS8I0anGow8+pejYtrSPr83VgGq68KQh0S/PpI6quTvzqgminpKH kqnZYj54ddVRIq5awVz+pHSleLTyORTl7m84IjOksIs8vKiFiGB4+QZZLhZ+9h6cca lgf9kqL4LOQ0ach43TTATEj8vFA9oekkc4gL5y8ca5xXjHwSQaJcj3RU/08FaTtxCL K/keTPK3DvzYyqdo7/yBwX/B+BuZq476mMBcgJqGiMxq/LAEyIhJk/DoWRh+K9BuRP lLN/4AYX2j/9dZIwUdiYmaY/veATsU8S/bB7IcNppN9taUpV/gKSUYBs0y/KtpXz9e G3mzhjiWqdPKQ== Original-Received: from Rudolfs-MacBook-Air.local (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10021901.me.com (Postfix) with ESMTPSA id CE40681356; Wed, 30 Aug 2023 22:29:43 +0000 (UTC) In-Reply-To: X-Proofpoint-ORIG-GUID: 0Kp18EOH_77QwbZpRKJqBmjhb4odJBXQ X-Proofpoint-GUID: 0Kp18EOH_77QwbZpRKJqBmjhb4odJBXQ X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.517,18.0.572,17.11.64.514.0000000_definitions?= =?UTF-8?Q?=3D2022-06-21=5F01:2022-06-21=5F01,2020-02-14=5F11,2022-02-23?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 malwarescore=0 clxscore=1011 adultscore=0 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2308300204 Received-SPF: pass client-ip=17.58.6.55; envelope-from=salutis@me.com; helo=pv50p00im-ztdg10021901.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:145036 Archived-At: 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 --=20 "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