Questions tagged [command-line-arguments]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
41 views

Cannot get Magit to show the commit signatures in the log

In order to prove that I had a signature on a commit I needed to use a this command line command: $ git log --show-signature -1 I could not get Magit to display the signature I tried to use the ...
1
vote
1answer
41 views

starting emacs from the commandline and setting line wrap to 60 - howto?

I'm new with Emacs and come from Joe. There I started editing mail from the command line by joe -rmargin 60 because I don't want to generally set the right margin to 60. I can't find a similar ...
3
votes
1answer
53 views

Why won't `emacs -nw -f org-mode foo` open `foo` in `org-mode`?

I want to open a file foo in org-mode on the terminal. However, Issuing emacs -nw -f org-mode foo opens foo in Fundamental mode. What's wrong with my command?
2
votes
2answers
143 views

How can I set command-line parameters through `.emacs` file?

Is it possible to set Emacs start-up command-line flags such as -nw and -q in an init file? If it is, how can I do that?
0
votes
1answer
58 views

How to make `emacs` shell command switch to existing emacs process, if it exists?

Is there a way to get the emacs shell command (the UNIX utility) to start an emacs process, if none exists, but if one does, switch to it? More specifically, is there a way to get the command emacs ...
0
votes
1answer
84 views

emacs (v24.3.1): command line '--' before the file name

I have a RHEL 7 box, and I've installed emacs onto it (v24.3.1). This version of Emacs seems to be broken. You used to be able to edit by entering a command like this: emacs -- somefilename.txt and ...
0
votes
1answer
34 views

How input all params from console without interactively?

