unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 2/3] emacs: Restore mode-line after operation prompt.
@ 2014-11-09  8:40 Alex Kost
  2014-11-09 17:40 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Kost @ 2014-11-09  8:40 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

Earlier a prompt “Continue operation? (y, n, s, d)” was used only with a
temporary buffer for package operations and there were no problems with
modifying a mode-line there.

But now (I mean after the next patch) it is also used to prompt before
building a source derivation (as "substitutes" and "dry-run" make sence
there too).  This patch will handle this case.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-emacs-Restore-mode-line-after-operation-prompt.patch --]
[-- Type: text/x-diff, Size: 1620 bytes --]

From 8036ec72ef486c158683ce67a1a5f15056de0cc4 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Sun, 9 Nov 2014 11:00:35 +0300
Subject: [PATCH 2/3] emacs: Restore mode-line after operation prompt.

* emacs/guix-base.el (guix-operation-prompt): Restore 'mode-line-format' after
  prompting.
---
 emacs/guix-base.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index 3dda938..784474e 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -928,7 +928,7 @@ ENTRIES is a list of package entries to get info about packages."
     (insert "\n")))
 
 (defun guix-operation-prompt ()
-  "Prompt a user for continuing the current package operation.
+  "Prompt a user for continuing the current operation.
 Return non-nil, if the operation should be continued; nil otherwise."
   (let* ((option-keys (mapcar #'guix-operation-option-key
                               guix-operation-options))
@@ -943,9 +943,11 @@ Return non-nil, if the operation should be continued; nil otherwise."
                           keys
                           ", ")
                          ") ")))
-    (prog1 (guix-operation-prompt-1 prompt keys)
-      ;; Clear the minibuffer after prompting.
-      (message ""))))
+    (let ((mode-line mode-line-format))
+      (prog1 (guix-operation-prompt-1 prompt keys)
+        (setq mode-line-format mode-line)
+        ;; Clear the minibuffer after prompting.
+        (message "")))))
 
 (defun guix-operation-prompt-1 (prompt keys)
   "This function is internal for `guix-operation-prompt'."
-- 
2.1.2


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

* Re: [PATCH 2/3] emacs: Restore mode-line after operation prompt.
  2014-11-09  8:40 [PATCH 2/3] emacs: Restore mode-line after operation prompt Alex Kost
@ 2014-11-09 17:40 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2014-11-09 17:40 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> Earlier a prompt “Continue operation? (y, n, s, d)” was used only with a
> temporary buffer for package operations and there were no problems with
> modifying a mode-line there.
>
> But now (I mean after the next patch) it is also used to prompt before
> building a source derivation (as "substitutes" and "dry-run" make sence
> there too).  This patch will handle this case.
>
>
> From 8036ec72ef486c158683ce67a1a5f15056de0cc4 Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Sun, 9 Nov 2014 11:00:35 +0300
> Subject: [PATCH 2/3] emacs: Restore mode-line after operation prompt.
>
> * emacs/guix-base.el (guix-operation-prompt): Restore 'mode-line-format' after
>   prompting.

Okay!

Ludo'.

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

end of thread, other threads:[~2014-11-09 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-09  8:40 [PATCH 2/3] emacs: Restore mode-line after operation prompt Alex Kost
2014-11-09 17:40 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).