Re: CC mode: load file below cursor ?

"David A. Panariti" <[email protected]>
Newsgroups gmane.emacs.xemacs.general
Message-ID <[email protected]>
Please excuse me if there are two copies of this... I had a sendmail
problem. 

>>>>> "Markus" == Markus Grunwald <[email protected]> writes:
   Markus> Hello,

   Markus> is there a way to load the file whose filename is below the cursor
   Markus> ?

   Markus> #include "../directory/includefile.h"
   Markus> // Cursor is here ^

   Markus> Now when i invoke some function, a buffer with
   Markus> "../directory/includefile.h" is opened.

   Markus> Dont't invest too much time: if there is no such function I'll try
   Markus> to create it myself.
Yes there is such a function: `find-file-at-point'.
It does that and a whole lot more... it is (for me) almost always correct.
I set it up like this:
  (require 'ffap)			; load the package
  (ffap-bindings)			; do default key bindings
  ;; the builtin ds.internic.net seems to be history
  ;; alternates: 
  ;; NIS.NSF.NET:/internet/documents/rfc/rfc%s.txt
  ;; FTP.RFC-EDITOR.ORG:/in-notes/rfc%s.txt
  ;; SUNSITE.ORG.UK:rfc/rfc%s.txt
  ;; ftp.isi.edu:/in-notes/rfc%s.txt
  ;; send mail to: [email protected] w/body: help: ways_to_get_rfcs
  ;;  to get info about obtaining rfcs.
  (setq ffap-rfc-path
      (concat (ffap-host-to-path "ftp.rfc-editor.org") 
	      "/in-notes/rfc%s.txt"))
  (setq ffap-c-path (append ffap-c-path '("." "../h" "../inc" "../include")))
Set the above to whatever makes sense in your environment.

--
       /  
davep (|) No man is an island, but some of us are long peninsulas.
       /  
$
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.