diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-07-25 16:01:15 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-07-25 16:01:15 +0200 |
commit | 0bc3f9d58bb16842dd85dbc1569072a2bed221a2 (patch) | |
tree | f398375613b3d0e6f816e277f8ce9ef4643d80d1 | |
parent | 7c5416958cdf69f7a33a79a9610faf1237fadb41 (diff) | |
download | org-mode-0bc3f9d58bb16842dd85dbc1569072a2bed221a2.tar.gz |
org-src: Use cl-lib
* lisp/org-src.el (org-src-switch-to-buffer): Silence byte-compiler.
-rw-r--r-- | lisp/org-src.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el index 3f98177..892c52e 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)))) |