Hot answers tagged

13

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 ...


5

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))) <return-the-new-value>)) Or you can do it with (advice-add 'read-from-minibuffer :filter-return #'return-my-name) (defun return-my-name (orig-val) <...


5

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) (add-hook 'eshell-directory-change-hook (defun eshell-update-hist-dir () (push (eshell/pwd) eshell-hist-dirs) (setq ...


2

If you load library cl.el then C-h f oddp tells you this: oddp is an alias for cl-oddp in cl.el. (oddp INTEGER) 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 ...


2

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 ...


1

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


1

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 ...


1

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 ...


1

Uninstall emacs-auto-complete using yum or dnf and install company using the emacs package manager. Turn company on with (global-company-mode) ur use *mode-hooks to turn it on for specific modes.


Only top voted, non community-wiki answers of a minimum length are eligible