[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: something to jump to file:line
From: |
Roman Suzi |
Subject: |
Re: something to jump to file:line |
Date: |
Sun, 23 Sep 2001 01:33:15 +0400 (MSD) |
On Sun, 23 Sep 2001, Roman Suzi wrote:
>Hello!
>I can control the format of mytags and put anything on lines.
>Even this is no problem:
>
>(go 'file1.txt' '12')
>(go 'file1.txt' '190')
>...
>
>- if there is a key which I can press to go to the specified line. Lots of
>modes work like that but I am no Elisp guru to learn how to do it :-(
>
>Any ideas? Thank you!
;;; Well, I managed to do it this way:
(defun go (file line str)
;; (interactive)
(progn
(beginning-of-line)
(find-file-other-window file)
(goto-line line)
(search-forward str)
(search-backward str)
)
)
(defun go-file-line ()
(interactive)
(progn
(end-of-line)
(eval-last-sexp nil)
)
)
(global-set-key [(control c) right] 'go-file-line)
;;; If you have better ideas, please let me know. Thanks
Sincerely yours, Roman Suzi
--
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/
_/ Saturday, September 22, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "A clean desk is a sign of a cluttered desk drawer." _/