[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 927e401 184/449: New function for restoring windo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 927e401 184/449: New function for restoring window layout |
Date: |
Fri, 27 Nov 2020 23:15:35 -0500 (EST) |
branch: externals/gnorb
commit 927e40119ede04ebe8c1401c11db528dbdcdccea
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
New function for restoring window layout
* lisp/gnorb-utils.el (gnorb-restore-layout): Interactive function for
restoring window layout.
* lisp/gnorb-gnus.el (gnorb-gnus-incoming-do-todo): Delete other
windows, so we're left with a clear frame. `gnorb-restore-layout' can
bring us back.
* README.org: Document.
---
README.org | 4 ++++
lisp/gnorb-gnus.el | 3 +++
lisp/gnorb-utils.el | 13 +++++++++++++
3 files changed, 20 insertions(+)
diff --git a/README.org b/README.org
index cee1d66..1dc0872 100644
--- a/README.org
+++ b/README.org
@@ -168,6 +168,10 @@ you use on mail messages, and you'll be queried to
re-attach the
message's attachments onto the newly-captured heading. Or set
`gnorb-gnus-capture-always-attach' to "t" to have Gnorb do this for
all capture templates.
+** Restoring window layout
+Many Gnorb functions alter the window layout and value of point. In
+most of these cases, you can restore the previous layout using the
+interactive function `gnorb-restore-layout'.
** Gnorb-BBDB
*** Interactive Functions
**** gnorb-bbdb-tag-agenda
diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index 78e6e4d..ec8aa3a 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -541,6 +541,9 @@ to t (it is, by default)."
(sit-for 1))))
targ)
(gnorb-gnus-collect-all-attachments nil t)
+ ;; Delete other windows, users can restore with
+ ;; `gnorb-restore-layout'.
+ (delete-other-windows)
(if id
(gnorb-trigger-todo-action arg id)
(if (and offer-heading
diff --git a/lisp/gnorb-utils.el b/lisp/gnorb-utils.el
index 538bdc3..43c7ba7 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -112,6 +112,19 @@ with `gnorb-window-conf'.")
(mapconcat
'identity ign-headers-list "|")))))
+(defun gnorb-restore-layout ()
+ "Restore window layout and value of point after a Gnorb command.
+
+Some Gnorb commands change the window layout (ie `gnorb-org-view'
+or incoming email triggering). This command restores the layout
+to what it was. Bind it to a global key, or to local keys in Org
+and Gnus and BBDB maps."
+ (interactive)
+ (when (window-configuration-p gnorb-window-conf)
+ (set-window-configuration gnorb-window-conf)
+ (when (buffer-live-p (marker-buffer gnorb-return-marker))
+ (goto-char gnorb-return-marker))))
+
(defun gnorb-trigger-todo-action (arg &optional id)
"Do the actual restore action. Two main things here. First: if
we were in the agenda when this was called, then keep us in the
- [elpa] externals/gnorb 6246244 106/449: Hinting for potentially-relevant incoming messages, (continued)
- [elpa] externals/gnorb 6246244 106/449: Hinting for potentially-relevant incoming messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a79cf72 126/449: Unwrap "if" from around function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 0255247 133/449: Only notice records on message receipt, not sending, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b70d845 168/449: Handle nil group values in registry entries, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 880afd6 158/449: Register sent messages so we can view them later, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 25aa0f1 173/449: Use a marker in conjunction with window conf, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e1129e9 170/449: Fix problems when BBDB is not present and gnorb-bbdb is not loaded., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5f96b98 167/449: Stupid typo, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9a2f747 175/449: Don't hint messages in nnir or virtual summaries, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ec44a6d 182/449: Continue shifting candidate finding to the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 927e401 184/449: New function for restoring window layout,
Stefan Monnier <=
- [elpa] externals/gnorb a352586 189/449: Improve lookups for entries with unknown groups, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 81fed4b 193/449: Helper function for transitioning to the new system, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d7327b5 192/449: The big switch! Rely only on registry for tracking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7ba1786 196/449: Use gnorb-gnus-message-info for incoming and outgoing, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 0cb4d1a 201/449: Docstring for gnorb-scan-links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5c9ef6e 203/449: Don't create Org IDs when scanning for mails, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9ac84b7 218/449: Return links in the order which they were found, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a9535ae 223/449: Merge branch 'registry', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb dd4e013 225/449: Restore action shouldn't quit summary buffer, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 08e0742 229/449: Empty News and gnorb.texi files, Stefan Monnier, 2020/11/27