I'd suggest that you (require 'cl) and then use first and rest instead. They already exist, and are the standard alternative names.
They also get expanded to the actual car and cdr byte-code at compilation, whereas your custom aliases would not. (Not that you can't make them -- see the definition of cl--defalias -- but I think sticking to the standard ...
The following saves cd history and provides eshell commands b and f to navigate that history:
;;*--- track cd history ------------------------------------------------*/
(defvar-local eshell-hist-dirs nil)
(defun eshell-update-hist-dir ()
(push (eshell/pwd) eshell-hist-dirs)
Of course you can. You can do it with:
(advice-add 'read-from-minibuffer :around #'return-my-name)
(defun return-my-name (orig-fun &rest args)
(let ((orig-val (apply orig-fun args)))
Or you can do it with
(advice-add 'read-from-minibuffer :filter-return #'return-my-name)
(defun return-my-name (orig-val)
You shouldn't quote name of command together with its argument. As written,
the code creates an alias for command named find-file $1 which doesn't
exist, of course.
You need to remove the quotes:
alias ff find-file $1
Use funcall or apply:
(setq wrapped-copy (symbol-function 'emacs-version))
(fset 'fn (lambda () (funcall wrapped-copy)))
"GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, cairo version 1.16.0)
Although, in general, I would use an advice for wrapping a function.
If you load library cl.el then C-h f oddp tells you this:
oddp is an alias for cl-oddp in cl.el.
Return t if INTEGER is odd.
This function does not change global state, including the match data.
oddp is defined as an alias defined in cl.el. But your error message tells you that oddp is not defined. This is because cl.el has not yet been ...
It is one question per customer / thread ...
As to the first question, the great thing about Emacs from https://emacsformacosx.com/ is that it is a self-contained installation. The executable is inside the packaged Emacs.app wherever you installed it.
If you placed the Emacs.app inside the root /Applications folder, then your path to the Emacs executable ...
Here's how you can do what you intended, while avoiding the inf-loop:
(defalias 'old-conf-mode (symbol-function 'conf-mode))
(define-derived-mode conf-mode old-conf-mode ...)
Note that this is still pretty risky: e.g. it won't work right if conf-mode is marked for autoloading when the above code is executed, and it can lead to inf-loops if you re-execute ...
The nature of a derived mode is that its parent is called before the body of the child mode is evaluated1.
Therefore if the child becomes its own parent (or grandparent, etc...), that causes infinite recursion.
You might attempt to hack your way around this, but I would firmly suggest that you just "don't do that".
1 For more details on how derived modes ...