Re: Need help with function

"David A. Panariti" <[email protected]> Wed, 14 Jul 2004 05:18:43 -0400 (EDT)
Newsgroups gmane.emacs.xemacs.general
Message-ID <[email protected]>
>>>>> "Markus" == Markus Grunwald <[email protected]> writes:
   Markus> Hello,

   Markus> Perhaps you could help me with this function: I need a function
   Markus> that puts a string with the actual filename, a colon and the line
   Markus> of point into the X Clipboard. It should look like this:

   CPTClassname.cpp> 42

   Markus> I want to paste this to DDD ...

   Markus> I came up with this so far, but emacs complains: "Invalid
   Markus> function: (own-clipboard (file-name-nondirectory
   Markus> buffer-file-name))"

   Markus> (defun mg-copy-position()
   Markus>   "Copy a string of the form filename:linenumber into the
   Markus>   clipboard" (interactive) ( (own-clipboard
   Markus>   (file-name-nondirectory buffer-file-name) ) ) )
Here:
This will get you farther.  The clipboard part doesn't work... it's always
been FM to me. You had an extra paren before own-clipboard.

(defun mg-copy-position()
  "Copy a string of the form filename:linenumber into the clipboard"
  (interactive)
  (own-clipboard 
   (format "%s%s%s" (file-name-nondirectory buffer-file-name) 
	   ":" (line-number))))

   Markus> As you see, It also completely lacks the combination of filename,
   Markus> ":" and line...

   Markus> Any help will be welcome,

   Markus> Markus Grunwald Softwareentwicklung

   Markus> PRÜFTECHNIK Condition Monitoring GmbH Oskar-Messter-Straße 19-21
   Markus> 85737 Ismaning www.pruftechnik.com
   Tel> +49 (0)89 99616177
   Fax> +49 (0)89 99616200




--
       /  
davep (|) Dime is money.
       /  
$$$