7 ms·
F.el: Modern API for working with files and directories in Emacs
- neea 4y agoThere are a number of these 1-2 char libraries for working with common primitives in elisp -- I love them: https://github.com/neeasade/emacs.d/blob/055ddb2a2f442ee207e5ec14b18437afbfc02fda/lisp/dirt.el#L33-43 https://github.com/neeasade/emacs.d/blob/055ddb2a2f442ee207e...
- kgeist 4y agoWhat makes an API modern? Almost all projects posted on HN say they are modern.
- blux 4y agoIt doesn't really mean anything, it is just a modern thing to say when announcing a software project.
- mickeyp 4y agoEmacs is 40-odd-plus years old, and so are many of the names of functions in it. As a result, they may not have intuitive or obvious names. Emacs also does not use namespaces. That makes discoverability even harder. In f.el and so on, the functions are consistently named and prefixed with `f-'; this is indeed what makes it modern.
- sokoloff 4y agoTIL that we can have around 26 modern APIs in emacs. Faux-namespacing by convention looks appealing on first glance/in isolation, but I think it falls apart in the context of the overall emacs package ecosystem.
- rawoke083600 4y ago...and lightweight and small
- jonathanstrange 4y ago"minimalist" (aka unfinished)
- notagoodidea 4y agoIn this case, it is due to emacs having it's own way of modelling a lot of things for a long time. Modern only means "like the other API we tends to use elsewhere these days".
- Saint_Genet 4y agoIn this case, it seems to mean "what I'm used to"
- bitwize 4y ago"Modern" roughly means "familiar to someone born in the 21st century, and who has only ever seen computers with glossy, composited desktops".
- sph 4y agoModern to me in that context means "recent." Good luck writing an ancient API today.
- mickeyp 4y agof.el and friends are useful, and add a lot of value. But elisp's function naming is all over the place and that can make it harder than it needs to be to find what you're looking for. That is also why people turn to libraries like f.el. Emacs 28 adds a builtin Elisp cheat sheet command that collates a lot of Emacs's elisp functions into neat categories along with examples and hyperlinks to the manual. So, if you don't want a third-party library like f, dash, or s, you can give it a try first: I wrote about it here: https://www.masteringemacs.org/article/emacs-builtin-elisp-cheat-sheet https://www.masteringemacs.org/article/emacs-builtin-elisp-c...
- _k9eq 4y agoI loath these and related libraries. They promote a style that diverges from regular Emacs Lisp code that makes it hard to read if you are not familiar with the additional language, and on top of that frequently promote a wasteful and inefficient style (e.g. instead of searching a buffer it is converted into a string, split on newlines, filtered and then checked if the filtered list is nil). I've sent out numerous patches to remove these leftpad-esque dependencies from projects that often only make use of one or two functions, that more often than not are just alii for built-in functions. Of all these libraries dash has some kind of a legitimation, but all the rest I consider code smell and makes me question if using the package is even worth it. Also note that (besides dash), emacs-devel decided against adding any of these packages to the ELPAs. This has made it harder to add a number of packages to NonGNU ELPA, but has been a good excuse to get rid of the dependencies. If anyone is looking for some good Elisp exercise consider sending a patch to replace f/s/... with built-in functionality. In case dash/f/s/... provide functionality that is not available on older releases of Emacs that one still intends to support, consider using compat (https://elpa.gnu.org/packages/compat.html https://elpa.gnu.org/packages/compat.html), a library that I have been developing that attempts to backport recent developments for older releases.
- fishbacon 4y agoWhen it comes to f and s. Yes. Definitely, I do not want them and I do not need them. I like dash because it gives me the convenience of threading macros and anaphoric functions. Are there options for those in compat/emacs standard?
- daptaq 4y agoDash is weird because it is both a list library and and bundles macros. Conventional Emacs Lisp does not use anaphoric macros, and to my knowledge the ideomacy their usage is generally contested. Threading macros and stuff like if-let & co. have been available for a while and are backported by compat.
- fishbacon 4y ago
- laerus 4y agoI like these libraries cause they add to emacs something that is missing more than the functionality, consistency. Even though I used to avoid dependencies and write my own little functions. Sadly I had to give up emacs after 3 years of wasting a lot of my time in elisp, before that i used vim for a decade. I still love both of these tools but I just don't have the time and energy to spare anymore for configuring, debugging and learning packages. The power that comes with emacs is amazing but I realized that it's also an incredible time sink and I would rather spend this time on other stuff like learning a new language. I am evaluating both VSCode and CLion atm as my next goto IDE, I can't say I'm excited with any of these but I guess I value opinionated tools with defaults that "just work" if they save me time.
- singaporecode 4y agoI prefer dired mode, it’s pretty easy to get a handle of https://ashok-khanna.medium.com/introduction-to-dired-mode-91cecd3a06ff https://ashok-khanna.medium.com/introduction-to-dired-mode-9...
- rcthompson 4y agoThis is an API, not a file manager. They're not really comparable.