Here snippet of my elips function: (defun log-report (filePath uniqueText) "Create log4j record report from any log4j (e.g.traceXXX.log) files. Log4j level MUST be in square brackets. e.g.: [DEBUG] ...
1
vote
2answers
310 views

Run gdb from the command line

I use emacs/gdb for debugging. Generally, I emacs M-x then type gdb type exe name. Every debug, I've gone through these 3 steps. I want to know: is it possible to run gdb from the command line, e....
2
votes
2answers
254 views

Windows 10 native (spac)emacs install can't call cygwin binary (ledger) with proper path passed

I'd like to use Windows (10) native Emacs (spacemacs) and ledger (both installed via Chocolatey). The finance layer from spacemacs provides integration for it, however when I tried to run a simple ...
3
votes
1answer
157 views

How to call org-lint against org-mode file from command-line

I am configuring a CI/CD pipeline to process org-mode files into documentation, source code, and other file formats. I would like to add a call to org-lint to do basic syntax checking against org ...
3
votes
2answers
873 views

Update spacemacs packages from the command line

I'm trying to write a shell function to launch (spac)emacs, update packages, and then restart emacs in daemon mode. I tried this, but it hangs: emacs --daemon && emacsclient -e '(progn (...
3
votes
0answers
52 views

Emacs 25.3.2: reverse windows on file opening

If I open 2 files by command line: emacs file1 file2 in Emacs 25.3.2, file2 is opened in the upper window and file1 in the lower. This didn't happen in previous versions of Emacs that had the ...
1
vote
0answers
136 views

Possible to pass arguments to emacsclient alternate-editor?

Currently this works: emacsclient ..args.. --alternate-editor=some_editor However this does not: emacsclient ..args.. --alternate-editor="some_editor --args" Is there a way to call the alternate-...
1
vote
1answer
88 views

How to open a file using eval that works with '--alternative-editor'

The following command works to open a file in an existing emacs instance: emacsclient --eval \ "(progn (find-file \\"/a/b.txt\\") (goto-line 1) (forward-char 2) (recenter))" \ --no-wait \ --alternate-...
2
votes
2answers
254 views

Set an Elisp var on the command line and read it in the init file

I'm trying to set a variable at load-time: # emacs --eval '(defvar myvar t)' Now, in this session, if I C-h v myvar RET I get a nice t. But if I put (message "MYVAR: %s" myvar) in my init file, I ...
0
votes
2answers
582 views

How to use OSX command line GUI emacs as git $EDITOR

I have a script to launch OSX GUI emacs from command line at: /usr/local/bin/emacs The script looks like: #!/bin/sh $(/Applications/Emacs.app/Contents/MacOS/Emacs --chdir $PWD "$@") & I have ...
3
votes
1answer
494 views

Pretty print s expressions from the command line

I've got a file containing an emacs s-expression and I want to pretty print it from the command line: Is there an easy way of doing this? Paranoia suggests I want to do as little parsing of this data ...
5
votes
1answer
1k views

emacs --eval of multiple functions on command line

How do I evaluate multiple functions simultaneously using emacs --eval on command line? For example I want to combine the followings in a single command: emacs --eval "(toggle-frame-maximized)" emacs ...
6
votes
1answer
2k views

How to execute named code blocks written in any language using a shell script?

History Recently, I cobbled together a shell script that can execute a named code block from inside an org-mode file using the command-line. I copied source code directly from the org-mode manual ...
3
votes
0answers
91 views

Is there some way to continue reading from a STDIN file descriptor when data is PIPED to Emacs on Command-line?

Historical Perspective On Unix like operating systems, it is common practice to redirect IO between shell commands using pipes. For example, the command below would insert all the lines that didn't ...
2
votes
1answer
1k views

How to run emacs function from the shell

I would like to: run an emacs function from the shell in a standard emacs session (configured as if it was run in an interactive session) with a certain file in the active buffer So I would like to ...
3
votes
1answer
490 views

Run elisp from command line in running emacs

How can I execute elisp in the currently running emacs from the command line? The following command echoes 'hi' but doesn't set 'abc in the emacs instance. emacsclient --no-wait --eval '(message "hi"...
3
votes
1answer
213 views

emacsclient directly start eshell command command line

Both of the following work to call a graphical/terminal eshell: emacs -f eshell emacs -nw -f eshell Furthermore, this 2-step process also works: `emacsclient -t -a '' /some/real/file/name Metax ...
2
votes
1answer
232 views

Emacsclient not focusing if called with --eval argument from terminal

I wish to call man function in emacsclient when I typing "man smth" in terminal. When I open files from iterm via emacsclient - emacs gaining focus and when I kill buffer - terminal gaining focus back....
4
votes
1answer
698 views

From an external script, open file and run some simple expression whether emacs already running or not

Context / initial need (works fine) I wrote and use a script that generates a file and uses emacsclient to edit it in an existing or new instance of emacs, in a new window. Similar to Set up Emacs ...
4
votes
2answers
511 views

What is the difference between --load vs --script options?

man emacs: --script file Run file as an Emacs Lisp script. -l file, --load file Load the lisp code in the file file. I think that --load uses usual convention to boot from compiled file ...
3
votes
1answer
1k views

How can I override initial-buffer-choice if I specify a filename at command line?

In my .emacs file I have the following line in custom-set-variables: '(initial-buffer-choice "~/Programming/C++/<some project I'm working on>") This works great. However, I use emacs to edit ...
1
vote
1answer
813 views

Open “emacs -nw” and running a command from bash

I would like to know if it is possible, with a single command from bash, to open a file with emacs -nwand execute a command in the same time, for example goto-line 20.
4
votes
1answer
163 views

How to specify the buffer mode on the command line?

I want to open a file in makefile-gmake mode. Is there a way to do this from the command line? I'm looking for something like: $ emacs -m makefile-gmake filename I do not want to change any config ...
1
vote
1answer
180 views

Switch to buffer conditional to no file having been specified in the command line?

On startup, I want to create an empty buffer and switch to it, but only if no file has been specified in the command line. The closest I have is (switch-to-buffer "untitled") at the end of init.el ...
4
votes
2answers
323 views

Parse command line arguments in interactive session

I'd like to pass some extra information to my init.el via command line arguments. However, the variable command-line-args-left is always nil when Emacs is run interactively. (Though it is correctly ...
8
votes
2answers
2k views

Launch emacs with ediff-files (of ediff-directories) from command line

I would like to launch emacs to ediff either files or directories. For example, I'd like something like: emacs -f ediff-files file1 file2 But when I do this, it doesn't take file1 and file2 as the ...
6
votes
1answer
314 views

Preset search isearch-string from command line

I am trying to set isearch-string from the command line. The purpose is to have a Perl script start Emacs with a given search string, and go directly to the first line of the string and enter search ...