emacscollective / borg

Assimilate Emacs packages as Git submodules
https://emacsmirror.net/manual/borg
GNU General Public License v3.0
255 stars 28 forks source link

[manual] [bootstrapping from scratch] Questions and mods #95

Closed rprimus closed 4 years ago

rprimus commented 4 years ago

Sun Jul 5 16:35:25 BST 2020

I am aware that this is a WIP.

Questions:

At https://github.com/emacscollective/borg/blame/master/borg.org#L195, a Makefile is created that uses $(DRONES_DIR), however, at https://github.com/emacscollective/borg/blame/master/borg.org#L208, https://github.com/emacscollective/borg/blame/master/borg.org#L218 and subsequently, lib is used.

  1. Will this hard-coded reference to lib be updated to refer to the $DRONES_DIR or a note added to mention: "In the following examples, replace lib with the location you'd like to have the drones installed."
  2. When is this Makefile to be used? It's a bit confusing to create the Makefile here and to not use it - but to resist the temptation to run make bootstrap-borg.

At https://github.com/emacscollective/borg/blame/master/borg.org#L218, user-emacs-directory is used. Using emacs -Q --load <path-to-init-file> raises and error:

Cannot open load file: No such file or directory, borg

user-emacs-directory is set to ~/.emacs.d/. Using the suggestion from https://github.com/emacscollective/borg/issues/46:

(setq user-init-file (or load-file-name buffer-file-name))
(setq user-emacs-directory (file-name-directory user-init-file))

Adding these two lines ahead of the suggested init.el eliminates the above error.

  1. I am at a loss as to why this works, as:
    : ; emacs -Q --batch --load ~/z/.emacs.d/init.el --eval '(message "bfn: %s, lfn: %s ued: %s uif: %s" buffer-file-name load-file-name user-emacs-directory user-init-file)'
    Initializing drones...done (1 drones in 0.052s)
    bfn: nil, lfn: nil ued: /Users/rprimus/z/.emacs.d/ uif: /Users/rprimus/z/.emacs.d/init.el

Update: Q3

Appears --batch operation with --eval has a different evaluation order. Adding debug message expressions to .init.el directly shows that load-file-name is set to ~/z/.emacs.d/init.el.

tarsius commented 4 years ago
  1. I think it is kind of obvious that those values have to be adjusted.
  2. Well the second half of that sentence attempts to explain it.
  3. For now I am opting for leaving out hints in the hope that not overwhelming the user with details that might not be relevant is of more important than leaving no room for ambiguity.

I prefixed the Bootstrapping section with

(As mentioned in the next section you can use a location other than ~~/.emacs.d~. Never-the-less most of the subsequent examples just talk about ~~/.emacs.d~ and if you use something else, then obviously have to substitute that. The same for the string ~lib~ and the variables ~user-init-file~ and ~user-emacs-directory~, which also might not be appropriate depending on your choices.)

We'll see if that is enough.