emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] electric-pair, autopair, smartparens, etc in org-mode


From: Tim Cross
Subject: Re: [O] electric-pair, autopair, smartparens, etc in org-mode
Date: Sat, 27 Oct 2018 08:45:43 +1100
User-agent: mu4e 0.9.18; emacs 26.1

Samuel Wales <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]