A list of puns related to "Emacs Lisp"
I love the emacs help interface with C-h; it makes hacking emacs lisp really fast and fluid.
Is there a way to get a similar interface for other languages? Does helm support sth like this?
I use selectrum though, but I would love a workflow for other languages that is just like the emacs-lisp hacking workflow.
Is there a plotting tool written in emacs-lisp? Basically, I am trying to plot values generated by emacs-lisp code within an Emacs package.
I'm going to replace all my local scripts (perl, python, shell) with emacs lisp.
But I'm now getting stuck at replacing my perl tcl/tk program (Tkx library) with emacs lisp.
Any idea?
Hi all, I'm butting my head against a wall here and I'm dying for some help.
I'm trying to step through the code of a lisp function. To simplify this problem, I'm just doing it with a custom hello-world function. I'm looking at these manual pages for guidance:
Entering the Debugger on a Function Call
So, following those pages, I:
Define the hello world function in my init.el
;; This is the ONLY thing in my init.el for now,
;; to try to remove any other possible points of failure.
(defun hello-world ()
(message "Hello world")
(interactive))
Open emacs and set a breakpoint on the function
M-x debug-on-entry
Debug on entry to function: hello-world
Run the hello world function
M-x hello-world
A Backtrace buffer opens up. It displays
Debugger entered--entering a function:
* hello-world()
funcall-interactively(hello-world)
call-interactively(hello-world record nil)
command-execute(hello-world record)
execute-extended-command(nil "hello-world" "hello-world")
funcall-interactively(execute-extended-command nil "hello-world" "hello-world")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command
I would expect to run the commands from Backtraces manual page, like 'n' in order to advance to the next line. But I'm getting an 'n is undefined'. What am I missing here exactly?
The first two sessions are now ready as videos on YouTube:
In each session we go over the basics of Emacs Lisp and work toward solving day to day problems. More to come!
I have been using Emacs for many years. Thanks to the fantastic introduction to ELisp, I knew enough to "configure" Emacs. For some reason only recently have I started actually thinking about how I can make my computer-life easier; and Emacs is the one tool which poses least resistence when I try to.
I am kinda mad at myself for not doing this sooner, but also very happy that I finally did. I didn't know where else to share this :-)
In last few days, I have written 2 small bits of Elisp code (which took me embarassingly long to write, but the exercise was very rewarding).
It's not much, but it is honest work and I am happy I am finally doing it.
I paradox-upgrade-packages
yesterday and now my I'm constantly getting the message:
IMPORTANT: please install Org from GNU ELPA as Org ELPA will close before Org 9.6
The startup is insanely long, because I suppose for each single open org-mode file it tries to communicate with the server and all I get is that IMPORTANT message.
https://orgmode.org/elpa.html says the archive will be deprecated, but not what is the proper replacement.
My current year-long setup is:
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(use-package org
:ensure org-plus-contrib :pin org
:commands (org-mode org-capture org-agenda orgbl-mode)
:bind ("C-c l" . org-store-link)
:init
;; (package-initialize 'org)
;; org settings
(load "~/.emacs.d/settings/settings-org.el"))
Thank you.
Hey all!
>Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.
It would be a good way to practice your Elisp Skills.
=== Leaderboard Join Code ===
1542671-a358c365
Is there an equivalent of cl's format specifiers in emacs lisp?
I haven't found anything like `cl-format` in `cl-lib`?
Is this just not implemented or is it planned to be done at some point?
First I tried generating a LALR(1) parser via Wisent parser generator but it lacks support for some of the features of the PHP grammar so then I started reading books about parsing and constructed a parser-generator library for Emacs. I used this to automatically parse the official PHP YACC grammar and convert into into a format supported by my parser-generator library and export a Canonical LR(1) Parser in Emacs-Lisp for phps-mode.
In the future I have planned to use this parser to build semantic data, bookkeeping of symbols and build the imenu index. It would be pretty easy to use the parser to transpile PHP to almost anything. My major-mode is in GNU ELPA
https://github.com/cjohansson/emacs-phps-mode
Hello all! I'm learning emacs lisp and getting used to the language. Yesterday I was trying to write a function to build and execute a shell command that I type frequently, to backup some of my files to google drive. I could make it work by hardcoding the commands, but as a learning exercise, I decided to try some fancy, overengineered stuff, to see if I can incorporate what I'm thinking in Elisp.
Well, I couldn't. I still get confused with the function/var namespace separation, and the multiple ways I can declare things (let
, letf
, flet
, defalias
, ...). When to use lambda functions or just quoted expressions. If I should use partial application or just macros (like the threading ones). Etc.
What I wanted to write is something like this:
Given a list of file paths:
"Duplicate" each
Prepend the local root directory to one part
Prepend the remote root directory to the other
If the remote (second) path is a file, transform it to its directory name*
Build the shell command for each file rclone copy local_path remote_dir_path
Concatenate all commands with ;
Execute (print) them
*because rclone's copy command requires a directory as destination.
In Python, I could write something like this:
from os import path
files = ['org/', 'pictures/image1.png', 'pictures/image2.png', 'readme.md']
build_prepend_function = lambda prefix: lambda str: prefix + str
prepend_local_root = build_prepend_function('~/')
prepend_remote_root = build_prepend_function('d:macbook/')
extract_dir_path = lambda file: \
file if file.endswith(path.sep) else path.dirname(file)
build_move_to_remote_shell_command = lambda file: \
'rclone copy {} {}'.format(prepend_local_root(file),
extract_dir_path(prepend_remote_root(file)))
commands = (build_move_to_remote_shell_command(file) for file in files)
script = ';'.join(commands)
print(script)
I can even translate it to C#:
using System.IO;
var files = new List<string> {
"org/", "pictures/image1.png", "pictures/image2.png", "readme.md"
};
Func<string, Func<string, string>> buildPrependFunction = prefix => str => $"{prefix}{str}";
Func<string, string> prependLocalRoot = buildPrependFunction("~/");
Func<string, string> prependRemoteRoot = buildPrependFunction("d:macbook/");
Func<string, stri
... keep reading on reddit β‘I'd like to get very good at emacs lisp, but I'm usually at a loss about what I can do when I want to practice Elisp. What I've been doing so far definitely hasn't been working (implementing a function here or there, going through the EINTR and emacs list manual, looking up things online.)
What's worked well for my learning style is to have a "question of the day" programming challenge, where the poster posts their own implementation of a programming problem the next day.
Does anyone know of something like this for elisp?
Thanks
I have always wanted to write a completely hackable text editor which can be changed on the fly. I feel Emacs is the best when it comes to that.
While I may start someday, what would be a good language to write it in? In my limited knowledge, the language should have the following properties:
While many may suggest python, would that be good enough? I've heard it has slow execution speed and is not af all backward compatible. I could be wrong.
Also, I believe the first step to writing such an editor would be writing an interpreter for the language in C/C++ and then writing the editor in that interpreted language? Isn't that how Emacs is written?
I would really like your inputs. I know the question is really broad but I guessed Emacs veterans on this sub would be best qualified to answer my questions. BTW what do you guys think of TCL/TK?
Edit: thank you guys for all your suggestions. When (and if) I start this project, I will definitely keep your suggestions in mind. Thank you!
Has anyone ever tried programming their Emacs configuration purely in Common Lisp?
Perhaps by using an ad-hoc Common Lisp -> Emacs Lisp transpiler?
Are there any tools that relate to something like this?
Or is there nothing interesting to be seen about an idea such as this?
Hi all,
https://preview.redd.it/7wpqwnplv3m71.png?width=1810&format=png&auto=webp&s=269dd8aeb31d2c7751687f861a3bb5cebd3ffe2b
However, I want to be able to compile and run .lisp
files like I can with python (for example: python
main.py
).
As good as the repl is, I want to just write my test cases in a file and just execute the functions as many times as I want.
Hey emacsers. Yesterday I finished a first prototype of phpinspect.el. It's a project of mine that has been sitting unfinished in my dotfile repo for years. This weekend I decided to see if I could get it in a working state as I have to write a lot of PHP in the near future.
My problem with LSP mode and php language servers has been that they try to parse and cache every single file in your entire project. I have had php-language-server die on me with memory leaks from indexing an enterprise application with 1000s of classes and trying to keep it all in memory. phpinspect.el only parses files on an as-needed basis, kind of like the php autoloader, and keeps its cache in a global variable which you can unset to purge it.
If enough people are interested I intend to do some cleanup, write some tests and release the code somewhere for anyone to use and contribute to. Let me know what you think :).
Demo vid: https://www.youtube.com/watch?v=pz7N2hTbLYw
( don't mind the log buffer on the right, it's not auto-scrolling)
What works:
What doesn't work (yet):
list ($var1, $var2) =
edits: formatting
edit: Parsing mixed php/html templates actually works. It's been a while since I looked at the parser logic so I didn't remember, but it's in there and it seems to work from what I have been able to test out :).
edit (15 sep 2021) : I have just now posted link to the source repository here: https://www.reddit.com/r/emacs/comments/popk83/update_phpinspectel_php_parsercompletion/
Is it possible?
Is any project doing it?
Are there any case studies or repositories to look at?
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.