emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnorb 4fc1075 172/449: Rename gnorb-org-window-conf to


From: Stefan Monnier
Subject: [elpa] externals/gnorb 4fc1075 172/449: Rename gnorb-org-window-conf to gnorb-window-conf
Date: Fri, 27 Nov 2020 23:15:32 -0500 (EST)

branch: externals/gnorb
commit 4fc1075b756e19ed1a2726d933d79ab2aff4d8cd
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Rename gnorb-org-window-conf to gnorb-window-conf
    
    Should be saved as a more central value.
    
    * lisp/gnorb-utils.el: Add gnorb-window-conf, and use new var
    * lisp/gnorb-org.el: Remove gnorb-org-window-conf
    * lisp/gnorb-gnus.el: Use new var
---
 lisp/gnorb-gnus.el  |  4 ++--
 lisp/gnorb-org.el   | 24 ++++++++++--------------
 lisp/gnorb-utils.el |  6 +++++-
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index 34fe4bd..0fc2fcd 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -349,7 +349,7 @@ the outgoing message will still be available -- nothing 
else will
 work."
   (interactive "P")
   (let ((org-refile-targets gnorb-gnus-trigger-refile-targets)
-       header-ids ref-ids rel-headings gnorb-org-window-conf
+       header-ids ref-ids rel-headings gnorb-window-conf
        reply-id reply-group)
     (when arg
       (setq rel-headings
@@ -512,7 +512,7 @@ to t (it is, by default)."
   ;; `org-stored-links'. There's some duplicate storage, at
   ;; present. Take a look at calling it non-interactively.
   (call-interactively 'org-store-link)
-  (setq gnorb-org-window-conf (current-window-configuration))
+  (setq gnorb-window-conf (current-window-configuration))
   (let* ((msg-id (mail-header-id headers))
         (sender (mail-header-from headers))
         (subject (mail-header-subject headers))
diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index d8d32a1..336ee7c 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -185,10 +185,6 @@ future!"
        (insert (format "[[%s][%s]]" link name))
       link)))
 
-(defvar gnorb-org-window-conf nil
-  "Save org-buffer window configuration here, for restoration
-  after the mail is sent.")
-
 (defun gnorb-org-restore-after-send ()
   "After an email is sent, clean up the gnus summary buffer, put
 us back where we came from, and go through all the org ids that
@@ -196,12 +192,12 @@ might have been in the outgoing message's headers and call
 `gnorb-org-do-restore-action' on each one."
   (when (eq major-mode 'gnus-summary-mode)
     (gnus-summary-exit nil t))
-  (when (window-configuration-p gnorb-org-window-conf)
-    (set-window-configuration gnorb-org-window-conf))
+  (when (window-configuration-p gnorb-window-conf)
+    (set-window-configuration gnorb-window-conf))
   (dolist (id gnorb-message-org-ids)
     (gnorb-trigger-todo-action nil id))
   ;; this is a little unnecessary, but it may save grief
-  (setq gnorb-org-window-conf nil)
+  (setq gnorb-window-conf nil)
   (setq gnorb-gnus-sending-message-info nil)
   (setq gnorb-message-org-ids nil))
 
@@ -421,8 +417,8 @@ headings."
            (message-goto-to)
            (insert ", ")
            (insert (mapconcat 'identity mails ", "))))
-      (error (when (window-configuration-p gnorb-org-window-conf)
-              (set-window-configuration gnorb-org-window-conf))
+      (error (when (window-configuration-p gnorb-window-conf)
+              (set-window-configuration gnorb-window-conf))
             (signal (car err) (cdr err)))))
   ;; Return us after message is sent.
   (add-to-list 'message-exit-actions
@@ -492,7 +488,7 @@ current heading."
 (defun gnorb-org-handle-mail (&optional arg text file)
   "Handle current headline as a mail TODO."
   (interactive "P")
-  (setq gnorb-org-window-conf (current-window-configuration))
+  (setq gnorb-window-conf (current-window-configuration))
   (when (eq major-mode 'org-agenda-mode)
     (org-agenda-check-type t 'agenda 'timeline 'todo 'tags)
     (org-agenda-check-no-diary)
@@ -712,7 +708,7 @@ default set of parameters."
                     ,@opts
                     ,gnorb-org-email-subtree-file-parameters))))
         text file)
-    (setq gnorb-org-window-conf (current-window-configuration))
+    (setq gnorb-window-conf (current-window-configuration))
     (if (bufferp result)
        (setq text result)
       (setq file result))
@@ -838,7 +834,7 @@ This won't work unless you've added a \"nngnorb\" server to
 your gnus select methods."
   ;; this should also work on the active region, if there is one.
   (interactive)
-  (setq gnorb-org-window-conf (current-window-configuration))
+  (setq gnorb-window-conf (current-window-configuration))
   (when (eq major-mode 'org-agenda-mode)
     (org-agenda-check-type t 'agenda 'timeline 'todo 'tags)
     (org-agenda-check-no-diary)
@@ -855,8 +851,8 @@ your gnus select methods."
       (setq id (concat "id+" (org-id-get-create t))))
     (gnorb-gnus-search-messages
      id
-     `(when (window-configuration-p gnorb-org-window-conf)
-       (set-window-configuration gnorb-org-window-conf)))))
+     `(when (window-configuration-p gnorb-window-conf)
+       (set-window-configuration gnorb-window-conf)))))
 
 (provide 'gnorb-org)
 ;;; gnorb-org.el ends here
diff --git a/lisp/gnorb-utils.el b/lisp/gnorb-utils.el
index d197d43..650b1f5 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -79,7 +79,11 @@
   ;; on whether the message in question has an Org id header. Then
   ;; `gnorb-org-restore-after-send' checks for it and acts
   ;; appropriately, then sets it to nil.
-)
+  )
+
+(defvar gnorb-window-conf nil
+  "Save window configurations here, for restoration after mails
+are sent, or Org headings triggered.")
 
 (defcustom gnorb-mail-header "X-Org-ID"
   "Name of the mail header used to store the ID of a related Org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]