all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init'.
@ 2016-02-10  8:47 Alex Kost
  2016-02-10  8:47 ` [PATCH 2/3] system: Do not create "site-start.el" Alex Kost
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Kost @ 2016-02-10  8:47 UTC (permalink / raw)
  To: guix-devel

* emacs/guix-init.el: Move adding hooks to...
* emacs/guix-build-log.el: ... here.
* emacs/guix-devel.el: ... and here.
---
 emacs/guix-build-log.el | 3 +++
 emacs/guix-devel.el     | 3 +++
 emacs/guix-init.el      | 3 ---
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/emacs/guix-build-log.el b/emacs/guix-build-log.el
index e08a88f..f67be16 100644
--- a/emacs/guix-build-log.el
+++ b/emacs/guix-build-log.el
@@ -367,6 +367,9 @@ programmatically using hooks:
   (guix-build-log-mode))
 
 ;;;###autoload
+(add-hook 'shell-mode-hook 'guix-build-log-minor-mode-activate-maybe)
+
+;;;###autoload
 (add-to-list 'auto-mode-alist
              ;; Regexp for log files (usually placed in /var/log/guix/...)
              (cons (rx "/guix/drvs/" (= 2 alnum) "/" (= 30 alnum)
diff --git a/emacs/guix-devel.el b/emacs/guix-devel.el
index 8eb0309..ee8371c 100644
--- a/emacs/guix-devel.el
+++ b/emacs/guix-devel.el
@@ -364,6 +364,9 @@ bindings:
   (when guix-devel-activate-mode
     (guix-devel-mode)))
 
+;;;###autoload
+(add-hook 'scheme-mode-hook 'guix-devel-activate-mode-maybe)
+
 \f
 (defvar guix-devel-emacs-font-lock-keywords
   (eval-when-compile
diff --git a/emacs/guix-init.el b/emacs/guix-init.el
index 47ced6a..1d7d258 100644
--- a/emacs/guix-init.el
+++ b/emacs/guix-init.el
@@ -1,7 +1,4 @@
 (require 'guix-autoloads)
 (require 'guix-emacs)
 
-(add-hook 'scheme-mode-hook 'guix-devel-activate-mode-maybe)
-(add-hook 'shell-mode-hook 'guix-build-log-minor-mode-activate-maybe)
-
 (provide 'guix-init)
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] system: Do not create "site-start.el".
  2016-02-10  8:47 [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init' Alex Kost
@ 2016-02-10  8:47 ` Alex Kost
  2016-02-10  8:47 ` [PATCH 3/3] emacs: Deprecate "guix-init.el" Alex Kost
  2016-02-18  9:25 ` [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init' Alex Kost
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Kost @ 2016-02-10  8:47 UTC (permalink / raw)
  To: guix-devel

After commits 004ea62 and <FIXME commit after updating guix-devel
snapshot> Emacs can find packages in a system profile, so it autoloads
guix code without additional hacks, which can be removed now.

* gnu/system.scm (emacs-site-file, emacs-site-directory): Remove.
(operating-system-etc-service): Adjust accordingly.
(operating-system-environment-variables): Remove EMACSLOADPATH.
---
 gnu/system.scm | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index ff3a400..de9b6c4 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -397,37 +397,11 @@ This is the GNU system.  Welcome.\n")
   "Return the default /etc/hosts file."
   (plain-file "hosts" (local-host-aliases host-name)))
 
