Mercurial > utils
changeset 550:9778a70260f0
Remove file at point and whole line from find-dup output.
author | Oleksandr Gavenko <gavenkoa@gmail.com> |
---|---|
date | Sat, 22 Dec 2012 19:44:07 +0200 |
parents | 41c5dab96724 |
children | 0095a5a71355 |
files | misc/cleanupdoc-find-dup.el |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/cleanupdoc-find-dup.el Sat Dec 22 19:44:07 2012 +0200 @@ -0,0 +1,28 @@ + +(defun my-help () + "Remove file at point and whole line from find-dup output." + (interactive) + (let ( (curr (line-number-at-pos)) file beg end ) + (save-excursion + (search-forward " == ") + (cond + ((equal (line-number-at-pos) curr) + (setq end (- (point) 4)) + (beginning-of-line) + (setq beg (point)) + (setq file (buffer-substring beg end)) + ) + (t + (search-backward "\n") + (setq end (point)) + (search-backward " == ") + (setq beg (+ (point) 4)) + (setq file (buffer-substring beg end)) + ) + )) + ;; (message "%s" file) + (delete-file file) + (kill-whole-line) + )) + +;; (local-set-key [C-return] 'my-help)