Questions tagged [aliases]

18 questions
9
votes
1 answer

How to create back/forward directory aliases for eshell?

For years I've been using a zsh script that causes a pushd to implicitly happen everytime you change directories. The script also sets up 'b' and 'f' aliases, short for backwards and forwards, that move you up and down the stack, similar to the back…
Joseph Garvin
  • 2,061
  • 8
  • 21
3
votes
2 answers

two versions of emacs on mac osx - where are they

This has got to be a silly question... From a terminal window, to start emacs which comes with mac osx (version 22.1.1), I just type > emacs First set of questions: where is this emacs installed? where is the alias defined? Now, I just discovered…
Antoine
  • 205
  • 2
  • 6
2
votes
1 answer

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

Let's say I have a file called .alias in my $HOME directory with the following content: alias "my-first-alias"="ls -lha" alias "my-second-alias="echo 'Hello World'" I know that if put the line source "$HOME/.alias" in both my .bashrc and .zshrc…
raylight
  • 217
  • 8
2
votes
1 answer

Is there some pitfalls if I define aliases for `cdr` and `car` functions?

I'm often obliged to read the documentation before using cdr and car functions. Is there pitfalls I should be aware of before aliasing those functions in my init file? Like: (defalias 'head 'car) (defalias 'tail 'cdr)
Nsukami _
  • 6,341
  • 2
  • 22
  • 35
1
vote
1 answer

How can I create an alias for a function name?

Does Elisp allow the equivalent of an alias for a function name?
Dilna
  • 1,173
  • 3
  • 10
1
vote
1 answer

How to copy a function?

If I get the function definition with (setq wrapped-copy (symbol-function 'fn)) how can I make a copy such that I can redefine the same function with a wrapped version? like (fset 'fn #'(lambda () (wrapped-copy))) I tried with copy-seq but I think…
untore
  • 131
  • 1
1
vote
1 answer

oddp vs cl-oddp in elisp script

I am trying to write a short script file with elisp for the first time which will serve me to install all the required packages that I use. Thus when I change from one computer to another, I can get all the basic tools that I use daily. My purpose…
Kadir Gunel
  • 233
  • 1
  • 10
1
vote
0 answers

How to set eshell's ls command to different program in different OS?

Since result of /usr/bin/ls is more neat compares with eshell/ls when filenames contain non-lattin Unicodes. I add an alias in ~/.emacs.d/eshell/alias, which makes eshell use /usr/bin/ls as default: alias ls /usr/bin/ls $*. But this can only apply…
sparkecho
  • 21
  • 3
1
vote
2 answers

defalias derived mode to parent mode

I wrote a new major mode config-general-mode, which is derived from conf-mode. I like it a lot and want to have it as the default mode for all configuration files. Thus I tried: (defalias 'conf-mode 'config-general-mode) But this doesn't work, I…
Tom
  • 45
  • 4
1
vote
1 answer

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

Is it possible to use advice to not only run your function first, but also prevent the advised function from running at all? For example, say a command ordinarily calls read-from-minibuffer to get a return value: (defun get-name () …
JCC
  • 989
  • 5
  • 15
1
vote
1 answer

eshell alias not working properly

the following alias in the aliases file doesn't work in eshell 2.4.2, emacs 24.4.1 alias ff 'find-file $1' error message as is is given below find-file $1: command not found Any ideas what is going wrong?
Sum Proxy
  • 43
  • 6
0
votes
1 answer

Redirect change made to a variable to another variable

I have variables foo and bar. I have a function that modifies foo and I can't change that function. How can I redirect the change made to foo so it applies to bar instead? EDIT : I want this redirection to track real time change. What I am trying to…
Virgil
  • 3
  • 3
0
votes
1 answer

(set-eshell-alias!) for mv causes error: missing destination file or directory

In doom emacs, I'm setting some aliases in my config as follows: (set-eshell-alias! "ls" "exa --icons $*" "doomsync" "~/.emacs.d/bin/doom sync" "rm" "rm -Iv $*" "mv" "mv -iv $*" "ps-sorted-by-cpu" "ps c -eo…
Dargscisyhp
  • 370
  • 1
  • 12
0
votes
0 answers

I want to make an alias to `org-babel-execute:emacs lisp`. the problem is with the space on `emacs lisp`

I'm using org-beamer exporter, and I would like to do the following: (defalias 'org-babel-execute:emacs-lisp lisp 'org-babel-execute:emacs lisp) My problem is 'org-babel-execute:emacs lisp has a space character, which I need so the code in latex…
BuddhiLW
  • 257
  • 1
  • 7
0
votes
0 answers

How to create shell aliases in Emacs [GUI] in Windows?

In Linux this can be done by something like: alias cdwww="cd /srv/www" In Windows there is an equivalent command called DOSKEY, used for example like this: doskey ls=dir $* The above works perfectly in Windows' built-in CMD but not in Emacs shell.…
W.M.
  • 113
  • 3
1
2