From 0bc3f9d58bb16842dd85dbc1569072a2bed221a2 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 25 Jul 2016 16:01:15 +0200 Subject: [PATCH] org-src: Use cl-lib * lisp/org-src.el (org-src-switch-to-buffer): Silence byte-compiler. --- lisp/org-src.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 3f9817714..892c52e38 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -26,16 +26,16 @@ ;; ;;; Commentary: -;; This file contains the code dealing with source code examples in Org-mode. +;; This file contains the code dealing with source code examples in +;; Org mode. ;;; Code: +(require 'cl-lib) (require 'org-macs) (require 'org-compat) (require 'ob-keys) (require 'ob-comint) -(eval-when-compile (require 'cl)) -(require 'cl-lib) (declare-function org-base-buffer "org" (buffer)) (declare-function org-do-remove-indentation "org" (&optional n)) @@ -691,26 +691,26 @@ If BUFFER is non-nil, test it instead." (local-variable-p 'org-src--end-marker buffer)))) (defun org-src-switch-to-buffer (buffer context) - (case org-src-window-setup - (current-window (pop-to-buffer-same-window buffer)) - (other-window + (pcase org-src-window-setup + (`current-window (pop-to-buffer-same-window buffer)) + (`other-window (switch-to-buffer-other-window buffer)) - (other-frame - (case context - (exit + (`other-frame + (pcase context + (`exit (let ((frame (selected-frame))) (switch-to-buffer-other-frame buffer) (delete-frame frame))) - (save + (`save (kill-buffer (current-buffer)) (pop-to-buffer-same-window buffer)) - (t (switch-to-buffer-other-frame buffer)))) - (reorganize-frame + (_ (switch-to-buffer-other-frame buffer)))) + (`reorganize-frame (when (eq context 'edit) (delete-other-windows)) (org-switch-to-buffer-other-window buffer) (when (eq context 'exit) (delete-other-windows))) - (switch-invisibly (set-buffer buffer)) - (t + (`switch-invisibly (set-buffer buffer)) + (_ (message "Invalid value %s for `org-src-window-setup'" org-src-window-setup) (pop-to-buffer-same-window buffer)))) -- 2.11.4.GIT