Hot answers tagged

6 votes
Accepted

How to create back/forward directory aliases for eshell?

The following saves cd history and provides eshell commands b and f to navigate that history: ;;*--- track cd history ------------------------------------------------*/ (defvar-local eshell-hist-dirs ...
xuchunyang's user avatar
  • 14.4k
5 votes
Accepted

Can you intercept a function and return your own value using advice?

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))) <...
Stefan's user avatar
  • 26.3k
2 votes
Accepted

oddp vs cl-oddp in elisp script

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 ...
Drew's user avatar
  • 76.3k
2 votes

two versions of emacs on mac osx - where are they

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 ...
lawlist's user avatar
  • 18.9k
2 votes

How to copy a function?

Use funcall or apply: (setq wrapped-copy (symbol-function 'emacs-version)) (fset 'fn (lambda () (funcall wrapped-copy))) (fn) "GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24....
NickD's user avatar
  • 28.1k
2 votes
Accepted

Is there any way of making eshell aliases using bash and zsh aliases syntax?

If you go over to EshellAlias on EmacsWiki, there are many solutions to this problem. The one by Edgar Vincent that's currently at the very bottom of the page is the most concise and elegant solution ...
g-gundam's user avatar
  • 1,231
2 votes

How can I create an alias for a function name?

Yes. You can have any number of aliases for the same function. To do that, use defalias (or fset, but defalias is generally recommended). Example: define mop as an alias for means-of-production. (...
Drew's user avatar
  • 76.3k
1 vote
Accepted

The Emacs eshell alias of CMake doesn't recognize path correctly?

You need to include the arguments in the Eshell alias as $1, $2, ... or as full list of provided arguments $*. See the documentation of Eshell aliases. In your special case you could use: alias cmake '...
Tobias's user avatar
  • 32.8k
1 vote

How to create a short name for tramp multihop path?

Read the Tramp Manual, chapter Frequently Asked Questions (https://www.gnu.org/software/tramp/#Frequently-Asked-Questions). It explains in length several approaches to shorten remote file names. These ...
Michael Albinus's user avatar
1 vote

defalias derived mode to parent mode

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 ...
Stefan's user avatar
  • 26.3k
1 vote
Accepted

defalias derived mode to parent mode

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 ...
phils's user avatar
  • 49.5k
1 vote

How replace auto-complete-mode with company-mode in all major mode using it?

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.
Ista's user avatar
  • 1,168

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