Skip to main content

Questions tagged [shell-command]

is for executing shell commands from Emacs (the default key binding is `M-!`). Shell output is shown in the echo area if it fits, in buffer `*Shell Command Output*` otherwise. Emacs comes with many supporting facilities for executing shell commands, including interactive execution, selective execution on a region, history cycling, directory tracking, connecting to serial ports, emulator options, and specifying remote hosts.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

Accessing Sage interpreters from Org Babel

I often use Sagemath within Org mode for my math notes, using the ob-sagemath package. Sage can provide an interface to many underlying interpreters, like GAP or Maxima, and I just figured out how to ...
Luke's user avatar
  • 37
1 vote
0 answers
95 views

How to use sudo with shell-command-on-region?

Inside Emacs it's possible to run a shell command under sudo by doing the following: (let ((default-directory "/sudo::")) (shell-command "the-command-that-requires-sudo-access")) ...
PRouleau's user avatar
  • 882
0 votes
0 answers
61 views

Why does wl-copy get stuck in emacs?

$ emacs -Q -nw /etc/motd C-x h ;; mark-whole-buffer ESC | wl-copy RET and emacs gets stuck. Yes, the copy is done, but emacs is stuck until a CTRL+G breaks the logjam. So what is the ...
Dan Jacobson's user avatar
0 votes
0 answers
94 views

Why doesn't Emacs read my .profile?

I was having trouble launching cargo with M-x compile, and IIUC this meant the compile didn't had cargo in its path. This meant process-environment didn't contain cargo, and this in turn meant it didn'...
Alessandro Bertulli's user avatar
0 votes
0 answers
40 views

`async-shell-command: Wrong type argument: sequencep, #<buffer *scratch*>`

This is not a question about switching to the scratch buffer but to understand why the error is produced and to correct the function. By running the following command from command line, I can switch ...
Name's user avatar
  • 8,117
0 votes
1 answer
73 views

How to bind a custom compile command to a key?

In my .emacs file,I want to pass the current buffer file name to an external bash compile script called, "com", and bind it to a keyboard key, preferably, Ctrl-F5. I have tried several ...
Scotsgeek's user avatar
0 votes
0 answers
120 views

Add a shell command to dired mode

I want to add a command to dired-mode, which executes a shell command on the highlighted file. For example, from Bash, I can run qvm-copy {FILENAME}. I would like to replicate this behavior, but from ...
GNUser's user avatar
  • 254
0 votes
1 answer
47 views

How to insert fontified git diff output into Emacs buffer?

I wrote this code: (defun compare-string-test (String1 String2) (interactive) (let ((Temp1 (make-temp-file "gitdiff" nil nil String1)) (Temp2 (make-temp-file "gitdiff" ...
Gabriele's user avatar
  • 1,700
0 votes
1 answer
323 views

"Aliasing" `ls` to `gls`

gls not ls: My system has two forms of ls, the standard "old school" version of ls, and GNU ls which is available as gls. In my shell, I simply created an alias to use gls, but I have not ...
Anoduck - The Anonymous Duck's user avatar
2 votes
1 answer
141 views

Difficulty inserting current weather with org-roam dailies template

I am trying to get the current weather inserted into my org roam dailies. Here is the default capture template I'm starting with, from https://systemcrafters.net/build-a-second-brain-in-emacs/keep-a-...
Edward Doolittle's user avatar
0 votes
1 answer
105 views

pass arguments in call-process as key/value

I try to run a command which takes some arguments and requires to pass some attributes to the API. I understand that call-process takes args as strings but any invocation complains about wrong-type-...
b10n1k's user avatar
  • 101
1 vote
1 answer
281 views

Dired shell command with parameters

I want to provide additional command line options to a command in dired marked with '!', eg how do I add '-V' to something like 'less'?
balanga's user avatar
  • 153
0 votes
0 answers
252 views

Executing commands from a buffer

Following instructions here:- https://www.emacswiki.org/emacs/ExecuteExternalCommand which says: Using the whole buffer If you are programming using an interpreted language, such as Perl or Python, ...
balanga's user avatar
  • 153
0 votes
2 answers
162 views

shell-command-on-region doesn't execute an executable script named in exec-path

I am on MacOS (12.6.1, Monterey) running Emacs 29.1 (installed from https://emacsformacosx.com). I have a set of shell scripts that I have often use with shell-command-on-region (M-|); the scripts are ...
cforster's user avatar
  • 101
1 vote
1 answer
87 views

Getting dired to open an xterm instance without waiting

I like to use dired-do-shell-command to open audio and video files in an independent terminal using the default command gnome-terminal -- mplayer * and this works great. But now I've changed my ...
Alexander Praehauser's user avatar

15 30 50 per page
1
2 3 4 5
10