15 ms·
Emacs: The most successful malleable system
- nickdrozd 7y ago> Lesson #1: Provide significant out-of-the-box utility There has been a push to move certain modes out of the core Emacs distribution and into package repos, I guess because it makes it makes them easier to maintain. Emacs comes with a Python mode, for example, and that conceivably could go to ELPA. But not everyone has access to package repos, and switching from a kitchen-sink model to a framework-for-external-repos model would make Emacs far less useful for such users.
- Myrmornis 7y agoWhat are the main examples you have in mind of users who can use emacs but can’t install packages?
- throwaway7234 7y agoI can offer one data point. The company I'm an on-site (well, usually) contractor for, whose network I use at work, proxies web traffic over HTTP. It's encrypted at the proxy for HTTPS, but everything outbound from the internal network is effectively plain text. Emacs doesn't allow packages to be installed over HTTP, so in order to use the package repositories, I have to use my phone as a hotspot.
- zlalanne 7y agoIf you have sufficient disk space (~5GB), you can also keep an elpa-mirror on your machine. https://github.com/d12frosted/elpa-mirror https://github.com/d12frosted/elpa-mirror
- tikej 7y agoDidn’t know about this possibility. It’s a good idea to archive it locally and update regularly (just in case something happens with internet ;). Is the same possible for melpa?
- Myrmornis 7y ago> Emacs doesn't allow packages to be installed over HTTP Are you sure about that? I think that you can specify http as usual in the URL: (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) See the instructions here which go to an annoyingly extreme level of ugliness to set the protocol in a paranoid fashion: https://melpa.org/#/getting-started https://melpa.org/#/getting-started
- tikej 7y agoProbably someone on the remote machine with restricted or no internet connection and admin privileges. It happens e.g. on company or academic clusters. It is much easier to ask admin to install emacs and use defaults than to ask to install emacs and packages (and resolve problems that may happen on the way).
- nickdrozd 7y agoI use Emacs at work, where unapproved external packages are prohibited. If Python mode were pushed out to a repo, I would basically be forced to use another editor. Another example might be using Emacs on a device without network access. If we relax "can't" to include "won't", then there are casual users who might want to try Emacs but can't be bothered to set up package archives, etc. Such a user will start it up, say "What, no Python mode?", and switch to something else.
- simtel20 7y agoIs there a powerful resistance to approving elisp packages that aren't default? Could you lay the groundwork with whoever maintains the list of approved packages by asking about approving certain versions of emacs packages that you use, and make your current setup much richer at the same time (e.g. by adding lsp-mode, ms-lsp, flycheck and whatever else you may be doing without now).
- craigsmansion 7y agoWhat is really an "external package" in emacs? There should be nothing stopping someone just copying and pasting an entire elisp source text from a website into scratch, evaluate the buffer on the spot, and have the exact same functionality as installing the package would. I'm not saying that retrieving an external package isn't easier, but due to emacs' nature there isn't really sort of delineation based on how the elisp got into the emacs.
- Myrmornis 7y agoIt's more complicated than that: Emacs packages should be thought of the same as any other language's packages. They might comprise multiple files, and it's possible that their performance will be noticeably compromised if they are not byte-compiled. Installing Emacs packages should be done with the package manager.
- Myrmornis 7y agoHaving never worked at a company like that I'm curious how it works. Is it - No http/https connections - No write access to home directory - Internal prohibition against downloading/using something which is a "software package" ?
- dmortin 7y agoOnly a tiny minority of users can't access package repos. They can download the packages at home and mail themselves in a zip file. It's trivial to create a zip file containing the necessary files, plus a config elisp file which has the personal customizations.
- nickdrozd 7y ago> Only a tiny minority of users can't access package repos. That sounds like a verifiable claim. Do you have any proof?
- dmortin 7y agoOnly my personal experience. I never encountered a situation in my professional life where I couldn't access the net. How is it verifiable? Is there some statistics of this?
- deleted 7y ago[deleted]
- salawat 7y agoThe problem with that Point of view is discoverability. It's the same issue I have with tweaking Vim to slowly provide some better ergonomics for my projecting, and has honestly been a consistent hurdle even when I was first learning computer suites like Word Processors and other office stuff. I've never done well at navigating the initial humps of learning plugin/package ecosystems. Especially when I can't phrase what it is I'm looking for correctly, and I've grown reluctant to spend excessive amounts of time trying to dedup toolsets because it leads to pristine garage syndrome. You have a system gleaming clean and ready to do things, but you're so exhausted getting things just so, you don't do anything with it. It has nothing to do with the fact I like to blow away and remake systems on a regular basis, I swear. :P
- mrspeaker 7y agoI kinda hope they don't go down that path: the over-the-top, kitchen-sink-ness absurdity is what I love about Emacs. I've only been using it for a few years, so I'm still stumbling down crazy rabbit-holes (more like, giant caverns) of functionality and tools that I never knew were there - and can't believe that they'd bundle in by default. Sure I'll probably never need most of the stuff - but it make me happy to know it's there... and is great fun to explore: especially if you're on an 18 hour flight with no wifi!
- slightwinder 7y agoI never understood that argument. What prevents emacs-devs from maintaining an emacs-core with all modes outsourced to ELPA, and still deliver a emacs-classic-distribution which loads packages from elpa on compiling? You can easily mark versions of the elpa-packges matching the emacs-classic-version, while developing it independant from it.
- svat 7y agoWhile I am a fan of Emacs (IMO any one of Org, AUCTeX, or Magit is in itself a worthwhile reason to use Emacs, though of course the ease of customizing nearly anything with just a few lines of elisp is the main comfort), I think it's also worth looking at lessons from the failures of Emacs — what prevents or prevented Emacs from being even more successful? (As the post says, Emacs's "success" is only when considered relative to other malleable systems.)
- dmortin 7y agoThe defaults. They aren't very good, IMO. Many users don't want to spend time with customizing, they want a system which works instantly with language plugins, and so on. VSCode does a very good job at that. Emacs is for people who like to deeply personalize their editors. That's why I use it. But it takes time and learning elisp and many people are unwilling to do that.
- mrspeaker 7y agoMy theory is that the awful defaults are a test: a baptism of (pretty ugly) fire. It's designed to make you take one look and walk away in amused bewilderment... which I'd say is the right choice for most people! People want "it just works tm". Emacs is not that kind of application. If you actually go through the crazy slog of making it usable and beautiful, then you pass the test and are hooked forever.
- jpxw 7y agoI’m not sure this is true. The enormity of the amount of things that need to be configured before it becomes usable leads new people to use things like Spacemacs etc. This means they rely on other peoples’ config, and aren’t able to customise the editor for themselves. The same issue exists in Vim. So many nice features of Vim (such as file management using buffers) are underused, because by default they aren’t configured in a usable way.
- clarry 7y ago
- dmortin 7y agoThe strength of emacs is that once you can program it it's extremely easy to write extensions for it, even for one off tasks, because it's so quick and easy. Compared to this writing extensions for vscode, for example, is much more convoluted. You wouldn't create a new vscode extension for a 1 hour task, while with emacs it's trivial to write some small code which can help you with your current task. I often do.
- slightwinder 7y ago> The strength of emacs is that once you can program it it's extremely easy to write extensions for it It's not easy by many miles. It's possible but learning the emacs-environment to some aceptable level can take much time and toll. > Compared to this writing extensions for vscode, for example, is much more convoluted. Depends on your competence and tooling I would say. From what I've seen, it isn't much harder than writing something midly complex for emacs, But very simple stuff is easier done in emacs, something like single functions. But those have the price that you need to learn emacs lisp on decent enough level first. But the question is, if you already can code, then why bother with creating elisp-code or an vc code-extension? Today there is a good change that you already known some useful tooling-language.
- heinrichhartman 7y ago> It's not easy by many miles. Depends on the perspective of-course. I mean, LISP is a real barrier, but once you got over the parenthesis and suck-up some quirks [1], you can get productive quite easily. Here are two example extensions from my `init.el`. (defun hh-curl (url) "Create tmp buffer with curl output" (interactive "sURL: ") (let ((buffer url)) (with-output-to-temp-buffer buffer (shell-command (format "curl -s %s" url) buffer) (pop-to-buffer buffer)))) (defun hh-insert-date () "Insert current date in ISO format" (interactive) (insert (format-time-string "%Y-%m-%d"))) It's really not all that much syntax. You can get interactive help by navigating to a function call and press `C-h f`. Installation is trivial: Just drop it to init.el. Use this function my typing `M-x hh <tab>` to see all my extensions, if I forgot the name. I have bound hh-insert-date to a key b/c I use it frequently. [1] https://www.heinrichhartmann.com/blog/problem-lisp.html https://www.heinrichhartmann.com/blog/problem-lisp.html
- olivierestsage 7y agoThanks for sharing this. My personal experience speaks to a lot of what the author mentions: I'm an academic with little programming experience to speak of (mainly some Java in high school), and it always seemed to my younger self like there was this insurmountable hurdle between the language-learning phase and the part when you can actually develop useful applications. Now, of course, I know that this is not necessarily true of programming, and that this discouraging feeling is something beginners experience in many fields--but that's how it seemed back then. Flash forward to now: I picked up Emacs a year or so ago because of Org-mode and its promise of organizing my tasks. Gradually growing my init.el to fit with my way of thinking was my first encounter with programming with any kind of direct practical application, since (as the author mentions) a beginning user frequently pastes simple Lisp functions off StackExchange, and you can kind of puzzle out how they work with your own eyes, immediately, even if you lack significant training. It soon gave me the goal of using code that I could understand (at least somewhat) when I needed new Emacs functionality, rather than just downloading a big package off MELPA that would be far beyond my comprehension. And that was the point I started to learn Emacs Lisp. Currently I've been working on a minor mode. Who knows how long it'll take me, but it's been a fun ride, and I credit this personal development to the lack of barriers in Emacs that the author describes.
- asimilator 7y agoIronically I think org-mode is a great example of a non-malleable system. When I started using it I slowly tried to customize it to better suit my needs, but everything was quite brittle. Posted a comment awhile back with some specific examples from my experience: https://news.ycombinator.com/item?id=20551598 https://news.ycombinator.com/item?id=20551598
- karlicoss 7y agoI'd say it's very customizable, but requires (sometimes significant) time investements. I'll respond here since can't reply to the original comment: 1. "leading stars" -- I think the solution is org-hide-leading-stars (and it is basically the hack you are describing) 2. "now it takes multiple seconds to refresh my agenda view" -- org-super-agenda is a pretty mature library handles groups well. As for performance, the most significant speedup for me was setting org-agenda-span to a lower value 3. "it's actually pretty hard to find good examples of a full org-mode workflow." -- agree. One reason is perhaps because it's quite hard to communicate your workflow to other people becaue it's too specific to your needs. 4. "But problematically I now have a lot of files with similar names" -- yep, refile-outline-path, but also uniquify helps a lot. 5. "Apparently org-mode deliberately prevents the end user from adding their own custom emphasis formats" -- don't know whether that's the case; but you can abuse org-add-link-type, then you could write [highlight:Some text to highligtht], and do whatever styling you want during the export. Hacky, but kinda does the job. Finally, it's at least possible in theory to override any org-mode function and change the logic. Of course, you can do it with any other text editor, but it would be way less effort to hack Emacs (even if it's dirty and adhoc). I can however understand the frustration. It took me several attempts to pick up Emacs and Org-mode specifically. And I'm still very often frustrated by it, but I personally find being able to bend your editor into doing exactly what you want worth the effort.
- haolez 7y agoEmacs is amazing. I stopped using it a few years ago because I became lazy to keep my configuration and extensions up-to-date. I was also extremely bothered by the fact that the cursor cannot live outside the current viewport and scrolling the buffer would drag the cursor as well. At the time, it seemed impossible to fix because of the way Emacs works, and the solution was something like "you are using it wrong - you need to use marks instead". But I would love to go back to it, to be honest. VSCode is very good, but Emacs is a whole other level of automation and convenience.
- Theizestooke 7y agonot sure when it was implemented, but to keep the cursor position fixed while scrolling (setq scroll-preserve-screen-position 1)
- aplaice 7y agoUnfortunately, that's not what OP wants. What OP wants is that when they scroll, the position of the cursor remains at the same position in the buffer (the contents), even when that means that it leaves the currently visible screen. What scroll-preserve-screen-position determines, is whether the point/cursor stays at the same visual position in the screen — i.e. if for instance your cursor was in the middle of the screen, it will stay in the middle when you scroll. OP needs the currently non-existent scroll-preserve-buffer-position.
- taeric 7y agoYou could just set mark when scrolling starts. Then, next cursor move jump back to mark first. Some heuristics to make it fully behave. Multiple scroll events should not modify mark, for example. Mouse click does not jump back to mark. Etc.
- danShumway 7y agoThe lack of "scroll-preserve-buffer-position" has been a very minor pet peeve for me for multiple years, and for some reason this very simple solution just never occurred to me. I can't believe I didn't think of this. I'm already using marks to keep track of position when I scroll, it's just all manual right now. I'll likely mess around with some hooks in my config this weekend and see if this is actually feasible, or if it comes with caveats I'm not seeing right now. I guess it would need to account for multiple windows open into the same buffer too.
- timonoko 7y ago(global-set-key (kbd "å") 'hippie-expand) ; Swedish "å" is useless in Finnish keyboard. ; After 40 years I finally understood I do not ; have suffer this injustice anymore. Quite logical ; because "ååå" pronounced in Gay Swedish way is an ; expression of frustation and indecisiveness.
- nhojb 7y agoAuthor mentions web browsers and extensions in the context of barriers to creating a successful malleable system. Surely the web browser - considered in relation to web pages & technologies (HTML, Javascript etc), rather than extensions - is perhaps the most successful malleable system in history. The core browser "functionality" has been and can be extended in an almost infinite number of ways via web "pages". You could consider his dichotomy between "foundational" features (unavailable to the user/tinkerer) and extendable features to be comparable between Emacs (C vs elisp) and the Browser (C++ [for example] vs HTML/Javascript/CSS). I realise that to "extend" the browser by building a web page includes a great deal more friction than playing with elisp in scratch. Does this rule out the browser as a "malleable" system?
- oefrha 7y agoEmacs includes a web browser out of box (just saying; I know its limitations).
- henrikeh 7y agoDoesn’t that argument just indicate that web browsers are in fact more widely used and “successful”?
- slightwinder 7y agoFollowing that logic, wouldn't be everyting that eats content to display them malleable? Image-viewers, audio&video-players, office-applications, MS Paint and Windows Notepad? They all have the core-functionality of showing something to the user which is not embedded in their source-code, while this core-functionality is part of it. If anything, I would go for web pages as a malleable system. Because with userscripts and userstyles you can change them however you want.
- frank2 7y agoYou are taking the point of view of a web developer, not a web user: a web browser gives a web site's developer a lot of control over the experience of a visitor to the web site; the visitor has some control over his or her own experience, but not much. In contrast, an Emacs user has a lot of control over his or her own experience. Simple example: Emacs is of course used to view files not written by the Emacs user. It is the sole decision of the Emacs user what size, color and thickness/thinness the text will be. In contrast, the writer of a web page decides those things, and maybe the user can modify that and maybe they cannot. In Chrome for example, there is no simple way to increase the text size without also increasing the size of all the other elements on the page (without increasing the zoomLevel, in other words). If some of those other elements are fixed-position elements (elements that remain in the viewport no matter how much the user scrolls) that already take up a large fraction of the viewport (which happens a lot when you browse the web on a 1360-pixel-wide monitor and you have old eyes and consequently need large text), it might not be possible to increase the zoomLevel.
- agentultra 7y agoEmacs is more like an Elisp programming environment that happens to have a text editor built in. And a window manager, process manager, shell, terminal multiplexer, async event loop, cross-platform OS APIs, debugger, a bazillion libraries for everything you could need. Just to see how far one can go I cobbled together a few libraries one afternoon and wrote a Dockerfile that enables one to write web applications in Elisp: https://github.com/agentultra/Dockmacs https://github.com/agentultra/Dockmacs I'm having trouble finding them but I've read stories of hackers developing and deploying useful applications they built in emacs to end users. I don't know that I'd go that far but... you do get cross-platform GUI controls so it doesn't seem impossible for simple, straight forward tools.
- NateEag 7y agoOne you may be thinking of is that Amazon used an Emacs Lisp interface for their customer service for a number of years. https://sites.google.com/site/steveyegge2/tour-de-babel https://sites.google.com/site/steveyegge2/tour-de-babel Search for "Mailman" to find the relevant bit.
- wildchild 7y agoRetarded shit.
- platz 7y agoI use emacs for two primary use cases: - Niche programming languages tend to have invested resources into building an emacs mode for their language. Importantly, these emacs modes tend to be maintained by core language contributors. In contrast, VSCode or other editors tend to be community contributions which are discarded over a period of months/years. - markdown editing - that's it (I've tried magit (too clunky/sensitive), org-mode (too much lock-in), etc On windows i find Emacs horribly slow to render text/buffer updates. On linux it is blazing fast.
- pvik 7y agoI find it weird that your point against org-mode is "too much lock-in". It is a plain text format, which looks good even wherever it is viewed. Pandoc even supports org-mode[1], which should let you convert an org-file to say markdown if you want.
- platz 7y agosure, only if you stick to bare-bones org-mode. if you start using any of the "power-features" unique to org-mode you're stuck. If you restrict yourself to markdown-compatibilty, why not just write in markdown?
- miki123211 7y agoEmacs is malleable enough that someone implemented a whole screen reader in it. The basic idea is that you have a library that lets you stick your own code at the beginning/end/around existing functions. So, someone did that for functions responsible for moving to the next/previous line/word/character, and they had a basic screen reader in place. In about 30 minutes. Now, it's far more advanced, and, because of the malleability, you can "hack" information out of someone else's code if they don't provide it to you directly, which comes in very handy for such things. As an aside, NVDA, the main screen reader for Windows at this point, is very malleable too. It's written in Python, so extensions can modify anything they wish. Amazing things have been built for it, including a whole remote access package, team-viewer style.
- rvr_ 7y agowhat about minecraft? seems way more successful and malleable
- philote 7y agoYep, with vanilla minecraft you can make a ton of interesting changes to the game using command blocks, redstone, etc. And then you have to consider modding, which opens up infinite possibilities.
- Decabytes 7y agoOne idea I've always wanted to try out if I had the knowledge and time is creating a text editor in Racket that effectively worked like Emacs, but instead of elisp you leveraged the language creation features of Racket. So your init.el could be #lang Python and then you would configure it using Python, or #lang Java or even #lang elisp. Of course all of those languages are just being translated back into Racket but that's not the point. The idea would be that you could customize the editor using the syntax you preferred. There are definitely some cons to this approach. But the goals would be accessibility and customizability for the end user especially people without a programming background. Oh and you could choose Emacs or Vim keybinding and all editor functionality would be supported using either.
- taeric 7y agoIt was a trend not long ago to use org as a form of literate config. Not sure if it is still possible, but the general idea is similar.
- karlicoss 7y agoThat's my dream! Do you know of any existing efforts towards it? I don't know much about Racket, how would #lang Python thing work (i.e. in terms of calling foreign functions etc)?
- willghatch 7y agoI intend to write at least a small version of this. There are a couple of existing “Emacs-in-Racket” projects which I may borrow code or ideas from. The older one is https://github.com/tonyg/rmacs https://github.com/tonyg/rmacs, which runs but is not in a state where it's really usable for anything, and there is a newer https://github.com/soegaard/remacs https://github.com/soegaard/remacs which I have never gotten to run on a Linux system. Essentially my plan is to make an Emacs-like editor with a line-editor interface for my embedded-in-Racket shell, Rash (https://rash-lang.org https://rash-lang.org). Of course, I will also make a TUI interface, like terminal Emacs, and while I probably won't write it myself, I would leave it open to have a GUI interface as well, and generally be embeddable in arbitrary Racket programs that need an editor component. While I don't have the time or will to really make something that could compete with Emacs as a general-purpose editor, or seriously try to implement a `#lang elisp` to give Emacs compatability, I think building an Emacs-like editor in Racket with an actual function that people will use (better line editing for Racket, Rash, other Racket languages) could give people enough reason to hack on it themselves that it could grow and be useful at least as a line editor. Additionally, I have some ideas on plugin sandboxing I would like to try out. In other words, while I would obviously just have an interpreter with which you could run arbitrary code to modify the editor, like Emacs but with Racket code in any #lang, I also may add an API using Racket's sandboxing features so that you can run extensions with limited, explicit privileges. I want to be able to run extension code written by internet randos without auditing it, but trust that it won't steal my ssh keys and such. That said, I'm trying to finish my PhD and I haven't even done any direct work on Rash itself for a while. My advisor says “your editor should be your first side project after graduating”, and I agree with him. So my Emacs-in-Racket may yet be eternal vaporware, and even if it isn't, advanced features that I want might not make the cut when I actually determine how much time I can commit to it. We'll see. At any rate, even if other people do it first and better, I'm likely to make a small version of this some day just because I want to -- I've already written my own terminal emulator in Racket (which works but is slow, and I don't recommend anybody use it), and my own shell in Racket (which is awesome, and I do recommend people use it, at least for scripting, and eventually I will develop it further [contributors welcome!]), so naturally I need to make my own editor as well.
- corecoder 7y agoI've been a long time Emacs user since ~1997 until ~2011, when I started developing mostly with ruby on rails on a mac, discovered TextMate and falled in love with it, with its slick UI, freshness (at the time) of ideas, ease of use, despite its obsession with mac based stuff, like the use of Finder for project navigation. After a few years I discovered Sublime Text, with its tons of extensions and exceptional speed, bought a subscription and learned as much of it as possible, ditching TextMate. Then I switched to Atom, mostly for the discoverability and the speed (back then) of development (and, frankly, for the hype). The only problem with Sublime Text, at least at the time, was the slow development process: new builds were few and far between. I tried VS Code too soon, and wasn't impressed by how the navigation between buffers used to work (it has changed since then, I think). A few years ago I did a serious attempt at learning Vim for good, but in the end I gave up, and I've come back to Emacs, this time to stay, unless something radically new is introduced. The good thing is that I can usually tell my coworkers about features of the editors they use that they don't know, because I've used them a lot. The only feature I miss from all other editors is the incredible speed of Sublime Text: to this day, if I ever have to edit an SQL dump (which I hope I will never ever have to do again), I'm surely reaching for Sublime Text, no other editor can AFAIK open a 200+MB file without freezing and/or crashing. The odd thing about Emacs is that its vastly superior customizability (or malleabilty, as the article says) tend to be a trap, for one can spend hours, and days, getting lost in its huge universe and falling into rabbit hole after rabbit hole instead of actually getting stuff done, but I've not yet decided if that's a bad thing or a good one.
- fluffything 7y ago> I'm surely reaching for Sublime Text, no other editor can AFAIK open a 200+MB file without freezing and/or crashing. For this I use the xi-editor. 20 Gb text file? No problem.
- nerdponx 7y agoI didn't realize Xi was in a "usable" state now. What frontend do you use?
- rbanffy 7y ago> Note: Geoffrey Litt’s post on browser extensions takes a different point of view, considering browser extensions as a way to modify not browsers but Web applications. This one rang a bell. When I was working for Canonical, I built an extension to make Launchpad more comfortable for me. It still has some users (but probably needs a lot of fixing): https://chrome.google.com/webstore/detail/launchpad-tweaks/pinhffhfibgmfgjjafafhiaegdmomhhk https://chrome.google.com/webstore/detail/launchpad-tweaks/p...
- UI_at_80x24 7y agoI've been curious about emacs, and tried it once without know what the hell I was doing. But I've heard enough good things that I'm considering trying again. I run i3 and vim, so I already have my tiling WM dialed in, and I'm good enough with vim that I don't struggle with using it. I have almost 0 interest in learning Lisp, beyond what I'm willing to learn to make emacs fit my use-case. I spend all day in terminal windows. I've heard about ORG-mode, and wondered if it will help me become more organized. I killer-feature of vim that I've edited into my work-flow is that I have it auto-save a backup copy+time stamp of any file I save. It's a VCS-style hack, that 'works for me' and I think it is a better fit then git would be under the situation. (i.e. httpd.conf_2020-04-15_14:10:01) Can a similar hack be incorporated into emacs?
- hexmode 7y agoYes. Though, I would say, you should really look at something like https://github.com/ryuslash/git-auto-commit-mode https://github.com/ryuslash/git-auto-commit-mode so your directories don't get cluttered with save files.
- bullen 7y agoSure, would be nice if there was an alternative to install that didn't need a MySQL client though!
- mgummelt 7y agoI think that title must go to Excel.
- rini17 7y agoExcel is malleable? Not really. For example while it is possible to port org-mode to excel, AFAIK nobody did it.
- oblio 7y agoThey built ray tracing engines and games and whole financial systems in Excel, it's possible. Probably nobody cares to do it as "org-mode" for Office is called Outlook ;-)
- dan-robertson 7y agoEmacs is an excellent malleable system because elisp is an excellent programming language. A few important qualities that make it particularly good for this sort of environment: 1. Dynamic scope. Dynamic scope (aka special variables) means that if I locally bind the variable foo to bar, that binding is available for the dynamic extent of the let (ie a function deep in the call stack may access that binding of foo even if it was not defined lexically inside the binding). This allows passing state or options or configuration between different places which are amenable to extension, or modifying the behaviour of existing features by temporarily modifying their state. In other systems these problems may be solved by using lots of arguments, special mechanisms for passing custom parameters around, or well defined protocols to extensions with their own state. In those alternatives the fallback is either to impossibility or to storing state in poorly managed global variables. Elisp handles that “local global” state better and eg makes sure it correctly deals with multiple bindings or stack unwindings. One example usage would be for some custom comment syntax. You can just (locally) bind custom values to the variables which define the comment syntax and then call the usual comment function. 2. Hooks are very natural data structures which extensions use to make explicit extension points. Because books are lists, they may be conveniently dynamically bound (e.g. (let ((foo-hook (cons blah foo-hook))) ...)). 3. Buffer-local variables attach arbitrary state to each buffer and make it available as global variable bindings when that buffer is current. The alternative would be less begged local state, state attached to many more different things, and doing lots of requests for current-buffer.state.foo. Maybe these would make you think more about the current buffer changing but I’m not sure thinking about the problems leads to less buggy code. Buffer local variables makes writing modes easier and it makes it easy to not have to care much about the existence of other buffers while still easily being able to write code that spans multiple buffers. 4. Advice. Advice is like complex hooks except you can put it almost anywhere. You can “advise” any function with extra code to run in various places (eg before, after, around, just modifying the arguments, before but the advice is and’d with the function so if it returns nil the function isn’t called, and so on). This lets you tweak just about anything. For example I was using a build-managing mode which was not so extensible but by advising process creation I could modify its behaviour to nice the compiler executable. 5. Various save-restore macros. This could be done with first class functions but programming against the macros makes common idioms so much easier. Maybe an argument could be made that not having global state would make things a lot more manageable but I think macros like save-excursion, with-temp-buffer, and so on generally keep things under control 6. Most state is globally accessible. By this I mean most variables are special, and there is lots of important state which is global or buffer local like the point, mark, window configuration, or current buffer. This means that the current state is generally available to any extension code that runs and not kept private to some other bit of code (prohibiting extensions from getting at it). It allows most behaviour to be tweaked. 7. Recursive editing. It’s just really nice that you can pause half way through your program, have some editing done, then resume where you were: the user may live inside as well as outside the elisp call stack. Though mostly this is infrequently used. 8. Simple data structures. Because most things are text in buffers, you generally move around this data structure in a rough way (search forward for this, edit that, and so on) which is resilient to that data structure being changed/extended under you. It’s curious that a lot of these qualities are generally considered terrible features for writing maintainable code. This is because maintainable code generally wants different things to not be able to affect one another much. If you want an extensible, malleable system, it probably makes sense to have things which are easy to modify the behaviour of from just about anywhere.
- zestyping 7y agoWouldn't there be a stronger argument for Excel? Excel has probably put more programming power in the hands of more people than any piece of software in history.
- TeMPOraL 7y agoMalleability refers to the ability to make your tool fit your needs. Excel is not as malleable a system as Emacs, but it's indeed one of the most powerful tools out there.
- gdubs 7y agoDoes anyone have a favorite example of the coolest thing done in Emacs / coolest, most interesting configuration?
- Uhhrrr 7y agoFor those who are intrigued by all of this, I will mention that the built-in tutorial (Help->Read the Emacs Manual) and the intro lisp tutorial (Help->More Manuals->Introduction to Emacs Lisp) are both interactive and very readable. I've recently decided to start writing my miscellaneous scripts in Emacs Lisp, both as a way to learn a lisp and a way to get more productive in a platform which I expect to be around until I die. And it's pretty fun.
- deleted 7y ago[deleted]
- emit_time 7y agoI used emacs for a year and a quarter as a common lisp developer. There was an integration into emacs from the compiler that provided support for a lot of things like jumping definitions and seeing who calls, and it was much better than the IDE IMO, in that syntax highlighting worked correctly for one, along with the ability to use multiple buffers and windows. I used it as my main place of development while I worked at that company, and it was a pretty great pleasure minus a few issues. I never tried using SLIME because our lisp didn't seem to automatically support having project files being loaded into it, but I probably would have had I stayed too much longer.