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 ...
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)))
<...
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 ...
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 ...
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....
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 ...
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.
(...
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 '...
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 ...
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 ...
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 ...
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.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
aliases × 18eshell × 6
microsoft-windows × 2
variables × 2
org-mode × 1
org-export × 1
elisp × 1
osx × 1
tramp × 1
hooks × 1
shell × 1
major-mode × 1
functions × 1
minor-mode × 1
auto-complete-mode × 1
whitespace × 1
linux × 1
advice × 1
gui-emacs × 1
path × 1
defun × 1
derived-mode × 1
symbol-function × 1
defalias × 1
variable-watchers × 1