commercial-emacs / commercial-emacs

"Evil will always triumph, because good is dumb." -- Spaceballs (1987)

Home Page:https://www.youtube.com/channel/UCyf-xqc0ovYSDgaCcB3CUoA/featured

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot configure emacs to build with a specific prefix

miguebox opened this issue · comments

Hello, I've been trying to install emacs in my system, but whenever I run make install after following the build instructions, emacs still tries to find it's source files in it's build directory.

I've been running the installation with the following script:

#!/usr/bin/env bash
REPO_DIR="$HOME/work/commercial-emacs/commercial-emacs"
INSTALL_DIR="$HOME/work/commercial-emacs/install"
CURRENT_DIR=$PWD
git --git-dir=$REPO_DIR/.git --work-tree=$REPO_DIR clean -fxd
cd $REPO_DIR
$REPO_DIR/autogen.sh
$REPO_DIR/configure --prefix=$INSTALL_DIR
make -j8
rm -r $INSTALL_DIR/*
make install

make install seems to work fine, in the sense that after running it I can find files

migue@miguelaptop:~/work/commercial-emacs/install $ls -l
total 20
drwxr-xr-x 2 migue migue 4096 Jan 24 15:28 bin
drwxr-xr-x 2 migue migue 4096 Jan 24 15:28 include
drwxr-xr-x 3 migue migue 4096 Jan 24 15:28 lib
drwxr-xr-x 3 migue migue 4096 Jan 24 15:28 libexec
drwxr-xr-x 8 migue migue 4096 Jan 24 15:28 share

But when I run bin/emacs-0.2.1 -Q , and enter the link to the source file of a function described with describe-function, these files are located in the commercial-emacs build directory instead of the install directory. For example, the source file of load-library, files.el, is found by emacs in $REPO_DIR/lisp/files.el instead of $INSTALL_DIR/share/emacs/0.2.1/lisp/files.el.

When running this script within a copy of GNU emacs' git repo, for example located in $HOME/work/savannah-emacs/emacs, with a prefix of $HOME/work/savannah-emacs/install, emacs finds it's source files inside the install directory instead of the build directory.

Is there any option specific to commercial-emacs that controls this behaviour?

~/.local/bin/emacs-0.2.1 -Q \
  --eval "(custom-set-variables '(find-function-prefer-source-directory nil))" \
  --eval "(find-library \"files\")"

If you hack on emacs as often as I do, the default activation of find-function-prefer-source-directory is indispensable. For everyone else, I guess it's just offensive.

Thanks for the help @dickmao 😄

I am away from my computer at the moment, but I'll try to write a patch later in the day to change find-function-prefer-source-directory.

For everyone else, I guess it's just offensive.

It's probably not a problem for most users of commercial emacs, but I'm trying to install the program through portage, so my build directory resides in RAM, and it is not accesible by a normal user 😅

@dickmao, I've tried your proposed fix, and even changed the default value of find-function-prefer-source-directory to nil before compiling; but my problem still remains with some functions, such as the example of my first comment: load-library.

find-library works fine, but other parts of emacs do not share this success. While in my first comment I only made reference to load-library, my problem persists across a multitude of other aspects; with other emacs features such as describe-function, dired or yank sharing the same conundrum. While all of these packages function on emacs -q, they all fail when init.el is loaded, complaining in the message buffer about void variables, which are caused by an inability to find these files that are being referenced according to source-directory, a directory only accessible by root.

I see what you mean. The problem actually has nothing to do with find-function-prefer-source-directory, but rather how I messed up the pdumper code. Thanks for bringing this to my attention.