From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How to put default-directory into kill-ring? Date: Fri, 14 Feb 2014 19:41:30 +0100 Organization: WMI UAM Message-ID: <20140214194130.497c0ecd@aga-netbook> References: <20140214134109.23226acb@aga-netbook> <87r475byoc.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1392403304 2124 80.91.229.3 (14 Feb 2014 18:41:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2014 18:41:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 14 19:41:53 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WENhw-0002Ev-I5 for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Feb 2014 19:41:52 +0100 Original-Received: from localhost ([::1]:53341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WENhv-00015A-On for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Feb 2014 13:41:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WENhh-00013o-9Y for help-gnu-emacs@gnu.org; Fri, 14 Feb 2014 13:41:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WENhd-0002G4-38 for help-gnu-emacs@gnu.org; Fri, 14 Feb 2014 13:41:37 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:35964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WENhc-0002FR-Sm for help-gnu-emacs@gnu.org; Fri, 14 Feb 2014 13:41:33 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 5A20042066 for ; Fri, 14 Feb 2014 19:41:32 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JoA+WLMJQIBY for ; Fri, 14 Feb 2014 19:41:32 +0100 (CET) Original-Received: from aga-netbook (jedenzero6-jeden5osiem.echostar.pl [213.156.106.158]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 34E1B42061 for ; Fri, 14 Feb 2014 19:41:32 +0100 (CET) In-Reply-To: <87r475byoc.fsf@yahoo.fr> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.20; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96087 Archived-At: Dnia 2014-02-14, o godz. 14:40:03 Nicolas Richard napisa=C5=82(a): > Stefan Monnier writes: >=20 > >> Well, as I wrote: M-x pwd currently does *nothing* with its prefix > >> argument, and only outputs the default directory in the minibuffer. > >> So C-u M-x pwd is basically "wasted". > > > > I guess that would be OK. Please M-x report-emacs-bug requesting > > this as a new feature, to see what other developers think about it > > (and so it's not forgotten until the trunk is unfrozen). > > > > I think M-: would also benefit from changing its "C-u means to > > insert at point" to "C-u means to stash in the kill-ring". Tho, if > > we could find a generic way to "get the message from this command > > and stash it in the kill-ring" it might be even better. >=20 > As a related question, I wish I had something for getting what's in > the echo area. I currently uses the following heuristic: > (defun yf/save-current-or-last-echo-area () > "Save current message in echo area as kill" > (interactive) > (let ((candidates > (list > (with-current-buffer " *Echo Area 1*" > (buffer-string)) > (with-current-buffer " *Echo Area 0*" > (buffer-string)) > (with-current-buffer "*Messages*" > (save-excursion > (goto-char > (point-max)) > (skip-chars-backward "\n") > (buffer-substring-no-properties > (point) > (progn > (skip-chars-backward "^\n") > (point)))))))) > (kill-new (car (remove "" candidates))))) > (bind-key "" 'yf/save-current-or-last-echo-area) >=20 > I have no idea why it's sometimes Echo Area 1 and sometimes 0, nor if > I might miss an Echo Area 2. I like this approach a lot! BTW, is checking " *Echo Area [01]*" even necessary? I mean, its contents should be in "*Messages*" anyway, right? Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University