[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 43fbd55 176/449: New function for restoring windo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 43fbd55 176/449: New function for restoring window layout |
Date: |
Fri, 27 Nov 2020 23:15:33 -0500 (EST) |
branch: externals/gnorb
commit 43fbd550294cfa93efeee7cee0d6c4b585a58588
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 | 12 ++++++++++++
3 files changed, 19 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..9289f91 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -112,6 +112,18 @@ 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)
+ (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 ebce811 144/449: Also check for nnir when storing BBDB message links, (continued)
- [elpa] externals/gnorb ebce811 144/449: Also check for nnir when storing BBDB message links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5101731 150/449: Improvements to TODOs made from outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b841d17 146/449: Wishlist changes, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8958546 155/449: Backquote escape fail, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 38df7d0 166/449: Ignore a notes.org file, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 44f8d23 165/449: Begin shift to using the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c280ea4 160/449: Only add relevant sent messages in the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4fc1075 172/449: Rename gnorb-org-window-conf to gnorb-window-conf, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bb44a8c 174/449: Don't force id creation!, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b596ee7 157/449: Check for success when following gnus links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 43fbd55 176/449: New function for restoring window layout,
Stefan Monnier <=
- [elpa] externals/gnorb fe7d814 179/449: Provide initialization of gnorb email tracking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b95f371 186/449: That's not how you use condition-case, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6653b6c 187/449: Fix gnorb-tracking-initialize, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f0cfa7b 191/449: Improvements to gnorb-registry-make-entry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bdbc96f 195/449: Rename gnorb-gnus-sending-message-info, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ca85930 197/449: First draft of trigger action reworking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9e880eb 200/449: Improve Gnus summary hinting, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8a0d275 202/449: Docstring for gnorb-registry-org-id-search, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6293b22 208/449: Squash with the trigger action stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 326fcb0 210/449: Document new tracking system, Stefan Monnier, 2020/11/27