Skip to content

Uniquify fix#92

Open
Fuco1 wants to merge 9 commits into
rejeep:masterfrom
Fuco1:uniquify-fix
Open

Uniquify fix#92
Fuco1 wants to merge 9 commits into
rejeep:masterfrom
Fuco1:uniquify-fix

Conversation

@Fuco1

@Fuco1 Fuco1 commented Mar 1, 2018

Copy link
Copy Markdown
Contributor

This is continuation of #63

I've extracted the function @FrancisMurillo wrote and changed some of the operations to Emacs primitives so it's faster and then applied it to the f--uniquify problem instead of a lambda funcall.

@Fuco1

Fuco1 commented Mar 1, 2018

Copy link
Copy Markdown
Contributor Author

There's a bunch of other changes related to the readme/docs, I can split it out but meh... ? :D

@rejeep

rejeep commented Mar 1, 2018

Copy link
Copy Markdown
Owner

As long as they are separate commits, I'm good.

@Fuco1

Fuco1 commented Mar 1, 2018

Copy link
Copy Markdown
Contributor Author

Oh damn, directory-name-p is emacs 25 only. Are we cool with compat/polyfills or should I reimplement it somehow else?

The implementation is

(defsubst directory-name-p (name)
  "Return non-nil if NAME ends with a directory separator character."
  (let ((len (length name))
        (lastc ?.))
    (if (> len 0)
        (setq lastc (aref name (1- len))))
    (or (= lastc ?/)
        (and (memq system-type '(windows-nt ms-dos))
             (= lastc ?\\)))))

@rejeep

rejeep commented Mar 1, 2018

Copy link
Copy Markdown
Owner

I trust you judgement 🙂

@Fuco1

Fuco1 commented Mar 1, 2018

Copy link
Copy Markdown
Contributor Author

I've added f-directory-name? which exposes this to older versions of Emacs. So it is stand-alone function while not shadowing the "global" so that we have a "unified" API for all versions. On E25+ it simply aliases.

@Fuco1

Fuco1 commented Mar 6, 2018

Copy link
Copy Markdown
Contributor Author

@rejeep There seems to be some issue with the build regarding the snapshot emacs version. I stalls and never produces any error. I've added Emacs 25.2 and 25.3 to the build to cover all released versions.

Are you comfortable merging this with failing build on the snapshot? I'm not quite sure what is there to do about that :O

@rejeep

rejeep commented Mar 12, 2018

Copy link
Copy Markdown
Owner

@Fuco1 I think we should allow failures for snapshot.

@Fuco1

Fuco1 commented Mar 12, 2018

Copy link
Copy Markdown
Contributor Author

Ugh... I think I will reimplement the function in some other way, this breaks quite spectacularly with remote file names. And it shouldn't as this is purely string manipulation so we don't actually even need to connect to the remote host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants