From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dan Hitt Newsgroups: gmane.emacs.help Subject: Re: EShell Alias for a 'cd' followed by 'ls' Date: Wed, 18 Nov 2020 20:56:31 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24647"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs , Stefan Kangas To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 19 05:57:39 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfc0o-0006LB-PU for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 19 Nov 2020 05:57:38 +0100 Original-Received: from localhost ([::1]:38904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfc0n-00081Y-SI for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 18 Nov 2020 23:57:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfbzy-0007zq-Gx for help-gnu-emacs@gnu.org; Wed, 18 Nov 2020 23:56:46 -0500 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:35581) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfbzw-0003IW-Hx for help-gnu-emacs@gnu.org; Wed, 18 Nov 2020 23:56:46 -0500 Original-Received: by mail-wr1-x432.google.com with SMTP id k2so5112743wrx.2 for ; Wed, 18 Nov 2020 20:56:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cXZkJ5qOqT7goDW3hLbg6RNdBvlsQ30fUiO0T/BGWjI=; b=eKe17D1JKUsVa3CSN1wKwGFJIrR68oATrM+bmIgtpqEjiO+Ye/rL8LWrK5Mig+VHGE V0n5DlQv/QKYYMKVkI073g94rgndXfOTTWeZ31k6ShMphvkNQFt6H1w9JfZfLCdOKMNS R8pjcNG3A4F7WHro/rtZGPXuNYSjaHjO4diO3deqo525x43hdCRhcwSk759rbOZ9z2ru jCT1Sd4Mfqt2OJrciMWOipOm9D1wQLvdddyqXrXL5KthsZ9xMi0QNJfkkUo1pkVzTSoU 7Hw3jLfUUSA86LmQo6u1g1jmCpRrAFFjcYSkNkcrHjsGuTj7k/FEidrTylK9vvcTPhV7 xx9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cXZkJ5qOqT7goDW3hLbg6RNdBvlsQ30fUiO0T/BGWjI=; b=LOnKdrwX9+j/+NMVeZRQcTZYm8FWQ5MY1n/FLG31elmb+stIj7NQFfTKOVv2Te64ub CDQ/fr4uTyoJmo4SHIP3tSr/H+XBEFqgj3MLPXIy07tW9IRchnNZfoPlkf9E/L5XK0Ig uzsQ2CSk5mw1fQguPcpiS4uhZbjYD6AphbTuTfDfFs2m/FCepPWljPzVaLSI+xHelfcA 5ppx3tofZoFl7a8mUcCIj41ne0lJVFjwFKbZDpm4/ZD7pYbBgnZOCersGXGABM+icMXe HTb4rPzpDUqUxj631pz8BLReZ3V5NZctXcD9QXoWuaA0q4mQ/qrVCnyilZuGg31qAkxE lYjg== X-Gm-Message-State: AOAM533cv75bbnALW7DnDZRWQ2K6eK5niJOgLIouz9vFN9TJ1p/sGYnD OvlLHcF4ck89A6hD1Ljk3A9ma5Mz1AmpCkWpudY= X-Google-Smtp-Source: ABdhPJyEtyfK6P011YDDz/8rt3ky5yeEU8PyY2sN/DFbIk2kISvTOJGBKEr8jhBv5sOaOjQyffm94Yf41zG1eNfMAd4= X-Received: by 2002:a5d:474b:: with SMTP id o11mr7659734wrs.235.1605761802856; Wed, 18 Nov 2020 20:56:42 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=dan.hitt@gmail.com; helo=mail-wr1-x432.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125356 Archived-At: On Wed, Nov 18, 2020 at 8:43 PM Dan Hitt wrote: > > > On Wed, Nov 18, 2020 at 8:11 PM Christopher Dimech wrote: > >> Have not found it useful. Have tried the following. >> >> alias cl 'cd $* && ls $*' >> > > Actually, it looks like it should be: > > alias cl 'cd $* ; ls' > > That works for me, and has the very surprising benefit that it propagates > to all shells running in emacs, as well as working in new emacses started > separately from the original one. > > So some pretty powerful, heady stuff. > > Thanks Stefan for pointing out the path. > > dan > Sorry for making a crusade out of this topic, but one more little piece of data. It looks like this works by writing the file ~/.emacs/eshell/alias But in the file it is stored without the single quotation marks. However, if you try to interactively define the alias without the single quotation marks, it does not work. Rather, what you get is two commands: the alias, and then the ls. So however eshell is reading the the alias file seems to not be the same as the way it reads the command line. Anyhow, i'll take my oar out of the water now, thanks again Stefan and Christopher for the information. dan > > >> >> >> > Sent: Thursday, November 19, 2020 at 4:54 AM >> > From: "Stefan Kangas" >> > To: "Christopher Dimech" , "Help Gnu Emacs" < >> help-gnu-emacs@gnu.org> >> > Subject: Re: EShell Alias for a 'cd' followed by 'ls' >> > >> > Christopher Dimech writes: >> > >> > > I would like to use Eshell to call an alias 'cl' that does >> > > a 'cd' to a directory followed by an 'ls'. But I do not know >> > > how to achieve it. >> > >> > I recommend familiarizing yourself with Info, reachable via `C-h i'. >> > >> > You can find the Eshell manual using `m eshell RET' where you should be >> > able to find the information you are looking for using `i alias RET'. >> > >> > Happy to help. >> > >> >>