help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Switch to buffer and line...


From: luca . spinacci
Subject: Switch to buffer and line...
Date: Thu, 20 Oct 2005 14:59:45 +0200


I have a buffer with number line and name of the new buffer to switch to:
pointing the
curson on the number line my function search backward for the name of the
buffer and
switch to that, but once it gets there the goto-line function doesn't take
me to the requested
line...


(defun retrieve-buffer-and-line-at-point()
  (interactive)
  ( save-excursion(if(number-at-point) ; check if the cursor is pointing a 
number of line
       (setq target (number-at-point)))
       (call-interactively 'switch-at-point) ; switch to buffer: it works 
correctly!
       (if(current-buffer)
       (goto-line target))))                             ; does nothing???

(defun switch-at-point()
  (interactive)
  (
   save-excursion(
     if(search-backward "in buffer: ")
     (
      save-excursion(end-of-line)
        (if(thing-at-point 'sexp)
            (switch-to-buffer(thing-at-point 'filename)))))))

Thanks in advance,
Luca.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]