From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "qingwuking@gmail.com" Newsgroups: gmane.emacs.help Subject: Re: How to get current filename and absolute path of the file in emacs? Date: 16 Apr 2007 02:33:56 -0700 Organization: http://groups.google.com Message-ID: <1176716036.339716.275190@y80g2000hsf.googlegroups.com> References: <87r6qkhpqd.fsf@voyager.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1176716191 3302 80.91.229.12 (16 Apr 2007 09:36:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2007 09:36:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 16 11:36:25 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HdNdI-0007GG-NQ for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Apr 2007 11:36:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdNht-0008Mf-AJ for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Apr 2007 05:41:09 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!y80g2000hsf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: 220.231.9.237 Original-X-Trace: posting.google.com 1176716036 25475 127.0.0.1 (16 Apr 2007 09:33:56 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 16 Apr 2007 09:33:56 +0000 (UTC) In-Reply-To: <87r6qkhpqd.fsf@voyager.informatimago.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: y80g2000hsf.googlegroups.com; posting-host=220.231.9.237; posting-account=uWH2pQ0AAAAEj7SeC_wHiwbnp9OYGRBR Original-Xref: shelby.stanford.edu gnu.emacs.help:147117 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42721 Archived-At: On 4=D4=C216=C8=D5, =CF=C2=CE=E71=CA=B107=B7=D6, Pascal Bourguignon wrote: > QinGW writes: > > I want to put current filename and file path to clipboard and I cant > > get it by short key.how can I implement it? > > Thank a lot. > > M-x apropos RET file name RET > > We find a buffer-file-name function... interesting! > > Now, how to put that in the clipboard? We know that when you type > C-w, the selection is put in the clipboard, so: > > C-h k C-w > > then click on simple.el (or type C-x o TAB RET) and read the source of > kill-region. We see that it calls kill-new; we move the cursor on > kill-new and type C-h f RET > > (global-set-key (kbd "M-z") > (lambda () > (interactive) > (kill-new (buffer-file-name)))) > > -- > __Pascal Bourguignon__ Thanks, That's great!