Questions tagged [elisp]

Emacs Lisp is the extension language for the GNU Emacs text editor, and in fact, most of the functionality of Emacs is implemented using Emacs Lisp. Users generally customize Emacs' behavior by adding Emacs Lisp statements to their .emacs, or writing separate packages.

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

org-table - managing my badge times

I have the following org-table datum werk start pauze start pauze stop werk stop 12/02/2024 09:48 12:45 13:14 17:22 13/02/2024 08:01 12:06 12:31 16:38 14/02/...
my_display_name's user avatar
2 votes
1 answer
42 views

Multiple regexp replace in string

I made a function that prompts me for values of variables (formatted %^{var1}) it found in a string and fills in said values. ...
my_display_name's user avatar
5 votes
1 answer
84 views

elisp function to replace text in an org file

I've made a little function for myself that replaces certain variables to text in an org file. I declare a bunch of variables in the beginning of the file and then the function replaces all references ...
my_display_name's user avatar
3 votes
1 answer
268 views

`nov.el` function to search the entire `epub` ebook

nov.el does not provide an easy function to search the whole of the ebook content. Every search performed on buffer only applies to the "document" or ...
Sati's user avatar
  • 417
0 votes
2 answers
273 views

Split a list into two parts

I wanted to split a list into 2 parts, as per the chosen size, first the size and then the list. Example: (split 3'(1 3 5 7 9)) ...
The Nightm4re's user avatar
1 vote
1 answer
45 views

Installing packages when needed

I decided to create a portable Emacs config and install packages I use if it's necessary on a fresh computer. Here is what I've done: ...
user4035's user avatar
  • 293
5 votes
0 answers
90 views

Hide your text with colorful blocks in secret(-mode)

Motivation While working on a completely unrelated task, I wanted to share a screenshot of my current Emacs frame, but not of the actual text contents. And while GIMP's pixelate filter did the job, I ...
Zeta's user avatar
  • 19.3k
1 vote
0 answers
65 views

Emacs lisp advice to start ipython repl in the project root

When starting an ipython repl for my project at work, I pretty much always want it started in the project root, not adjacent to the file for the buffer I'm viewing (this is python and module loading ...
George Mauer's user avatar
  • 1,652
6 votes
1 answer
101 views

WOMOIWIW: What Org-mode Opens is What I Want

Motivation Previously, on the Emacs stack exchange: In Org mode, when I open a link (C-c C-o) [...] [that] contains a wildcard, such as file:3_o*.pdf, Emacs opens ...
Zeta's user avatar
  • 19.3k
3 votes
1 answer
42 views

Power menu (Shutdown, Reboot, Sleep) in ELISP

I've written an interactive function which lets me shudown, reboot my machine as well as put it to sleep. I'm using emacs and I'm just starting out getting into ELISP programming. As I'm a total ...
Artemios Antonio Balbach's user avatar
2 votes
0 answers
226 views

Conway's Game of Life in Emacs Lisp

I decided it would be fun to implement Conway's Game of Life (CGOL) in Emacs Lisp as my first elisp script. My goals for the implementation were pretty simple Transform current buffer into the next ...
mjgpy3's user avatar
  • 729
3 votes
2 answers
96 views

Check for pangrams in elisp

I'm trying to find pangrams ie sentences that contain all the letters of the alphabet, for instance "The quick brown fox jumps over the lazy dog". I'm an absolute beginner in elisp, and it ended up ...
little-dude's user avatar
2 votes
1 answer
54 views

Get the suffix for the date string

Sometimes I have the date as part of the file name. And then when Emacs autocompletes the file name, it puts the part of the date. In these situations I have to write the rest of the date manually. ...
andrei-n's user avatar
  • 125
9 votes
1 answer
117 views

Edis: Emacs driven indentation script

Motivation I recently picked up Emacs. As part of the process, I've started to configure the editor to fit my needs with Emacs Lisp. The Elisp indentation rules are still foreign to me, so I pretty ...
Zeta's user avatar
  • 19.3k
6 votes
1 answer
232 views

Hook to switch the linter binaries in Emacs Lisp according to virtual environment

Problem I use Emacs for Python development along with several linters. When I activate a Python virtual environment (venv) from within Emacs, I would like to set the linter binaries according to the ...
kmdouglass's user avatar
2 votes
0 answers
757 views

Binary, octal, decimal, and hexadecimal conversion in Elisp

Every once in a while I need to convert numbers between bases. As far as I'm aware there are no existing commands that let you do this in Emacs, so I added some. These functions convert numbers at ...
Caterpillar's user avatar
24 votes
0 answers
423 views

Rubik's cube mode for emacs

Following is a dumb implementation of Rubik's cube for Emacs. I am not well versed in writing (e)lisp, so I ask for a review and corrections. ...
Srv19's user avatar
  • 455
2 votes
0 answers
46 views

Parsing diff-like annotations

I am working with annotated text that has data describing changes on it. Changes are represented by lines consisting of groups of "+++" and "---", each referring to the characters in line above. ...
Srv19's user avatar
  • 455
1 vote
2 answers
57 views

Detect resolution of X display and change font accordingly

This is my first attempt at anything functioning within elisp. This script is part of my configuration file that I use across multiple machines, one of which is hi-dpi and the other is not. To avoid ...
Bryce Frank's user avatar
2 votes
1 answer
138 views

replace a text from emacs buffer to insert it vertically with emacs lisp script

I just found this post with vim (https://stackoverflow.com/questions/704130/can-i-transpose-a-file-in-vim) and i just wanted to do the same thing with elisp by creating a little script to reordenate ...
papachan's user avatar
  • 123
4 votes
1 answer
117 views

Minimal substring with all characters contained in string

I was given following task in the interview: Given a string, find shortest substring in it that contains all of the different characters contained in the original string. Here is my solution in ...
Srv19's user avatar
  • 455
5 votes
2 answers
253 views

Expand string patterns in Elisp

I need to expand logical patterns to list of strings. For example I have the following definition: ...
ceving's user avatar
  • 413
3 votes
2 answers
52 views

Testing whether lambda expression returns true for any list element

I have the following function defined in my .emacs to test if a given executable exists within my $PATH. I implemented it with <...
lukad's user avatar
  • 131
4 votes
2 answers
4k views

Checking if val is present in list

I pretty sure it should be shoter solution. ...
denys's user avatar
  • 143
1 vote
1 answer
141 views

Start a process in Elisp

How can the following code be made idiomatic in ELisp? Can the temporary f variable be removed? ...
sevo's user avatar
  • 291
2 votes
0 answers
97 views

Replace text in emacs buffer with processed one

I have function that processes text and returns it in altered state. Result of the processing is a property list with following properties of interest: :success - ...
Srv19's user avatar
  • 455
6 votes
2 answers
280 views

X-up utility for EVE Online

I am learning Rust. I also play EVE Online – a video game about internet spaceships. I decided that it would be fun to practice Rust by writing a simple utility to help me x up. to x up (verb) ...
Matthew Piziak's user avatar
3 votes
0 answers
474 views

Filling a Boot with CIDER

I'm trying to put together a workflow for building Clojure applications with Boot in CIDER. To test this workflow, I've written a small example application using Seesaw. My project structure looks ...
Sam Estep's user avatar
  • 1,767
3 votes
0 answers
131 views

Emacs init file

The code below is the .emacs file, which is the initial configuration file for Emacs. I use Emacs version 24.5.1 on a computer running Ubuntu 14.04 as OS. I primarily use C/C++ for coding and LaTeX ...
Marvin's user avatar
  • 133
3 votes
1 answer
82 views

Iterating over global keymap, removing all bindings to super keys

Background Emacs on OS X by default binds several keys with the super modifier. I do not want these bindings as I switch between OS X and Windows frequently, and want a clean slate on both platforms ...
Shannon Severance's user avatar
8 votes
0 answers
332 views

In emacs markdown-mode making the link live and URL invisible in inline links

A few years ago I modified version 1.8.1 of Jason Blevins's markdown-mode for Emacs so that when showing inline links the URL is hidden, and so that you can follow the link simply by hitting Enter. If ...
kuzzooroo's user avatar
  • 369
4 votes
1 answer
187 views

Find relative filenames recursively in Emacs

I have a set of directories. For each directory I have a set of relative file names. I would like to select any of these relative filenames using completion, and then later reconstruct the absolute ...
Håkon Hægland's user avatar
5 votes
1 answer
169 views

Accessor functions in elisp

I'm writing some simple emacs tools for visual studio solutions. I've got a function sln-process-csproj-file. This function takes the path to a project, and ...
jcarpenter2's user avatar
5 votes
1 answer
162 views

Emacs module that generates templates for my blog's static site generator

I wrote a simple emacs module that generates standard templates that I use for my blog's static site generator. ...
Abizern's user avatar
  • 269
1 vote
1 answer
237 views

How do I avoid eval in elisp?

I have wrote a simple util to submit my code to a online judge site, how to avoid the evil function? ...
Frei Zhang's user avatar
1 vote
1 answer
132 views

A small emacs-lisp snippet for opening a register in another window

I'd like to get some feedback on whether this is idiomatic elisp, whether it's any good, and any small modifications that would be useful. Thanks ...
Squidly's user avatar
  • 113
4 votes
2 answers
504 views

Emacs column alignment command

I'm making my first steps in ELisp programming and I want to know is there a better solution for this problem: I have a file with two columns, that are separated by one or more spaces, ex.: ...
Konstantin Nikitin's user avatar
6 votes
2 answers
2k views

Combinations of list elements

It was written in Emacs Lisp and requires Common Lisp loop facility. Can this code be improved? Did I hit any anti-patterns along the way? ...
mpontus's user avatar
  • 163
8 votes
1 answer
452 views

ELisp function to allow file renaming in Emacs

As a disclaimer, this is the first function I have EVER written in Lisp or ELisp. Please, bash it as much as you would any other piece, but don't judge me for it please! :) So, I realized I wanted a ...
Max's user avatar
  • 295
4 votes
2 answers
145 views

Keys in mode maps

I noticed a pattern in some elisp modes I was putting together: (let ((map (make-sparse-keymap))) (define-key map KEY 'FN) ... (setq FOO map)) so I wrote ...
Inaimathi's user avatar
  • 2,193
10 votes
1 answer
381 views

Minor mode for blog writing in HTML

This is a collection of reasonably useful functions I put together for writing my blog. ...
Inaimathi's user avatar
  • 2,193
16 votes
1 answer
1k views

Emacs Etags Shortcut Functions

A few functions to let me manage TAGS files more easily. Typically, my projects contain at least one sub-folder. I got sick of manually updating, so I wrote this to help me update a single TAGS file ...
Inaimathi's user avatar
  • 2,193