From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Sat, 27 Oct 2018 08:45:43 +1100 Message-ID: <87efccl6uw.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87bm7jk4t8.fsf@gmail.com> <87in1rbp3j.fsf@gmail.com> <87h8hbkph3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG9vT-0001az-7g for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 17:45:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG9vS-00011f-6o for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 17:45:51 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:40726) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gG9vR-00011O-W1 for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 17:45:50 -0400 Received: by mail-pg1-x52f.google.com with SMTP id o14-v6so1119304pgv.7 for ; Fri, 26 Oct 2018 14:45:49 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Samuel Wales Cc: Roland Everaert , Org Mode Samuel Wales writes: > can either of you give examples of code or settings that you had that > made behavior of new modes unpredictable because emacs started > supporting the behavior you made the code or settings for? > It is difficult to remember now as it was some time ago that I cleaned up my init and got rid of much of my old stuff. Areas I do remember include - Key bindings. This is probably the most common. You would enable a new Emacs feature only to find you had conflicts with key bindings. In the best case, some new features couldn't be easily accessed. In the worst case, a new feature would create unexpected behaviour. The hard part was often in deciding whether to try and change the bindings or change my finger memory. - Hooks. This was probably the second most common problem. A new feature would add to a hook where I had a similar feature also on that hook. As a result, both would run and result in unexpected outcomes. - Convenience functions for selecting files, buffers and windows, working with sets of files (i.e. projects), My setup predated ido, and packages like yasnippets, projectile and company mode which I now use. In many cases, my own tweaks were OK, but not as robust or feature rich as standard packages that were added to Emacs over releases which provided similar functionality. - As my init had grown in a rather 'organic' manner - bits added as I needed them, there was a lack of consistency or structure to my configuration. As a result, often when I tried a new feature, there would be parts of my init I would forget to remove/disable that would conflict with that feature. As I used autoloads quite a bit, things would also be a little inconsistent as conflicts could be dependent on the order things got loaded and that order could be affected by what I did in a specific session. - One area I do remember was with respect to handling of PDF, HTML and other document types. I had a lot of config which would automatically convert many of these types to plain text to make them easy to work with inside emacs. As modes like doc-view, eww etc were added. I recall at times, conflicts would occur. I remember at one point, what behaviour I would experience when opening a PDF would depend on what mode had been loaded. If doc-view was already loaded, I would see the PDF rendered using doc-view - if my code was already loaded, I would see a plain text version. Often, the result would not be the one I wanted. I now no longer have all that code in my init and leave such things to Emacs. In my case, much of my elisp config was pretty rough - I did as little as necessary to get the behaviour I wanted. It was often poorly tested, lacked sufficient error checking, was inconsistent and overall rough - it did the job. However, this did mean it often did not play well with others. For ages, I simply didn't bother looking at new features and modes unless I came across a new requirement e.g. learning a new programming language, working with a new system etc. My init also had large amounts of code borrowed with pride (aka stolen) from newsgroup postings, web sites, mail lists and various elisp repositories. As I tend not to bother compiling my init, you would not necessary be aware of obsolete and deprecated functions used by this code. The lack of any namespace for packages also meant name conflicts were sometimes the cause of weird bugs etc. Overall, things were 'fragile' and you would avoid making changes as much as possible. I was frequently surprised when I decided it was time to cleanup my init at various improvements and enhancements that had been added to Emacs. This is partially a result of the conservative approach Emacs tends to adopt - a good approach as it means you can usually upgrade to a new version and not end up spending hours fixing things just to get back to work. However, the downside is that it also means you may not even be aware of or benefit from some improvements. The positive is that now I have a nicely structured and documented org file with my init and making changes is easy. Actually, I have multiple configs - a standard working config, a 'new features' config where I try out new packages etc, a very simple minimal config I use for testing/debugging problems etc. I have a simple shell script which I can run and pass it an org file name which will generate a new init.el and I keep it all in git. At this time, I'm probably happier with my Emacs setup than during any period in the last 25 years. Tim Tim Cross