From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: Compilation warnings and a test failure Date: Thu, 20 Dec 2012 10:23:04 +0100 Message-ID: <87obhpw007.fsf@Rainer.invalid> References: <5589.1355935596@alphaville> <878v8th8a4.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlcLj-0000fV-5F for emacs-orgmode@gnu.org; Thu, 20 Dec 2012 04:23:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlcLe-0000d9-FZ for emacs-orgmode@gnu.org; Thu, 20 Dec 2012 04:23:31 -0500 Received: from plane.gmane.org ([80.91.229.3]:59130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlcLe-0000d1-5K for emacs-orgmode@gnu.org; Thu, 20 Dec 2012 04:23:26 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TlcLj-0007vD-LP for emacs-orgmode@gnu.org; Thu, 20 Dec 2012 10:23:31 +0100 Received: from pd9eb3b90.dip.t-dialin.net ([217.235.59.144]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Dec 2012 10:23:31 +0100 Received: from Stromeko by pd9eb3b90.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Dec 2012 10:23:31 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Bastien writes: >> | In org-get-location: >> | org.el:6989:10:Warning: `special-display-function' is an obsolete variable (as >> | of 24.3); use `display-buffer-alist' instead. >> | org.el:6988:10:Warning: `special-display-regexps' is an obsolete variable (as >> | of 24.3); use `display-buffer-alist' instead. >> | org.el:6987:10:Warning: `special-display-buffer-names' is an obsolete variable >> | (as of 24.3); use `display-buffer-alist' instead. > > These are not trivial to fix. If someone wants to have a look, > please go ahead. Something like this maybe? --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-org-compat-new-macro-org-suppress-popups.patch Content-Transfer-Encoding: 8bit >From 089903a29936f00d76fd7bf082603c2dff242a5c Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Thu, 20 Dec 2012 10:18:02 +0100 Subject: [PATCH] org-compat: new macro org-suppress-popups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-compat.el (org-suppress-popups): New wrapper macro, let-binds the correct variables to suppress popup windows depending on Emacs version. * lisp/org.el (org-get-location, org-switch-to-buffer-other-window): Use the wrapper `org-suppress-popupsĀ“ to let-bind variables that are version-dependent. --- lisp/org-compat.el | 7 +++++ lisp/org.el | 86 ++++++++++++++++++++++++++---------------------------- 2 files changed, 48 insertions(+), 45 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 1f330b1..e8983f0 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -375,6 +375,13 @@ (defun org-float-time (&optional time) (unless (fboundp 'user-error) (defalias 'user-error 'error)) +(defmacro org-suppress-popups (&rest body) + (if (org-version-check "24.2.50" "" :predicate) + `(let (pop-up-frames display-buffer-alist) + ,@body) + `(let (pop-up-frames special-display-buffer-names special-display-regexps special-display-function) + ,@body))) + (if (fboundp 'string-match-p) (defalias 'org-string-match-p 'string-match-p) (defun org-string-match-p (regexp string &optional start) diff --git a/lisp/org.el b/lisp/org.el index e93356c..67fb8ed 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6982,48 +6982,45 @@ (defun org-get-location (buf help) "Let the user select a location in the Org-mode buffer BUF. This function uses a recursive edit. It returns the selected position or nil." - (let ((isearch-mode-map org-goto-local-auto-isearch-map) - (isearch-hide-immediately nil) - (isearch-search-fun-function - (lambda () 'org-goto-local-search-headings)) - (org-goto-selected-point org-goto-exit-command) - (pop-up-frames nil) - (special-display-buffer-names nil) - (special-display-regexps nil) - (special-display-function nil)) - (save-excursion - (save-window-excursion - (delete-other-windows) - (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) - (org-pop-to-buffer-same-window - (condition-case nil - (make-indirect-buffer (current-buffer) "*org-goto*") - (error (make-indirect-buffer (current-buffer) "*org-goto*")))) - (with-output-to-temp-buffer "*Help*" - (princ help)) - (org-fit-window-to-buffer (get-buffer-window "*Help*")) - (setq buffer-read-only nil) - (let ((org-startup-truncated t) - (org-startup-folded nil) - (org-startup-align-all-tables nil)) - (org-mode) - (org-overview)) - (setq buffer-read-only t) - (if (and (boundp 'org-goto-start-pos) - (integer-or-marker-p org-goto-start-pos)) - (let ((org-show-hierarchy-above t) - (org-show-siblings t) - (org-show-following-heading t)) - (goto-char org-goto-start-pos) - (and (outline-invisible-p) (org-show-context))) - (goto-char (point-min))) - (let (org-special-ctrl-a/e) (org-beginning-of-line)) - (message "Select location and press RET") - (use-local-map org-goto-map) - (recursive-edit) - )) - (kill-buffer "*org-goto*") - (cons org-goto-selected-point org-goto-exit-command))) + (org-suppress-popups + (let ((isearch-mode-map org-goto-local-auto-isearch-map) + (isearch-hide-immediately nil) + (isearch-search-fun-function + (lambda () 'org-goto-local-search-headings)) + (org-goto-selected-point org-goto-exit-command)) + (save-excursion + (save-window-excursion + (delete-other-windows) + (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) + (org-pop-to-buffer-same-window + (condition-case nil + (make-indirect-buffer (current-buffer) "*org-goto*") + (error (make-indirect-buffer (current-buffer) "*org-goto*")))) + (with-output-to-temp-buffer "*Help*" + (princ help)) + (org-fit-window-to-buffer (get-buffer-window "*Help*")) + (setq buffer-read-only nil) + (let ((org-startup-truncated t) + (org-startup-folded nil) + (org-startup-align-all-tables nil)) + (org-mode) + (org-overview)) + (setq buffer-read-only t) + (if (and (boundp 'org-goto-start-pos) + (integer-or-marker-p org-goto-start-pos)) + (let ((org-show-hierarchy-above t) + (org-show-siblings t) + (org-show-following-heading t)) + (goto-char org-goto-start-pos) + (and (outline-invisible-p) (org-show-context))) + (goto-char (point-min))) + (let (org-special-ctrl-a/e) (org-beginning-of-line)) + (message "Select location and press RET") + (use-local-map org-goto-map) + (recursive-edit) + )) + (kill-buffer "*org-goto*") + (cons org-goto-selected-point org-goto-exit-command)))) (defvar org-goto-local-auto-isearch-map (make-sparse-keymap)) (set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map) @@ -20967,9 +20964,8 @@ (defun org-switch-to-buffer-other-window (&rest args) "Switch to buffer in a second window on the current frame. In particular, do not allow pop-up frames. Returns the newly created buffer." - (let (pop-up-frames special-display-buffer-names special-display-regexps - special-display-function) - (apply 'switch-to-buffer-other-window args))) + (org-suppress-popups + (apply 'switch-to-buffer-other-window args))) (defun org-combine-plists (&rest plists) "Create a single property list from all plists in PLISTS. -- 1.8.0.1 --=-=-= Content-Type: text/plain >> | In org-shiftcontrolup: >> | org.el:19234:11:Warning: org-clock-timestamps-up called with 1 argument, but >> | accepts only 0 >> | >> | In org-shiftcontroldown: >> | org.el:19244:11:Warning: org-clock-timestamps-down called with 1 argument, but >> | accepts only 0 > > Fixed, thanks. [...] > Same as above. > >> and a test failure: > > Fixed too, thanks! Confirmed. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf rackAttack V1.04R1: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada --=-=-=--