From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: simply saving a text file to a directory OS X Date: Wed, 30 Nov 2016 18:02:16 -0800 Message-ID: References: <63B5AC70-7DEF-4C3D-B856-8FEA12C65A71@icloud.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1480557794 27025 195.159.176.226 (1 Dec 2016 02:03:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Dec 2016 02:03:14 +0000 (UTC) Cc: Matthew Pritchard To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 01 03:03:08 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCGiJ-0005vQ-Tu for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Dec 2016 03:03:08 +0100 Original-Received: from localhost ([::1]:47548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCGiM-0007uI-5t for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Nov 2016 21:03:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCGhr-0007uD-8n for help-gnu-emacs@gnu.org; Wed, 30 Nov 2016 21:02:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCGhq-0006yI-Gm for help-gnu-emacs@gnu.org; Wed, 30 Nov 2016 21:02:39 -0500 Original-Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:36665) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cCGhq-0006xW-CT for help-gnu-emacs@gnu.org; Wed, 30 Nov 2016 21:02:38 -0500 Original-Received: by mail-qt0-x229.google.com with SMTP id w33so206856988qtc.3 for ; Wed, 30 Nov 2016 18:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RyjPqeJZ+Gmfj5HiYha3cNS04a6g0t+H9Q69fqylG5Y=; b=0k1S/UTVRIQeU6SFz/f4TU9aexuL0y9EGoSUBLjEEUc1sKDiaUUOhcQCFzzIfpyyty nARxSWAGuBMmhW0f0nNI7owKmQLMKZlde/hvLkdBzaz2D+jvolYVZCPigXR1+Sbzki/D ZTdx56eF88YmqV8J7CS/R5kMQVum3ibe6dlP2HSFkY6dv8miu5X6uaSz//Oh1xz+BCns zlx3DuMU9jBJbmKORkKFL2QYJ4qk20arE6XkaJW3EyL+hWo8Mj8DfMXPx4AYz4HfAFgr KgyDTzyZFY0E1tvZCkd/A41+6Z1OEiFl3CJXqVO+V1t6yo9ZQSWECzz6VDkLsNAwhzMO +4lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RyjPqeJZ+Gmfj5HiYha3cNS04a6g0t+H9Q69fqylG5Y=; b=A7iJCd633zsxnYIE5pZ0rFkgVuUCl4lxTa8l95gpTnwH1zmVBMOhi2N6wk3aNrH/5I e3il2cVadPKYqOOHMZbv8PnGHyPXUvFKtT+ZFnFRpFDDBkYesBqt0zswcgDzvRh9VqjJ 3dzcnTqTp/Jbn/eHrv2wCym66/NQZBErYE2xCw0W+SqcrU2t67foLN3D4+221PgzZ7L/ n11a9sFaMYHvI1JcsvX1dh41vKGyRlIMW8EWmlohLUOevggCbwCCLhytzLxDeXFGibqN v+qF43VVSZxWhRreKo6SYtsz4jcOXImUzWGbfTO7Z0H4Vf60KDSE54f6RgcBdNKXZKQF C6uQ== X-Gm-Message-State: AKaTC014ef6CDTlYpNHaHPCv6wsHmKZj+J35wcKicH51AjI+ddOn4wwSot+KsQ29RbzfTCK8msSyYt/0YJjOzQ== X-Received: by 10.200.46.249 with SMTP id i54mr31675591qta.13.1480557757518; Wed, 30 Nov 2016 18:02:37 -0800 (PST) Original-Received: by 10.237.52.229 with HTTP; Wed, 30 Nov 2016 18:02:16 -0800 (PST) In-Reply-To: <63B5AC70-7DEF-4C3D-B856-8FEA12C65A71@icloud.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::229 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:111840 Archived-At: Matthew Pritchard wrote: > I want to work with a file and save it to a specific directory. what > is a simple way to do this. Do you mean when using Emacs interactively, or in Emacs Lisp code? If the former, Emacs's equivalent to "save as" is the command `write-file', which has the key binding `C-x C-w' by default. After typing `C-x C-w' you'll be prompted for where to save the file. You can either enter a complete file name, or just a directory name (in which case the file will be saved in that directory with its existing base name). I suggest working through the tutorial, which you can start by typing `C-h t'. If the latter, it will often look something like: (let ((file "/path/to/file.txt") (destination "/path/to/destination.txt")) (with-temp-buffer (insert-file-contents file) ;; work with the file's contents... (write-region nil nil destination))) Hope that helps John