the Bane of Emacs 24 Copy Directory Change
emacs 24.3 made incompatible changes to
copy-directory again. Caused me 3 hours.
you can read about it by Alt+x
view-emacs-news then search for “copy-directory”.
so, now i have this complex code in my script.
(cond ((< emacs-major-version 24) (copy-directory fromDir toDir)) ((= emacs-major-version 24) (if (>= emacs-minor-version 3) (progn (copy-directory fromDir toDir "KEEP-TIME" "PARENTS" "COPY-CONTENTS") ) (if (file-exists-p toDir) (copy-directory fromDir (concat toDir "/../")) (copy-directory fromDir toDir) ) ) ) )
Complexer and Complexer.
copying a dir is like grafting a tree. For such a function, there are these design issues:
- whether to copy the dir itself or its children.
- whether things are moved to as children of dest dir, or dest dir itself replaced.
- whether the dest dir exist, and what to do in each case.
the unix “cp” command is the most idiotic. Its behavior changes depending on whether the destination node exist. Emacs's copy command started to follow the unix ways.
copy-directory was perfect, but they had to change.
- Programing Language: Fundamental Problems of Lisp
- Concepts and Confusions of Prefix, Infix, Postfix and Lisp Notations
- Lisp's List Problem
- Programing Language: Why Lisp Do Not Have a Generic Copy-List Function
- Programing Language: A Ruby Illustration of Lisp Problems
- Why You should Not Use the Jargons lisp-1 lisp-2
- Emacs Lisp Problems: Trim String, Regex Match Data, Lacking Namespace
Patreon me $5. Ask me question on patreon