From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.help Subject: Re: Help with PHP setup Date: Mon, 23 Jul 2018 00:20:47 +0900 Message-ID: <3AEEA85D-D360-4800-8531-E77AD748C712@gmail.com> References: <20180720165431792380014@bob.proulx.com> <441C26FC-5F31-4C6E-A201-56FBAC5070D0@gmail.com> <20180720215215494599155@bob.proulx.com> <372A84EC-BB98-4127-9391-02B34085B0E4@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1532272773 12676 195.159.176.226 (22 Jul 2018 15:19:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Jul 2018 15:19:33 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 22 17:19:29 2018 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 1fhG8v-0003AH-FA for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Jul 2018 17:19:29 +0200 Original-Received: from localhost ([::1]:56365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhGB0-0002re-GE for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Jul 2018 11:21:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhGAL-0002rU-Ty for help-gnu-emacs@gnu.org; Sun, 22 Jul 2018 11:20:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhGAG-0007fh-UU for help-gnu-emacs@gnu.org; Sun, 22 Jul 2018 11:20:57 -0400 Original-Received: from mail-pl0-x22f.google.com ([2607:f8b0:400e:c01::22f]:36142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhGAG-0007fa-Ka for help-gnu-emacs@gnu.org; Sun, 22 Jul 2018 11:20:52 -0400 Original-Received: by mail-pl0-x22f.google.com with SMTP id e11-v6so7154252plb.3 for ; Sun, 22 Jul 2018 08:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=i6Xk+E3MfYF/KzcOlpHFIBzBrXtc8Q76YWsNxcqmwyI=; b=KB62X50nPYcIQ02re3t9N3In8aoRCNnI1DR6+XzajATPRGt+uheAap8nXHweJS+Xg8 UixCz0nCq76//uhNS6FHfjhPkFp28bVw9lITWRPQDFp57KCbMaMN1+cwxepjTYAYjUij k9c1Gb6uI9og2M024GeXyyZu+wsMa4xQYmpXrGsKg7ovNssmNoEnGYKAWiXn/xv8l3Ie UZuGbubWceLPzH3+ASDWIGMWUq1xvW2RCfm+z3CEoCKKK/vnWSAFgb+aWHx3RhvgvaZa FAirLuTfuah/z+yBjXn/MZrKW4WMvWLGxlclVOhNU79g0x3CEuWfPxK4r5/LSByX1dCo Q6CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=i6Xk+E3MfYF/KzcOlpHFIBzBrXtc8Q76YWsNxcqmwyI=; b=CdznssgFvqj1WkstoDMrGasfIcP1OgM0znatp6ms50etit8CDqBLjSR51QKQ5XF+cI VqHa44a8Ceg2MwtB1benQD/iMi0QMJvYpudCawyhaaMkUfGKzhd8BurI/m2FCN503w86 zY3F2Zz9kOieetrp4WoAQnnFS+ECMGYuYdH4sFBCyoEhaOlaTpHeVW6PZu3RxPbzg5ek V573/0EmCB7IRWSL0G7u9eCIaCjp28Hvk6lLMEipcIJG6pM2DHcE0nq8yDQeEoc0PF9T rImdlDh5M+NLuqUg6pBDNoMASjvRbENjhj1GStzezb4+q//60LILAP2xpxUP327WXeA/ 0FDA== X-Gm-Message-State: AOUpUlFnrNJeMFnJ7I6oXanrJQjjfm9uhpuxSor4ogPR5YykSUbZK4mb Os8S8Dft+hFx/+qXqmGxjn1q++4o X-Google-Smtp-Source: AAOMgpc/dJIEVb+FCUUno7eKdKcYuncVhuSwlUlD3XNPzdcXvfo7ZpuyS+31TOHfsXlD/9gAdJe78Q== X-Received: by 2002:a17:902:be07:: with SMTP id r7-v6mr9731320pls.124.1532272851287; Sun, 22 Jul 2018 08:20:51 -0700 (PDT) Original-Received: from [192.168.1.7] (pl36180.ag0304.nttpc.ne.jp. [133.232.212.84]) by smtp.gmail.com with ESMTPSA id p64-v6sm11181120pfa.47.2018.07.22.08.20.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jul 2018 08:20:50 -0700 (PDT) In-Reply-To: <372A84EC-BB98-4127-9391-02B34085B0E4@gmail.com> X-Mailer: Apple Mail (2.3445.9.1) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22f X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:117551 Archived-At: > On Jul 22, 2018, at 22:56, Jean-Christophe Helary = wrote: >=20 > On macOS it seems the "open " command targets the same tab so I don't = seem to have to be worried about that: >=20 > (defun myLocalhostTest () > "saves and opens the file opened in the current buffer into = localhost" > (interactive) > (save-excursion > (save-buffer) > (setq myRoot "http://localhost:8888/ ") > (setq myFile (file-name-nondirectory (buffer-file-name))) > (setq myTestCommand (concat "open " myRoot myFile)) > (shell-command myTestCommand))) >=20 > The above trivial code needs improvements to handle cases where the = file is not at the root of localhost, but that can wait for now :) I found a way to update the output for "normal" php files but as I work = on a WordPress site where final urls do not reflect the local file path = I'm finding that my "trick" doesn't work: (defun myLocalhostTest () "saves and opens the file opened in the current buffer into localhost" (interactive) (global-set-key (kbd "s-r") 'myLocalhostTest) (save-excursion (save-buffer) (setq myLocalRoot "/Applications/MAMP/htdocs/") (setq myServerRoot "http://localhost:8888/") (setq myFile (substring (buffer-file-name) (length myLocalRoot))) (setq myTestCommand (concat "open " myServerRoot myFile)) ;; this = "open " command only works on macOS... I don't know equivalents on = Linux. (shell-command myTestCommand))) Jean-Christophe Helary ----------------------------------------------- http://mac4translators.blogspot.com @brandelune