[ESS-bugs] "//" on the Macintosh

Steven McKinney @mck|nney @end|ng |rom bccrc@c@
Fri Dec 13 03:42:00 CET 2019


Thanks Rodney,

that explains why I see the first part of the filepath greyed out in the minibuffer.

Is there a way to turn that dired feature off?

I just do Ctrl-a Ctrl-k to get rid of the preloaded dired path, doesn't seem too long and drudgery, or Ctrl-a Ctrl-y Ctrl-k if I want to yank my own path.  But if my own path had a double slash in it, I'd want Dired to parse it as the shell would parse it.


Steven McKinney



> -----Original Message-----
> From: Sparapani, Rodney [mailto:rsparapa using mcw.edu]
> Sent: December-12-19 6:19 PM
> To: Steven McKinney; Alex Branham; Richard M. Heiberger
> Cc: ess-bugs
> Subject: Re: [ESS-bugs] "//" on the Macintosh
> 
> Well, there may be more than one thing going on here.
> 
> // in dired means start over without having to backspace over the whole
> mini-buffer
> that is generally filled with the current working directory which can be
> long and drudgery
> to have to delete.  So, the dired part of this is a feature not a bug.
> Perhaps, you could turn
> that off, but it is very convenient and I really like it.
> 
> As far the UNIX family goes, // is simply ignored in my experience and
> treated as a single.
> So a directory named
> "/var/folders/vq/xl0j17pn29g52mgx7lqxl8d80000gn/T//RtmpB9dpQB"
> is legit and equivalent to
> "/var/folders/vq/xl0j17pn29g52mgx7lqxl8d80000gn/T/RtmpB9dpQB".
> 
> So, what behavior is wanted here that hasn't already been thought of over
> the ages?
> 
> -----Original Message-----
> From: ESS-core <ess-core-bounces using r-project.org> on behalf of Steven
> McKinney <smckinney using bccrc.ca>
> Date: Thursday, December 12, 2019 at 7:57 PM
> To: Alex Branham <alex.branham using gmail.com>, Richard Heiberger
> <rmh using temple.edu>
> Cc: ess-bugs <ess-bugs using r-project.org>
> Subject: Re: [ESS-bugs] "//" on the Macintosh
> 
>     ATTENTION: This email originated from a sender outside of MCW. Use
> caution when clicking on links or opening attachments.
>     ________________________________
> 
>     The double forward slash presents no problem to OS X's unix flavour:
> 
>     $ ls -alF
> /var/folders/0n/7kqmtc1x45jfj5m20lnsmrkm0000gn/T//Rtmp9pY90F/ABCD46c85fb112
> 0f.pdf
>     -rw-r--r--  1 stevenmckinney  staff  4576 12 Dec 17:30
> /var/folders/0n/7kqmtc1x45jfj5m20lnsmrkm0000gn/T//Rtmp9pY90F/ABCD46c85fb112
> 0f.pdf
> 
>     and I've seen the same behaviour on other *nix flavours.  So this is a
> Dired thing, not a unix/linux/mac thing.
> 
>     I notice if I do  Ctrl-x d   then paste in the double forward slash
> filepath that everything up to the first of the doubled slashes is greyed
> out (Emacs 25).
> 
>     Since *nix flavours can handle this, I'd think Dired should similarly
> handle it, by just interpreting two forward slashes as one.  I don't have
> Emacs 27 at this point to see if Dired has been updated.
> 
>     So workarounds for Emacs 25 include:
> 
>     > tmp <- gsub("//", "/", tempfile("ABCD", fileext=".pdf"))
>     > tmp
>     [1]
> "/var/folders/0n/7kqmtc1x45jfj5m20lnsmrkm0000gn/T/Rtmp9pY90F/ABCD46c84ca515
> d2.pdf"
>     >
> 
>     or writing your own tempfile function to call the base tempfile
> function and do the gsub before returning the filepath.
> 
>     (Even R's file.path doesn't fix the double slash
> 
>     > tmp <- file.path(tempfile("ABCD", fileext=".pdf"))
>     > tmp
>     [1]
> "/var/folders/0n/7kqmtc1x45jfj5m20lnsmrkm0000gn/T//Rtmp9pY90F/ABCD46c810a56
> 438.pdf"
>     >
>     )
> 
> 
> 
>     Steven McKinney
> 
>     Statistician
>     Molecular Oncology and Breast Cancer Program
>     British Columbia Cancer Research Centre
> 
> 
>     ________________________________________
>     From: ESS-bugs <ess-bugs-bounces using r-project.org> on behalf of Alex
> Branham <alex.branham using gmail.com>
>     Sent: Thursday, December 12, 2019 5:17 PM
>     To: Richard M. Heiberger
>     Cc: ess-bugs
>     Subject: Re: [ESS-bugs] "//" on the Macintosh
> 
>     Looks like / isn't a valid in a filename on Linux or Mac, so I'd
> suggest
>     changing that name
> 
>     On Tue, Dec 10, 2019, 5:16 PM Richard M. Heiberger <rmh using temple.edu>
> wrote:
> 
>     > I would appreciate if you can check.  I am still on emacs 25.1.1 and
>     > not interested in building a newer version.
>     >
>     > Rich
>     >
>     > On Tue, Dec 10, 2019 at 5:08 PM Alex Branham <alex.branham using gmail.com>
>     > wrote:
>     > >
>     > > Emacs upstream did some work about this recentlyish I think. See if
> it's
>     > fixed in Emacs 27 (you'll have to build from the git repo since it's
> not
>     > released yet). If not, M-x report-emacs-bug.
>     > >
>     > > If you can't build from source, let me know and I can test for you.
>     > >
>     > > Alex
>     > >
>     > >
>     > >
>     > > On Tue, Dec 10, 2019, 4:48 PM Richard M. Heiberger <rmh using temple.edu>
>     > wrote:
>     > >>
>     > >> > tempdir()
>     > >> [1] "/var/folders/vq/xl0j17pn29g52mgx7lqxl8d80000gn/T//RtmpB9dpQB"
>     > >> > tmp <- tempfile("ABCD", fileext=".pdf")
>     > >> > tmp
>     > >> [1]
>     >
> "/var/folders/vq/xl0j17pn29g52mgx7lqxl8d80000gn/T//RtmpB9dpQB/ABCD79804f1ca
> 596.pdf"
>     > >> > pdf(tmp)
>     > >> > plot(1:10)
>     > >> > dev.off()
>     > >> quartz
>     > >>      2
>     > >>
>     > >> Note the "//" in the filepath tmp.
>     > >>
>     > >> The file is created as
>     > >>
>     >
> "/var/folders/vq/xl0j17pn29g52mgx7lqxl8d80000gn/T/RtmpB9dpQB/ABCD79804200fd
> e4pdf"
>     > >>
>     > >> When I look for it in dired, it can't be found as dired stops at
> the
>     > >> "//" and interprets it as
>     > >> /RtmpB9dpQB/ABCD79804f1ca596.pdf
>     > >>
>     > >> In order to look for it in dired, I need to
>     > >> > gsub("//","/",tmp)
>     > >> [1]
>     >
> "/var/folders/vq/xl0j17pn29g52mgx7lqxl8d80000gn/T/RtmpB9dpQB/ABCD79804f1ca5
> 96.pdf"
>     > >>
>     > >> Can this be fixed by ESS, or by emacs?
>     > >>
>     > >> Rich
>     > >>
>     > >> _______________________________________________
>     > >> ESS-bugs ESS-bugs using r-project.org
>     > >>
> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-
> bugs__;!!H8mHWRdzp34!qjjRm6wKG-L1idvx1rvXgt-e83kRnOb6uQa878gvY-
> 5PsX50n0oL22wijndsLPc$
>     > >>
>     > >> _______________________________________________
>     > >> ESS-core list:
> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-
> core__;!!H8mHWRdzp34!qjjRm6wKG-L1idvx1rvXgt-e83kRnOb6uQa878gvY-
> 5PsX50n0oL22wi-xUieII$
>     >
> 
>             [[alternative HTML version deleted]]
> 
>     _______________________________________________
>     ESS-bugs ESS-bugs using r-project.org
>     https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-
> bugs__;!!H8mHWRdzp34!qjjRm6wKG-L1idvx1rvXgt-e83kRnOb6uQa878gvY-
> 5PsX50n0oL22wijndsLPc$
> 
>     _______________________________________________
>     ESS-bugs ESS-bugs using r-project.org
>     https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-
> bugs__;!!H8mHWRdzp34!qjjRm6wKG-L1idvx1rvXgt-e83kRnOb6uQa878gvY-
> 5PsX50n0oL22wijndsLPc$
> 
>     _______________________________________________
>     ESS-core list:
> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-
> core__;!!H8mHWRdzp34!qjjRm6wKG-L1idvx1rvXgt-e83kRnOb6uQa878gvY-
> 5PsX50n0oL22wi-xUieII$
> 



More information about the ESS-bugs mailing list