public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in app-emacs/popwin/files: popwin-0.3-emacs24.patch
@ 2011-10-21  7:43 Naohiro Aota (naota)
  0 siblings, 0 replies; 2+ messages in thread
From: Naohiro Aota (naota) @ 2011-10-21  7:43 UTC (permalink / raw
  To: gentoo-commits

naota       11/10/21 07:43:19

  Added:                popwin-0.3-emacs24.patch
  Log:
  Add a patch to work on emacs24. Bug #385167
  
  (Portage version: 2.2.0_alpha67/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  app-emacs/popwin/files/popwin-0.3-emacs24.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emacs/popwin/files/popwin-0.3-emacs24.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emacs/popwin/files/popwin-0.3-emacs24.patch?rev=1.1&content-type=text/plain

Index: popwin-0.3-emacs24.patch
===================================================================
diff --git a/popwin.el b/popwin.el
index 22f64f0..a5bafeb 100644
--- a/popwin.el
+++ b/popwin.el
@@ -4,7 +4,7 @@
 
 ;; Author: Tomohiro Matsuyama <tomo@cx4a.org>
 ;; Keywords: convenience
-;; Version: 0.3
+;; Version: 0.4
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -69,7 +69,19 @@
 
 \f
 
-;;; Common API
+;;; Common
+
+(defmacro popwin:save-selected-window (&rest body)
+  "Evaluate BODY saving the selected window."
+  `(with-selected-window (selected-window) ,@body))
+
+(defun popwin:switch-to-buffer (buffer-or-name &optional norecord)
+  "Call `switch-to-buffer' forcing BUFFER-OF-NAME be displayed in
+the selected window."
+  (with-no-warnings 
+    (if (>= emacs-major-version 24)
+        (switch-to-buffer buffer-or-name norecord t)
+      (switch-to-buffer buffer-or-name norecord))))
 
 (defun popwin:last-selected-window ()
   "Return currently selected window or lastly selected window if
@@ -82,6 +94,12 @@ minibuffer window is selected."
   "Return t if BUFFER might be thought of as a buried buffer."
   (eq (car (last (buffer-list))) buffer))
 
+(defun popwin:called-interactively-p ()
+  (with-no-warnings
+    (if (>= emacs-major-version 23)
+        (called-interactively-p 'any)
+      (called-interactively-p))))
+
 (defvar popwin:empty-buffer nil
   "Marker buffer of indicating a window of the buffer is being a
 popup window.")
@@ -142,7 +160,7 @@ horizontal factor HFACTOR, and vertical factor VFACTOR."
           (cdr node)
         (popwin:adjust-window-edges window edges hfactor vfactor)
         (with-selected-window window
-          (switch-to-buffer buffer t))
+          (popwin:switch-to-buffer buffer t))
         (when selected
           (select-window window)))
     (destructuring-bind (dir edges . windows) node
@@ -221,7 +239,8 @@ window-configuration."
          (root-win (popwin:last-selected-window))
          (hfactor 1)
          (vfactor 1))
-    (delete-other-windows root-win)
+    (popwin:save-selected-window
+     (delete-other-windows root-win))
     (let ((root-width (window-width root-win))
           (root-height (window-height root-win)))
       (when adjust
@@ -238,7 +257,7 @@ window-configuration."
           (popwin:create-popup-window-1 root-win size position)
         ;; Mark popup-win being a popup window.
         (with-selected-window popup-win
-          (switch-to-buffer (popwin:empty-buffer) t))
+          (popwin:switch-to-buffer (popwin:empty-buffer) t))
         (popwin:replicate-window-config master-win root hfactor vfactor)
         (list master-win popup-win)))))
 
@@ -410,7 +429,7 @@ BUFFER."
               popwin:selected-window (selected-window))
         (popwin:start-close-popup-window-timer))))
   (with-selected-window popwin:popup-window
-    (switch-to-buffer buffer))
+    (popwin:switch-to-buffer buffer))
   (setq popwin:popup-buffer buffer
         popwin:popup-window-stuck-p stick)
   (if noselect
@@ -438,6 +457,10 @@ be closed by `popwin:close-popup-window'."
 
 ;;; Special Display
 
+(defmacro popwin:without-special-display (&rest body)
+  "Evaluate BODY without special displaying."
+  `(let (display-buffer-function special-display-function) ,@body))
+
 (defcustom popwin:special-display-config
   '(("*Help*")
     ("*Completions*" :noselect t)
@@ -481,13 +504,19 @@ buffers will be shown at the left of the frame with width 80."
 
 (defun popwin:original-display-buffer (buffer &optional not-this-window)
   "Call `display-buffer' for BUFFER without special displaying."
-  (let (display-buffer-function special-display-function)
-    ;; Close the popup window here so that the popup window won't to
-    ;; be splitted.
-    (when (and (eq (selected-window) popwin:popup-window)
-               (not (same-window-p (buffer-name buffer))))
-      (popwin:close-popup-window))
-    (display-buffer buffer not-this-window)))
+  (popwin:without-special-display
+   ;; Close the popup window here so that the popup window won't to
+   ;; be splitted.
+   (when (and (eq (selected-window) popwin:popup-window)
+              (not (same-window-p (buffer-name buffer))))
+     (popwin:close-popup-window))
+   (if (and (>= emacs-major-version 24)
+            (boundp 'action)
+            (boundp 'frame))
+       ;; Use variables ACTION and FRAME which are formal parameters
+       ;; of DISPLAY-BUFFER.
+       (display-buffer buffer action frame)
+     (display-buffer buffer not-this-window))))
 
 (defun* popwin:display-buffer-1 (buffer-or-name &key default-config-keywords if-buffer-not-found if-config-not-found)
   "Display BUFFER-OR-NAME, if possible, in a popup
@@ -548,9 +577,9 @@ usual. This function can be used as a value of
   (popwin:display-buffer-1
    buffer-or-name
    :if-config-not-found
-   (unless (interactive-p)
-     (lambda (buffer-or-name)
-       (popwin:original-display-buffer buffer-or-name not-this-window)))))
+   (unless (popwin:called-interactively-p)
+     (lambda (buffer)
+       (popwin:original-display-buffer buffer not-this-window)))))
 
 (defun popwin:special-display-popup-window (buffer &rest ignore)
   "The `special-display-function' with a popup window."






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

* [gentoo-commits] gentoo-x86 commit in app-emacs/popwin/files: popwin-0.3-emacs24.patch
@ 2014-02-27 18:00 Ulrich Mueller (ulm)
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Mueller (ulm) @ 2014-02-27 18:00 UTC (permalink / raw
  To: gentoo-commits

ulm         14/02/27 18:00:00

  Removed:              popwin-0.3-emacs24.patch
  Log:
  Version bump. Remove old.
  
  (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 9433907D693FB5B8!)


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

end of thread, other threads:[~2014-02-27 18:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-27 18:00 [gentoo-commits] gentoo-x86 commit in app-emacs/popwin/files: popwin-0.3-emacs24.patch Ulrich Mueller (ulm)
  -- strict thread matches above, loose matches on Subject: below --
2011-10-21  7:43 Naohiro Aota (naota)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox