<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -680,6 +680,17 @@ The output is sexps which are evaluated by \\[eval-last-sexp].&quot;
     (pop-to-buffer standard-output)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Utilities Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; For compatibility
+(unless (fboundp 'region-active-p)
+  (defun region-active-p ()
+    &quot;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.&quot;
+    (and transient-mark-mode mark-active)))
+
 (defun anything-nest (&amp;rest same-as-anything)
   &quot;Nested `anything'. If you use `anything' within `anything', use it.&quot;
   (with-selected-window (anything-window)
@@ -1419,11 +1430,51 @@ http://www.nongnu.org/bm/&quot;)
         collect (propertize i 'face anything-c-bookmarks-face3)))
 
 (defun anything-c-highlight-bookmark (files)
+  &quot;Colors mean:
+Grey ==&gt; non--buffer-filename with saved region or not.
+Yellow ==&gt; w3m url with saved region.
+Green ==&gt; info buffer with saved region.
+Blue ==&gt; regular file with maybe a region saved.
+RedOnWhite ==&gt; Directory.&quot;
   (loop for i in files
-        if (file-directory-p (bookmark-get-filename i))
-        collect (propertize i 'face anything-c-bookmarks-face1)
-        else
-        collect (propertize i 'face anything-c-bookmarks-face2)))
+     for pred = (bookmark-get-filename i)
+     for bufp = (and (fboundp 'bookmark-get-buffername)
+                     (bookmark-get-buffername i))
+     for regp = (and (fboundp 'bookmark-get-endposition)
+                     (bookmark-get-endposition i))
+     for handlerp = (and (fboundp 'bookmark-get-handler)
+                         (bookmark-get-handler i))
+     if (and pred ;; directories
+             (file-directory-p pred))
+     collect (propertize i 'face anything-c-bookmarks-face1)
+     if (and pred ;; regular files
+             (not (file-directory-p pred))
+             (file-exists-p pred)
+             (not regp))
+     collect (propertize i 'face anything-c-bookmarks-face2)
+     if (and pred ;; regular files with regions saved
+             (not (file-directory-p pred))
+             (file-exists-p pred)
+             regp)
+     collect (propertize i 'face '((:foreground &quot;Indianred2&quot;)))
+     if (and (fboundp 'bookmark-get-buffername) ;; buffer non--filename
+             bufp
+             (not pred))
+     collect (propertize i 'face '((:foreground &quot;grey&quot;)))
+     if (and (fboundp 'bookmark-get-buffername) ;; w3m buffers
+             (string= bufp &quot;*w3m*&quot;)
+             (when pred
+               (not (file-exists-p pred))))
+     collect (propertize i 'face '((:foreground &quot;yellow&quot;)))
+     if (and (fboundp 'bookmark-get-buffername) ;; info buffers
+             (or
+              (eq handlerp 'Info-bookmark-jump)
+              (and
+               (string= bufp &quot;*info*&quot;)
+               (when pred
+                 (not (file-exists-p pred))))))
+     collect (propertize i 'face '((:foreground &quot;green&quot;)))))
+       
 
 (defvar anything-c-source-bookmarks-local
   '((name . &quot;Bookmarks-Local&quot;)
@@ -3323,10 +3374,9 @@ file.  Else return ACTIONS unmodified.&quot;
 
 (defun anything-c-transform-file-browse-url (actions candidate)
   &quot;Add an action to browse the file CANDIDATE if it in a html
-file.  Else return ACTIONS unmodified.&quot;
-  (if (or (string= (file-name-extension candidate) &quot;htm&quot;)
-          (string= (file-name-extension candidate) &quot;html&quot;))
-      (append actions '((&quot;Browse with Browser&quot; . browse-url)))
+file or URL.  Else return ACTIONS unmodified.&quot;
+  (if (string-match &quot;^http\\|^ftp\\|html?$&quot; candidate)
+      (cons '(&quot;Browse with Browser&quot; . browse-url) actions )
     actions))
 
 ;;;; Function
@@ -3798,8 +3848,17 @@ If optional 2nd argument is non-nil, the file opened with `auto-revert-mode'.&quot;)
 (define-anything-type-attribute 'bookmark
   '((action
      (&quot;Jump to bookmark&quot; . (lambda (candidate)
-                                    (bookmark-jump candidate)
-                                    (anything-update)))
+                             (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))))
      (&quot;Jump to BM other window&quot; . (lambda (candidate)
                                     (bookmark-jump-other-window candidate)
                                     (anything-update)))</diff>
      <filename>site-lisp/anything/anything-config.el</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fe853a5bc640e7f0e271f374e1c1a30dec9969fe</id>
    </parent>
  </parents>
  <author>
    <name>Steve Purcell</name>
    <email>steve@sanityinc.com</email>
  </author>
  <url>http://github.com/purcell/emacs.d/commit/8ed7bdb021fc2c0f7fb566d61968e79b34a06444</url>
  <id>8ed7bdb021fc2c0f7fb566d61968e79b34a06444</id>
  <committed-date>2009-06-14T06:59:01-07:00</committed-date>
  <authored-date>2009-06-12T01:42:07-07:00</authored-date>
  <message>Update anything-config from upstream</message>
  <tree>bca7b3ebb5ccfe74276eff356fcdb0b0abfa57f7</tree>
  <committer>
    <name>Steve Purcell</name>
    <email>steve@sanityinc.com</email>
  </committer>
</commit>
