From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Belohrad Newsgroups: gmane.emacs.help Subject: RE: yasnippet to expand abbreviation in dired/fileopen command? Date: Fri, 11 May 2012 11:31:10 +0200 Message-ID: <87zk9fqd29.fsf@beesknees.cern.ch> References: <87r4uspgr2.fsf@beesknees.cern.ch> <87obpwgldq.fsf@xc.laptop> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1336728776 21521 80.91.229.3 (11 May 2012 09:32:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 May 2012 09:32:56 +0000 (UTC) To: Drew Adams , 'XeCycle' , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 11 11:32:54 2012 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 1SSmDR-0003qt-VV for geh-help-gnu-emacs@m.gmane.org; Fri, 11 May 2012 11:32:50 +0200 Original-Received: from localhost ([::1]:57760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSmDR-0007A9-4N for geh-help-gnu-emacs@m.gmane.org; Fri, 11 May 2012 05:32:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSmDL-0007A4-Fe for help-gnu-emacs@gnu.org; Fri, 11 May 2012 05:32:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSmDF-0003kB-1r for help-gnu-emacs@gnu.org; Fri, 11 May 2012 05:32:43 -0400 Original-Received: from static-212-101-19-163.adsl.solnet.ch ([212.101.19.163]:59907 helo=server.belohrad.ch) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSmDE-0003jw-QM for help-gnu-emacs@gnu.org; Fri, 11 May 2012 05:32:36 -0400 Original-Received: from beesknees.cern.ch.belohrad.ch (beesknees.cern.ch [137.138.197.99]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by server.belohrad.ch (Postfix) with ESMTPSA id 9327D262F8; Fri, 11 May 2012 11:37:22 +0200 (CEST) In-Reply-To: User-Agent: Notmuch/0.13~rc1+1~gece5275 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.101.19.163 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:84807 Archived-At: Dear All, thanks for fruitful responses. I think I like this one below, because it is very similar to what I use with tramp. thanks d. Drew Adams writes: >> > I want to open a file on the remote machine. I've setup tramp to use >> > abbrev to expand an abbreviation to full path, e.g.: >> > xhs -> //ssh:xxx@xxxx#1222:/mnt/mp3/ > > As Andrea suggested, creating a bookmark is one (good) approach. > > Here are two other approaches - > > 1. Option `directory-abbrev-alist'. > E.g., include an entry like this in the alist: > ("\`xhs" . "//ssh:xxx@xxxx#1222:/mnt/mp3/") > > Or in Customize: > INS DEL From: \`xhs > To: //ssh:xxx@xxxx#1222:/mnt/mp3/ > > Note that the doc for `directory-abbrev-alist' shows only examples where the > resulting directory names are shorter, but the reverse relation can be useful as > well: expand instead of contract - which is your case here. The point is to > substitute one directory name for another that is more convenient in some way. > The symlink case is only one use case. > > In vanilla Emacs, `C-x C-f xhs RET' will correctly expand the abbreviation if it > is in `directory-abbrev-alist'. However, completion (`TAB') will not expand it. > If you use Icicles then completion will expand it, just like `RET' will. > > See also: http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00666.html > > > 2. Environment variables. They are expanded even by vanilla Emacs during > completion (`TAB'). So you would define a variable `xhs' and then use `$xhs > TAB' in the minibuffer. > > > If you use Emacs on more than one machine, then using a bookmark or > `directory-abbrev-alist' is probably easier than using environment vars. They > keep the customization within Emacs, not at the machine/OS level. > > HTH - Drew