;;; guix-history.el --- History of buffer information ;; Copyright © 2014 Alex Kost ;; This file is part of GNU Guix. ;; GNU Guix is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Guix is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; This file provides support for history of buffers similar to the ;; history of a `help-mode' buffer. ;;; Code: (require 'cl-macs) (defvar-local guix-history-stack-item nil "Current item of the history. A list of the form (FUNCTION [ARGS ...]). The item is used by calling (apply FUNCTION ARGS).") (put 'guix-history-stack-item 'permanent-local t) (defvar-local guix-history-back-stack nil "Stack (list) of visited items. Each element of the list has a form of `guix-history-stack-item'.") (put 'guix-history-back-stack 'permanent-local t) (defvar-local guix-history-forward-stack nil "Stack (list) of items visited with `guix-history-back'. Each element of the list has a form of `guix-history-stack-item'.") (put 'guix-history-forward-stack 'permanent-local t) (defvar guix-history-size 0 "Maximum number of items saved in history. If 0, the history is disabled.") (defun guix-history-add (item) "Add ITEM to history." (and guix-history-stack-item (push guix-history-stack-item guix-history-back-stack)) (setq guix-history-forward-stack nil guix-history-stack-item item) (when (>= (length guix-history-back-stack) guix-history-size) (setq guix-history-back-stack (cl-loop for elt in guix-history-back-stack for i from 1 to guix-history-size collect elt)))) (defun guix-history-replace (item) "Replace current item in history with ITEM." (setq guix-history-stack-item item)) (defun guix-history-goto (item) "Go to the ITEM of history. ITEM should have the form of `guix-history-stack-item'." (or (listp item) (error "Wrong value of history element")) (setq guix-history-stack-item item) (apply (car item) (cdr item))) (defun guix-history-back () "Go back to the previous element of history in the current buffer." (interactive) (or guix-history-back-stack (user-error "No previous element in history")) (push guix-history-stack-item guix-history-forward-stack) (guix-history-goto (pop guix-history-back-stack))) (defun guix-history-forward () "Go forward to the next element of history in the current buffer." (interactive) (or guix-history-forward-stack (user-error "No next element in history")) (push guix-history-stack-item guix-history-back-stack) (guix-history-goto (pop guix-history-forward-stack))) (provide 'guix-history) ;;; guix-history.el ends here tès 2020-10-05environment: Turn "lo" up in network-less containers....This is a followup to 0f53c801b91919380a924b402d1ff822bb1dc6ea. * guix/scripts/environment.scm (launch-environment/container): Add call to 'set-network-interface-up'. * tests/guix-environment-container.sh: Add test. Ludovic Courtès 2020-10-02environment: Provide /etc/hosts in containers without '--network'....Fixes <https://bugs.gnu.org/43762>. * guix/scripts/environment.scm (launch-environment/container): Create /etc/hosts when NETWORK? is false. * tests/guix-environment-container.sh: Add "localhost" resolution test. Ludovic Courtès 2020-09-21environment: '--link-profile' uses ~/.guix-profile for environment variables....Before this patch, we had: $ guix environment -CP --ad-hoc coreutils [env]$ echo $PATH /gnu/store/…-profile/bin [env]$ echo $GUIX_ENVIRONMENT /gnu/store/…-profile After this patch: $ guix environment -CP --ad-hoc coreutils [env]$ echo $PATH /home/ludo/.guix-profile/bin [env]$ echo $GUIX_ENVIRONMENT /home/ludo/.guix-profile * guix/scripts/environment.scm (launch-environment/container): When LINK-PROFILE? is true, pass ~/.guix-profile as the second argument to 'launch-environment'. * tests/guix-environment-container.sh: Adjust test accordingly. * doc/guix.texi (Invoking guix environment): Update accordingly. Ludovic Courtès 2020-06-20tests: Actually run 'tests/guix-environment-container.sh'....This test was skipped since the switch to Guile 3 because 'assert-container-features' would be inlined and thus accessing it with @@ would fail with an unbound-variable error. * guix/scripts/environment.scm (assert-container-features): Export. * tests/guix-environment-container.sh: Use single '@'. Ludovic Courtès