-(define (emacs-site-file)
-  "Return the Emacs 'site-start.el' file.  That file contains the necessary
-settings for 'guix.el' to work out-of-the-box."
-  (scheme-file "site-start.el"
-               #~(progn
-                  ;; Add the "normal" elisp directory to the search path;
-                  ;; guix.el may be there.
-                  (add-to-list
-                   'load-path
-                   "/run/current-system/profile/share/emacs/site-lisp")
-
-                  ;; Attempt to load guix.el.
-                  (require 'guix-init nil t)
-
-                  ;; Attempt to load geiser.
-                  (require 'geiser-install nil t))))
-
-(define (emacs-site-directory)
-  "Return the Emacs site directory, aka. /etc/emacs."
-  (computed-file "emacs"
-                 #~(begin
-                     (mkdir #$output)
-                     (chdir #$output)
-                     (symlink #$(emacs-site-file) "site-start.el"))))
-
 (define* (operating-system-etc-service os)
   "Return a <service> that builds containing the static part of the /etc
 directory."
   (let ((login.defs (plain-file "login.defs" "# Empty for now.\n"))
 
-        (emacs      (emacs-site-directory))
         (issue      (plain-file "issue" (operating-system-issue os)))
         (nsswitch   (plain-file "nsswitch.conf"
                                 (name-service-switch->string
@@ -501,7 +475,6 @@ fi\n")))
      `(("services" ,#~(string-append #$net-base "/etc/services"))
        ("protocols" ,#~(string-append #$net-base "/etc/protocols"))
        ("rpc" ,#~(string-append #$net-base "/etc/rpc"))
-       ("emacs" ,#~#$emacs)
        ("login.defs" ,#~#$login.defs)
        ("issue" ,#~#$issue)
        ("nsswitch.conf" ,#~#$nsswitch)
@@ -581,10 +554,6 @@ use 'plain-file' instead~%")
     ("SSL_CERT_DIR" . "/etc/ssl/certs")
     ("SSL_CERT_FILE" . "/etc/ssl/certs/ca-certificates.crt")
     ("GIT_SSL_CAINFO" . "/etc/ssl/certs/ca-certificates.crt")
-    ;; Prepend the directory of 'site-start.el' to the search path, so
-    ;; that it has higher precedence than the 'site-start.el' file our
-    ;; Emacs package provides.
-    ("EMACSLOADPATH" . "/etc/emacs:")
     ;; By default, applications that use D-Bus, such as Emacs, abort at startup
     ;; when /etc/machine-id is missing.  Make sure these warnings are non-fatal.
     ("DBUS_FATAL_WARNINGS" . "0")))
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] emacs: Deprecate "guix-init.el".
  2016-02-10  8:47 [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init' Alex Kost
  2016-02-10  8:47 ` [PATCH 2/3] system: Do not create "site-start.el" Alex Kost
@ 2016-02-10  8:47 ` Alex Kost
  2016-02-18  9:25 ` [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init' Alex Kost
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Kost @ 2016-02-10  8:47 UTC (permalink / raw)
  To: guix-devel

'guix-init' served 2 purposes:

- to autoload guix commands (by requiring 'guix-autoloads');
- and to autoload Emacs packages installed with Guix (by requiring
  'guix-emacs').

The second purpose is not actual anymore, as Emacs package handles this
task now, so there is no need in 'guix-init' anymore.

* emacs/guix-init.el: Do not require 'guix-emacs'.  Add a deprecation
  message.
* doc/emacs.texi (Emacs Initial Setup): Recommend to use
  'guix-autoloads' instead of 'guix-init'.
---
 doc/emacs.texi     | 33 +++++++++------------------------
 emacs/guix-init.el |  3 +--
 2 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/doc/emacs.texi b/doc/emacs.texi
index d46c17c..f9705b8 100644
--- a/doc/emacs.texi
+++ b/doc/emacs.texi
@@ -48,13 +48,13 @@ command (@pxref{Emacs Popup Interface}).
 
 @end itemize
 
-When it is done ``guix.el'' may be configured by requiring a special
-@code{guix-init} file---i.e., by adding the following code into your
-init file (@pxref{Init File,,, emacs, The GNU Emacs Manual}):
+When it is done, ``guix.el'' may be configured by requiring
+@code{guix-autoloads} file---i.e., by adding the following code into
+your init file (@pxref{Init File,,, emacs, The GNU Emacs Manual}):
 
 @example
 (add-to-list 'load-path "/path/to/directory-with-guix.el")
-(require 'guix-init nil t)
+(require 'guix-autoloads nil t)
 @end example
 
 So the only thing you need to figure out is where the directory with
@@ -74,9 +74,10 @@ then Guix is installed somewhere in the store, so the elisp files are
 placed in @file{/gnu/store/@dots{}-guix-0.8.2/share/emacs/site-lisp/} or
 alike.  However it is not recommended to refer directly to a store
 directory.  Instead you can install Guix using Guix itself with
-@command{guix package -i guix} command (@pxref{Invoking guix package})
-and add @file{~/.guix-profile/share/emacs/site-lisp/} directory to
-@code{load-path} variable.
+@command{guix package -i guix} command (@pxref{Invoking guix package}).
+No further actions are needed in this case, as @code{guix-autoloads}
+file will automatically be loaded by Emacs (if it is installed with
+Guix, of course) (@pxref{Application Setup}).
 
 @item
 If you did not install Guix at all and prefer a hacking way
@@ -88,26 +89,10 @@ same directory, so your final configuration will look like this:
 (let ((dir "/path/to/your-guix-git-tree/emacs"))
   (add-to-list 'load-path dir)
   (setq guix-load-path dir))
-(require 'guix-init nil t)
+(require 'guix-autoloads nil t)
 @end example
 @end itemize
 
-By default, along with autoloading (@pxref{Autoload,,, elisp, The GNU
-Emacs Lisp Reference Manual}) the main interactive commands for
-``guix.el'' (@pxref{Emacs Commands}), requiring @code{guix-init} will
-also autoload commands for the Emacs packages installed in your user
-profile.
-
-To disable automatic loading of installed Emacs packages, set
-@code{guix-package-enable-at-startup} variable to @code{nil} before
-requiring @code{guix-init}.  This variable has the same meaning for
-Emacs packages installed with Guix, as @code{package-enable-at-startup}
-for the built-in Emacs package system (@pxref{Package Installation,,,
-emacs, The GNU Emacs Manual}).
-
-You can activate Emacs packages installed in your profile whenever you
-want using @kbd{M-x@tie{}guix-emacs-autoload-packages}.
-
 
 @node Emacs Package Management
 @section Package Management
diff --git a/emacs/guix-init.el b/emacs/guix-init.el
index 1d7d258..bd75e54 100644
--- a/emacs/guix-init.el
+++ b/emacs/guix-init.el
@@ -1,4 +1,3 @@
 (require 'guix-autoloads)
-(require 'guix-emacs)
-
+(message "(require 'guix-init) is obsolete, use (require 'guix-autoloads) instead.")
 (provide 'guix-init)
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init'.
  2016-02-10  8:47 [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init' Alex Kost
  2016-02-10  8:47 ` [PATCH 2/3] system: Do not create "site-start.el" Alex Kost
  2016-02-10  8:47 ` [PATCH 3/3] emacs: Deprecate "guix-init.el" Alex Kost
@ 2016-02-18  9:25 ` Alex Kost
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Kost @ 2016-02-18  9:25 UTC (permalink / raw)
  To: guix-devel

Alex Kost (2016-02-10 11:47 +0300) wrote:

> * emacs/guix-init.el: Move adding hooks to...
> * emacs/guix-build-log.el: ... here.
> * emacs/guix-devel.el: ... and here.
> ---
>  emacs/guix-build-log.el | 3 +++
>  emacs/guix-devel.el     | 3 +++
>  emacs/guix-init.el      | 3 ---
>  3 files changed, 6 insertions(+), 3 deletions(-)

Since it looked uncontroversial to me, I've pushed this patch :-)

-- 
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-18  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10  8:47 [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init' Alex Kost
2016-02-10  8:47 ` [PATCH 2/3] system: Do not create "site-start.el" Alex Kost
2016-02-10  8:47 ` [PATCH 3/3] emacs: Deprecate "guix-init.el" Alex Kost
2016-02-18  9:25 ` [PATCH 1/3] emacs: Autoload hooks instead of putting them in 'guix-init' Alex Kost

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.