     (pop-to-buffer standard-output)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Utilities Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; For compatibility
+(unless (fboundp 'region-active-p)
+  (defun region-active-p ()
+    "Return t if Transient Mark mode is enabled and the mark is active.
+
+Most commands that act on the region if it is active and
+Transient Mark mode is enabled, and on the text near point
+otherwise, should use `use-region-p' instead.  That function
+checks the value of `use-empty-active-region' as well."
+    (and transient-mark-mode mark-active)))
+
 (defun anything-nest (&rest same-as-anything)
   "Nested `anything'. If you use `anything' within `anything', use it."
   (with-selected-window (anything-window)


(defun anything-c-transform-file-browse-url (actions candidate)
  "Add an action to browse the file CANDIDATE if it in a html
file.  Else return ACTIONS unmodified."
  (if (or (string= (file-name-extension candidate) "htm")
          (string= (file-name-extension candidate) "html"))
      (append actions '(("Browse with Browser" . browse-url)))
    actions))

;;;; Function

(define-anything-type-attribute 'bookmark
  '((action
     ("Jump to bookmark" . (lambda (candidate)
                             (bookmark-jump candidate)
                             (anything-update)
                             (condition-case nil
                                 (when bookmark-use-region
                                   (let ((bmk-name (or (bookmark-get-buffername candidate)
                                                       (file-name-nondirectory
                                                        (bookmark-get-filename candidate)))))
                                     (when bmk-name
                                       (with-current-buffer bmk-name
                                         (setq deactivate-mark nil)))))
                               (error nil))))
     ("Jump to BM other window" . (lambda (candidate)
                                    (bookmark-jump-other-window candidate)
                                    (anything-update)))
