sp1ff / elmpd Goto Github PK
View Code? Open in Web Editor NEWA tight, ergonomic, async MPD client library in Emacs Lisp
License: GNU General Public License v3.0
A tight, ergonomic, async MPD client library in Emacs Lisp
License: GNU General Public License v3.0
One of the core responsibilities of elmpd-connection--filter
is detecting when a complete response has been received. A complete response is concluded with a line of the form "OK" or "ACK [error@command_listNum] {current_command} message_text", so one could check for success by simply examining the last three characters of the current response ("OK\n"). For reasons unknown, the author obtusely chose to use an overly-complex regex instead.
This became an issue when issuing a command that returned approximately 48K of data; each invocation of the regular expression over that response (given a read buffer that was apparently around 4K) took longer & longer until Emacs became completely unresponsive.
Currently, I use string-match
, which will become increasingly slow on large responses (imagine a command list that includes a listall
followed by a command that fails).
elmpd-connection
instances may be normal or "idling"; in the latter case they will invoke the "idle" command on one or more MPD sub-systems, and when any of those sub-systems change, a caller-supplied callback will be invoked with the connection instance and a parameter meant to indicate which subsystems changed. That is presently the MPD response with the final "OK\n" stripped: e.g. "changed: player\nchanged: options\n". Not only is it tedious & repetitive for every callback to parse the text, it forces the callback authors to check for errors/incorrect text. Better to remove the gap between the semantics of this interface ("You will get a list of changed subsystems") and the syntax ("Here's some text-- you have to derive the changed subsystems from that") by, say, having the callback receive a list of symbols.
Hi,
I'm the author of mpdel and libmpdel. Very good naming choice with elmpd. It's refreshing to find someone who is as good as naming things as me :-).
Joke aside, if you want to contribute to libmpdel or mpdel, feel free to do so. I'm using these packages everyday and I regularly merge contributions from others.
Is there a reason why you decided to write your own library instead of building on top of an existing one?
Have fun hacking Emacs!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.