            (file (list file)))))
     (setq doIt (if (<= (length myFileList) 5)
                    t
-                 (y-or-n-p "Open more than 5 files? ") ) )
+                 (y-or-n-p "Open more than 5 files? ")))
     (when doIt
-      (cond
-       ((ar/windowsp)
-        (mapc (lambda (fPath) (w32-shell-execute "open" (replace-regexp-in-string "/" "\\" fPath t t)) ) myFileList))
-       ((ar/osxp)
-        (mapc (lambda (fPath) (shell-command (format "open \"%s\"" fPath)) )  myFileList) )
-       ((ar/gnulinuxp)
-        (mapc (lambda (fPath) (let ((process-connection-type nil)) (start-process "" nil "xdg-open" fPath)) ) myFileList) ) ) ) ) )
+      (mapc (ar/open-in-external-app-lambda) myFileList))))
+
 (global-set-key (kbd "C-M-o") 'xah-open-in-external-app)
 
 (setq ring-bell-function 'ignore)


(defun ar/markdown-mode-hook-function ()
  "Called when entering `markdown-mode'."
  (setq markdown-indent-on-enter nil)
  (define-key markdown-mode-map (kbd "RET") 'electric-newline-and-maybe-indent))

(ar/add-functions-to-mode-hooks '(ar/prog-mode-hook-function)
                                '(prog-mode-hook))

(eval-after-load "projectile"
  '(progn (setq magit-repo-dirs (mapcar (lambda (dir)
                                          (substring dir 0 -1))
                                        ;; Disables "required at runtime" warning for cl package.
                                        (with-no-warnings
                                          (remove-if-not (lambda (project)
                                                           (file-directory-p (concat project "/.git/")))
                                                         (projectile-relevant-known-projects))))
                magit-repo-dirs-depth 1)))

;; Select help window by default.
