 more profiles using `profile-create' in your \"~/.emacs\" or
 interactively.")
 
+(defmacro profile--called-interactively-p (&optional kind)
+  "A backward-compatible version of `called-interactively-p'.
+Optional KIND is as documented at `called-interactively-p'
+in GNU Emacs 24.1 or higher.
+This was shamelessly stolen from yasnippet."
+  (if (string< emacs-version "24.1")
+      '(called-interactively-p)
+    `(called-interactively-p ,kind)))
+
 ;;; ----------------------------------------------------------------------------
 ;;; Functions
 

(defun profile-set-default (profile-name)
  "Make PROFILE-NAME the default profile. The profile must exists."
  (interactive "i")
  (if (called-interactively-p 'interactive)
      (setq profile-name
            (completing-read "Set default profile: "
                             profile-obarray nil t

and a specific PROFILE-NAME from the user if called
interactively."
  (interactive "i\ni") ; ignore both arguments, we'll set them later
  (if (profile--called-interactively-p 'interactive)
      (progn
        (setq regexp (read-file-name "Path regexp: "
                                     (buffer-file-name)))
