diff options
author | Naohiro Aota <naota@gentoo.org> | 2011-10-21 07:43:19 +0000 |
---|---|---|
committer | Naohiro Aota <naota@gentoo.org> | 2011-10-21 07:43:19 +0000 |
commit | 3eb9ddfae826a1effae764bc683a079eaf469197 (patch) | |
tree | d5ee2883c81b04bf1d48ab4656d747431236aff8 /app-emacs/popwin | |
parent | Add rbx support. (diff) | |
download | gentoo-2-3eb9ddfae826a1effae764bc683a079eaf469197.tar.gz gentoo-2-3eb9ddfae826a1effae764bc683a079eaf469197.tar.bz2 gentoo-2-3eb9ddfae826a1effae764bc683a079eaf469197.zip |
Add a patch to work on emacs24. Bug #385167
(Portage version: 2.2.0_alpha67/cvs/Linux x86_64)
Diffstat (limited to 'app-emacs/popwin')
-rw-r--r-- | app-emacs/popwin/ChangeLog | 8 | ||||
-rw-r--r-- | app-emacs/popwin/files/popwin-0.3-emacs24.patch | 135 | ||||
-rw-r--r-- | app-emacs/popwin/popwin-0.3-r1.ebuild (renamed from app-emacs/popwin/popwin-0.3.ebuild) | 5 |
3 files changed, 145 insertions, 3 deletions
diff --git a/app-emacs/popwin/ChangeLog b/app-emacs/popwin/ChangeLog index fa00fd855053..87e12f5dc33b 100644 --- a/app-emacs/popwin/ChangeLog +++ b/app-emacs/popwin/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-emacs/popwin # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emacs/popwin/ChangeLog,v 1.2 2011/10/08 09:28:15 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emacs/popwin/ChangeLog,v 1.3 2011/10/21 07:43:19 naota Exp $ + +*popwin-0.3-r1 (21 Oct 2011) + + 21 Oct 2011; Naohiro Aota <naota@gentoo.org> -popwin-0.3.ebuild, + +popwin-0.3-r1.ebuild, +files/popwin-0.3-emacs24.patch: + Add a patch to work on emacs24 08 Oct 2011; Ulrich Mueller <ulm@gentoo.org> files/50popwin-gentoo.el, popwin-0.3.ebuild: diff --git a/app-emacs/popwin/files/popwin-0.3-emacs24.patch b/app-emacs/popwin/files/popwin-0.3-emacs24.patch new file mode 100644 index 000000000000..0aa7cb2d8ca6 --- /dev/null +++ b/app-emacs/popwin/files/popwin-0.3-emacs24.patch @@ -0,0 +1,135 @@ +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 @@ + + + +-;;; 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." diff --git a/app-emacs/popwin/popwin-0.3.ebuild b/app-emacs/popwin/popwin-0.3-r1.ebuild index 3ee9fced2911..bfe704019097 100644 --- a/app-emacs/popwin/popwin-0.3.ebuild +++ b/app-emacs/popwin/popwin-0.3-r1.ebuild @@ -1,11 +1,11 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emacs/popwin/popwin-0.3.ebuild,v 1.2 2011/10/08 09:28:15 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emacs/popwin/popwin-0.3-r1.ebuild,v 1.1 2011/10/21 07:43:19 naota Exp $ EAPI=3 NEED_EMACS=22 -inherit elisp +inherit elisp eutils DESCRIPTION="Popup window manager for Emacs" HOMEPAGE="https://github.com/m2ym/popwin-el/" @@ -18,6 +18,7 @@ IUSE="" SITEFILE="50${PN}-gentoo.el" DOCS="README.markdown" +ELISP_PATCHES=( "${FILESDIR}/${P}-emacs24.patch" ) src_unpack() { unpack ${A} |