Skip to content

Instantly share code, notes, and snippets.

@lewang
Created January 1, 2012 03:30
Show Gist options
  • Save lewang/1546148 to your computer and use it in GitHub Desktop.
Save lewang/1546148 to your computer and use it in GitHub Desktop.
patch for anything-config.el fix anything-regexp issue with folded text
diff --git a/anything-config.el b/anything-config.el
index dbfdcd0..abfa1e8 100644
--- a/anything-config.el
+++ b/anything-config.el
@@ -2149,15 +2149,22 @@ Default is `anything-current-buffer'."
(defun anything-region-active-p ()
(and transient-mark-mode mark-active (/= (mark) (point))))
-(defun anything-goto-line (lineno)
- "Goto LINENO opening only outline headline if needed."
- (goto-char (point-min)) (forward-line (1- lineno))
+(defun anything-goto-char (loc)
+ "Go to char, revealing if necessary."
+ (goto-char loc)
(when (or (eq major-mode 'org-mode)
(and (boundp 'outline-minor-mode)
outline-minor-mode))
(require 'org) ; On some old Emacs versions org may not be loaded.
- (org-reveal))
- (anything-match-line-color-current-line) (sit-for 0.3)
+ (org-reveal)))
+
+(defun anything-goto-line (lineno)
+ "Goto LINENO opening only outline headline if needed.
+Animation is used."
+ (goto-char (point-min))
+ (anything-goto-char (point-at-bol lineno))
+ (anything-match-line-color-current-line)
+ (sit-for 0.3)
(anything-match-line-cleanup))
(defun anything-show-this-source-only ()
@@ -2450,7 +2457,7 @@ i.e Don't replace inside a word, regexp is surrounded with \\bregexp\\b."
(1- s)))
(defun anything-c-regexp-persistent-action (pt)
- (goto-char pt)
+ (anything-goto-char pt)
(anything-persistent-highlight-point))
(defun anything-c-regexp-kill-new (input)
@@ -6991,7 +6998,7 @@ If not found in CURRENT-DIR search in upper directory."
(let ((tag-path (expand-file-name
anything-c-etags-tag-file-name dir)))
(and (stringp tag-path)
- (file-exists-p tag-path)
+ (file-regular-p tag-path)
(file-readable-p tag-path)))))
(loop with count = 0
until (file-exists? current-dir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment