Alex Kost <alez...@gmail.com> writes: > myglc2 (2016-02-05 02:40 +0300) wrote: > > [...] >>> Right now I can't check it, but I think if you start emacs like this: >>> >>> EMACSLOADPATH=/etc/emacs: emacs >>> >>> you'll get "M-x guix-…" commands. Could you confirm? >> >> Yes that works. >> >> ... and then if I do >> >> '(guix-emacs-load-autoloads "/run/current-system/profile")' >> >> 'M-x magit-status' works. > > Thanks for confirming. It will be fixed soon. > >> I am a little confused (not your fault). May I ask an off-topic >> question? > > Sure. > >> It seems that doing ... 'M-x guix-edit foo.scm' ... amounts to hacking > > just "foo" without ".scm" ---------------^^^^^^^ > (BTW package names are completed if you press TAB) > >> guix. >> >> However '8.1 Building from Git' says, "If you want to hack Guix itself, >> it is recommended to use the latest version from the Git repository." >> ... and goes on to describe a different approach. >> >> Can you comment on which approach is best for which situation. > > The purpose of "M-x guix-edit" Emacs command (and "guix edit" shell > command) is just to show you the source code of the package. This > source is usually placed in the store, and you shouldn't edit it. If > you are going to contribute to guix, (info "(guix) Building from Git") > is the right way. > > For "M-x guix-edit", there is a trick that allows to point to any place > with packages — setting 'guix-directory' variable. For example, if you > cloned guix to "~/src" directory, after: > > (setq guix-directory "~/src/guix") > > "M-x guix-edit magit" will open "~/src/guix/gnu/packages/emacs.scm" file.
Thank you Alex. This really helps me. FWIW, Here are a couple thoughts: It was confusing to me that 'guix-edit' shows "Note: file is write protected". This behavior made me wonder what was wrong with my setup and/or my understanding. This might be improved by: 1) expanding one of the messages: "Note: file is write protected", or 'command-execute: Buffer is read-only: #<buffer screen.scm>' to say, if you want to modify guix see "8.1 Building from Git". - or - a) rename the current 'guix-edit' function to guix-inspect', 'guix-examine', or'guix-view'. b) make a new/improved 'guix-edit' that prompts for guix-directory if it is not already not set, perhaps also refering the user to "8.1 Building from Git". c) possibly allow "warping" from "guix-inspect" to "guix-edit".