From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Prikler Subject: bug#38309: Recent $EMACSLOADPATH changes crash gnome-session Date: Wed, 27 Nov 2019 01:01:31 +0100 Message-ID: <674732dc751fbafbdb1e3fd4464d19e27e36607f.camel@student.tugraz.at> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39162) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZkmT-00064y-MC for bug-guix@gnu.org; Tue, 26 Nov 2019 19:02:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZkmR-0007TV-R9 for bug-guix@gnu.org; Tue, 26 Nov 2019 19:02:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iZkmQ-0007Sp-NH for bug-guix@gnu.org; Tue, 26 Nov 2019 19:02:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: 87y2w3c8y1.fsf@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: ludo@gnu.org Cc: 38309@debbugs.gnu.org Hi everyone, Am Dienstag, den 26.11.2019, 09:56 +0100 schrieb Ludovic Courtès: > are we not going overboard with that big a environment variable? :-) I think I vaguely remember a related discussion about the Emacs build system adding the guix.d directory, which further worsens this problem [1]. Putting that aside however, $EMACSLOADPATH should not contain more than - $GUIX_PROFILE/share/emacs/$EMACS_VERSION/lisp - $GUIX_PROFILE/share/emacs/$EMACS_VERSION/site-lisp - $GUIX_PROFILE/share/emacs/site-lisp If I read (elisp)Library Search correctly, these directories each contain a file to add their subdirectories to the load-path variable. This can be confirmed by searching in the store or through message- debugging. It appears, however, that these files are not quite sufficient. While the load-path is indeed modified, no autoloading occurs for files inside guix.d -- indeed, I doubt it would occur for any package, regardless of how we name it. After further digging around, this appears to be a bug in guix-emacs. Rather than using the load-path variable, it uses $EMACSLOADPATH directly via getenv. I suggest either recursing into subdirectories as Emacs itself would or using load-path instead of reverse engineering it, preferring the latter if applicable. Now that this has been cleared up, a fix should be in reach. First we would fix guix-emacs, then we can restrict $EMACSLOADPATH to the above three -- perhaps two, as the versioned site-lisp appears unused. WDYT? Regards, Leo [1] As I only vaguely remember it, I can not find a source for this. However, the process that I've laid out should work fine with or without guix.d