diff options
author | Alex Kost <alezost@gmail.com> | 2015-11-22 13:21:18 +0300 |
---|---|---|
committer | Alex Kost <alezost@gmail.com> | 2016-01-02 17:25:35 +0300 |
commit | 819518d15a4ca6ef4ce0844d89e990ffd46ee3a0 (patch) | |
tree | 00d457ec61e45e33f64afb3b7125776d72d9ee92 /emacs/guix-info.el | |
parent | e40b3c33f4750dcbe83012eb4e5b8e786f9f71b1 (diff) | |
download | guix-819518d15a4ca6ef4ce0844d89e990ffd46ee3a0.tar.gz |
emacs: Generalize buffer redisplaying.
* emacs/guix-base.el (guix-buffer-after-redisplay-hook): New variable. (guix-redisplay-buffer): Use it. Remove all arguments and the code for moving point to the next button. Rename to... (guix-buffer-redisplay): ... this. (guix-buffer-redisplay-goto-button): New procedure. * emacs/guix-info.el (guix-package-info-show-source): Use it. Adjust accordingly. (guix-package-info-redisplay-after-download): Likewise.
Diffstat (limited to 'emacs/guix-info.el')
-rw-r--r-- | emacs/guix-info.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/emacs/guix-info.el b/emacs/guix-info.el index 6e50d34c4d..b52bd73322 100644 --- a/emacs/guix-info.el +++ b/emacs/guix-info.el @@ -714,14 +714,16 @@ prompt depending on `guix-operation-confirm' variable)." Find the file if needed (see `guix-package-info-auto-find-source'). ENTRY-ID is an ID of the current entry (package or output). PACKAGE-ID is an ID of the package which source to show." - (let* ((entry (guix-entry-by-id entry-id guix-entries)) - (file (guix-package-source-path package-id))) + (let* ((entries guix-entries) + (entry (guix-entry-by-id entry-id guix-entries)) + (file (guix-package-source-path package-id))) (or file - (error "Couldn't define file path of the package source")) + (error "Couldn't define file name of the package source")) (let* ((new-entry (cons (cons 'source-file file) entry)) - (entries (guix-replace-entry entry-id new-entry guix-entries))) - (guix-redisplay-buffer :entries entries) + (new-entries (guix-replace-entry entry-id new-entry entries))) + (setq guix-entries new-entries) + (guix-buffer-redisplay-goto-button) (if (file-exists-p file) (if guix-package-info-auto-find-source (guix-find-file file) @@ -770,7 +772,8 @@ SOURCE is a list of URLs." "Redisplay an 'info' buffer after downloading the package source. This function is used to hide a \"Download\" button if needed." (when (buffer-live-p guix-package-info-download-buffer) - (guix-redisplay-buffer :buffer guix-package-info-download-buffer) + (with-current-buffer guix-package-info-download-buffer + (guix-buffer-redisplay-goto-button)) (setq guix-package-info-download-buffer nil))) (add-hook 'guix-after-source-download-hook |