Pārlūkot izejas kodu

org-src: Use cl-lib

* lisp/org-src.el (org-src-switch-to-buffer): Silence byte-compiler.
Nicolas Goaziou 8 gadi atpakaļ
vecāks
revīzija
0bc3f9d58b
1 mainītis faili ar 14 papildinājumiem un 14 dzēšanām
  1. 14 14
      lisp/org-src.el

+ 14 - 14
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))))