Skip to main content

Questions tagged [script]

Filter by
Sorted by
Tagged with
1 vote
4 answers
126 views

How can I detect whether emacs is being invoked as a standalone script? I'm looking for the emacs equivalent of pythons __name__ == __main__ test: if __name__ == __main__: # running this file a ...
erjoalgo's user avatar
  • 895
0 votes
2 answers
136 views

An example of this is a script to output the contents of .zsh_history file in the manner of the history command, so an emacs script would be invoked by a command line like display.sh.el < ~/....
vfclists's user avatar
  • 1,511
0 votes
2 answers
517 views

I have written a code: ;;; calculator.el --- Calculator ;;; Commentary: ;;; Code: (let ((operand1 (read-number "Enter the first number: ")) (operand2 (read-number "Enter the ...
whiteman808's user avatar
0 votes
1 answer
49 views

I want to make a function that will set the correct major mode based on the interpreter used for a script. I don't want to include extensions in my scripts (because that can be annoying if making cli ...
Hackerman's user avatar
1 vote
1 answer
75 views

I have a list of more than 80 search engines to perform keyword searches. They are listed in an org-table like this: #+name: keyword-search |---------------+--------------------------------------------...
crocefisso's user avatar
  • 1,549
0 votes
1 answer
125 views

Since upgrade to Emacs 28.1, I have noted an annoy change in shell-script mode auto-formatting. I would like to recover the old behavior Before, if I entered if [ "$x" = "" ];then ...
SzS's user avatar
  • 1
1 vote
3 answers
214 views

I have reduced a large text file to a 1.9GB size that Microsoft Access can handle, but only as a linked file. To permit full Access operations - to import the relevant data into Access - I need to ...
Ray Woodcock's user avatar
1 vote
1 answer
63 views

I have this LaTeX code: %% test.tex \begin{wrapfig} \includegraphics[width=1cm]{fig1.eps}\end{wrapfig} \includegraphics[width=1cm]{fig2.eps} I have a script called fix-files-ext.sh that fixes the ...
Onner Irotsab's user avatar
0 votes
1 answer
791 views

I frequently use commands like paredit-comment-dwim, comment-dwim, and comment-region. I am also aware these commands can have a compound effect with the mark command. But, I would like to comment ...
Pedro Delfino's user avatar
3 votes
1 answer
246 views

There are a number of emacs-lisp checking utilities - for example: checkdoc. package-lint. relint. byte-code-compilation. Are there existing ways to quickly run this on an entire project without ...
ideasman42's user avatar
  • 9,513
0 votes
0 answers
645 views

I have configurations I would generally run on the startup of DWM. Now, I would like to do the same with EXWM/Emacs. Is there any Elispian way to do it? EDIT: arrived in conjunction with @lawlist OBS: ...
BuddhiLW's user avatar
  • 307
3 votes
2 answers
330 views

I am trying to create an Emacs script that indents HTML files from the command line. This is what I have so far: #!/usr/bin/env -S emacs --script (require 'web-mode) (indent-region (point-min) (point-...
Jaap Joris Vens's user avatar
1 vote
1 answer
290 views

I'm trying to write a script using emacs --script and in it I am using start-process, because I want to use set-process-filter. The following does nothing if run as a script: #!/usr/bin/env -S emacs -...
theia-jane's user avatar
2 votes
1 answer
1k views

Is there an equivalent of C's system(char*) or Python's os.system(string) for emacs --script? I want to use Emacs for shell-scripting purposes. However, I cannot find a function that allows running an ...
kdb's user avatar
  • 1,591
0 votes
0 answers
108 views

Good day, I created the following script in order to run emacs 27.1 in cmd without gui: $ cd \Users\xxxxxx\emacs-27.1-x86_64\bin $ emacs-27.1.exe -nw %1 An elementary script which I named demacs. ...
davidebond's user avatar
4 votes
3 answers
494 views

I want to write an article in English mingled with Syriac script in emacs, when I hit list-input-methods the script is not shown, or at least I couldn't identify this language in the displayed list. ...
doctorate's user avatar
  • 1,909
0 votes
0 answers
108 views

I am running a make command. I'd like to capture the first error and output it to a file. How can I select as a region from the beginning of first-error position to the position right before the next-...
LeanMan's user avatar
  • 133
2 votes
1 answer
129 views

To run an elisp file hello.el with emacs in cli, do simply $ emacs --script hello.el However, a naive try for emacsclient fails, as --script is not an option of emacsclient. $ emacsclient --script ...
Student's user avatar
  • 225
2 votes
3 answers
556 views

How do I read the entire contents of stdin into an Emacs buffer in #! /usr/bin/env emacs --script mode? Stdin may not be a regular file.
Lassi's user avatar
  • 397
2 votes
1 answer
52 views

When I execute emacs --batch --script=/home/jim/test.el --no-site-file --file=testing I get: Cannot open load file: no such file or directory, /home/jim/--script=/home/jim/test.el While emacs --help ...
Jim's user avatar
  • 21
1 vote
1 answer
74 views

I'm trying to write a small program to indent lisp files using lisp-mode so I can get Emacs-compatible indentation even when using a different program. Here's my first attempt to write a program to ...
Greg Nisbet's user avatar
1 vote
2 answers
856 views

I have the following emacs script from here #!/usr/local/bin/emacs --script ;;; rcat --- cat ;;; Commentary: ;;; cat function in elisp ;;; Code: ;;-*- mode: emacs-lisp;-*- (defun process (string) ...
anquegi's user avatar
  • 769
0 votes
1 answer
394 views

This problem is so convoluted that maybe I should call it a puzzle... On the Unix shell command line, I can convert TSV (tab-separated-values) input to org-mode table format with this perl one-liner: ...
kjo's user avatar
  • 3,407
0 votes
1 answer
256 views

I have elements that contain various things. Some contain HTML; web-mode does not realize that so it messes up the indentation. Some contain CSS; same issue. My first preference is, can I somehow ...
Ron Burk's user avatar
  • 101
2 votes
1 answer
2k views

I have a simple python script: $ cat ~/simple.py import os import sys def write_greeting(inpath): outpath = os.path.splitext(inpath)[0] + '.txt' with open(outpath, 'w') as f: f.write('...
Brian Fitzpatrick's user avatar
-1 votes
1 answer
111 views

All of sudden, XEmacs 21.4.22 starts asking whether it should chmod a+x $f everytime I try to save a buffer that is in Shell-script mode. Switching it to fundamental-mode stops that behaviour. ...
PypeBros's user avatar
5 votes
3 answers
175 views

I want to be able to tell whether stdout is a pipe in an elisp script. This would allow to distinguish between: $ emacs --script foo.el and $ emacs --script foo.el | cat Is this possible in Emacs ...
Wilfred Hughes's user avatar
5 votes
2 answers
405 views

Recording a GIF screencast of Emacs details a few ways we can record screencasts of Emacs sessions (e.g. to demonstrate features), but I'm really bad at not screwing things up :-) Is there a way to ...
Sean Allred's user avatar
  • 7,111
1 vote
1 answer
50 views

I'm trying to modify a script I got from an old question of mine. I have many .org files under many subdirectories of ~/foo. I want to quickly run htmlize on each .org file. I have some elisp code $ ...
Brian Fitzpatrick's user avatar
8 votes
2 answers
2k views

Read process output line by line gives some partial ideas about how to deal with sub-process output in an intelligent manner, but no example and no working solution. I have a couple of examples, one ...
Joe Corneli's user avatar
  • 1,818