unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: dieter@duenenhof-wilhelm.de
Cc: aprekates <aprekates@posteo.net>, help-gnu-emacs@gnu.org
Subject: RE: How can i enable webmode?
Date: Mon, 11 May 2020 08:02:27 -0700 (PDT)	[thread overview]
Message-ID: <eb3a2df0-05d3-4d38-8aec-17b062ca559a@default> (raw)
In-Reply-To: <864ksm4rf9.fsf@duenenhof-wilhelm.de>

> >> For example the Melpa package `inform' is activating itsel during
> >> installation (and maybe by restarting Emacs in some situations).
> The
> >> motivation is: If you are interested you'll have it without much ado
> >> and
> >> if you don't like it any more just uninstall the small package.
> >>
> >> Does it make sense or do you regard this behaviour as impolite?
> >
> > It's generally considered impolite, and is
> > contrary to convention.
> 
> Thank you for showing the Lisp coding convention.
> 
> And I accept these reasonable rules.  But I think there are also
> borderline cases where (small?) packages don't change editing behaviour
> and do not change existing code in any way.  And the its feature(s) can
> be completely removed by uninstalling the package.
> 
> Why would I download a package if I do not want to activate an
> advertised feature?  So this uncommon way can save unnecessary hassle,
> I hope.

First, a user may well want to download something
just to try it out, without wanting, say, changes
made to a local setup.  Or even just want to take
a look at the source code.  There's good logic,
and consideration of users, behind such guidelines.

But second, I personally agree that they should be
only guidelines (for 3rd-party coders), and such
guidelines have exceptions.

I think that what's really important/helpful is for
the Commentary in a library (source file), or some
other associated doc, to make clear what happens,
what the behavior is.

If a user uses a command, or loads a file, or turns
something on, s?he should know just what will happen.
If s?he then does that, knowing what will happen,
that's a user choice.

An example:

GNU Emacs policy/recommendation is that code should
not bind or set a user-option value. The idea behind
that (good, reasonable) guideline is that it's a
_user_ setting, and a user preference should be respected.

But what about a command or other user-choosable
construct whose very purpose is to change an option
value?  Does it make sense to outlaw providing such
things to users?  No, IMO.

For example, there are Isearch options, and there
are Isearch keys that temporarily have the effect
of toggling the behavior controlled by some such
options.  They actually toggle an internal variable,
without affecting the option value.  But what if
the point of a particular key/command is precisely
to change (e.g. toggle) an option, so that the
change affects not only the current Isearch but
also subsequent ones?

In such cases my own opinion differs from GNU Emacs
policy.  I don't feel constrained, in providing
3rd-party code, to never bind or even set option
values.  I do feel compelled to document behavior.
It's then up to users to choose whether to take
advantage of it.

Same thing applies to commands that might change
colors or whatever interactively.  IMO, there's
no reason that Customize should be the only way
for users to alter such state.  It's good, not
bad, to provide ways for users to incrementally
change appearance or behavior interactively.

But it's important that users be in control, that
they choose whether to do this or that, knowing
what behavior will result.

Just one opinion.

Understand that those guidelines came about
because there were too many Lisp files that did
change too many things just by loading them.
It was hard for users to work around that, undo
it, or sometimes even be aware that it was
happening.

It's understandable that this happens, because
the typical road to the creation of a 3rd-party
library often starts with someone's personal
customizations (with Lisp code).  Such a file
of code that changes behavior can evolve into
a library that others pick up.  And it's all too
easy for that evolution to skip steps of making
sure every behavior change becomes something
optional and undoable.

There are degrees.  And it's not always easy to
make everything optional and undoable.  A minor
mode is a good way to provide for optional
behavior, in general: key bindings, whatever.
But some changes of Emacs state are not so easily
reversed.  The most important thing, IMO, is to
be clear (document) what happens.



  parent reply	other threads:[~2020-05-11 15:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-10 10:02 How can i enable webmode? aprekates
2020-05-10 11:05 ` Jakub Jankiewicz
2020-05-10 14:40   ` aprekates
2020-05-10 15:35     ` 조성빈
     [not found] ` <CAMDYoXZKD6krOQXpX_4js16bn+MtS_imPBHHmLJ2qNEh0Z_toQ@mail.gmail.com>
     [not found]   ` <008d9cd4-8d24-f19b-82ad-d5c1bf7a435f@posteo.net>
2020-05-10 15:43     ` Alexis Roda
2020-05-10 16:13       ` H. Dieter Wilhelm
2020-05-10 16:42         ` Drew Adams
2020-05-11 11:55           ` H. Dieter Wilhelm
2020-05-11 12:03             ` tomas
2020-05-11 12:47               ` H. Dieter Wilhelm
2020-05-11 15:02             ` Drew Adams [this message]
2020-05-11 16:05             ` Stefan Monnier
2020-05-11 17:22               ` H. Dieter Wilhelm
2020-05-10 16:55         ` Dan Sommers
2020-05-11 12:03           ` H. Dieter Wilhelm
2020-05-11 14:01             ` Dan Sommers
2020-05-11 16:09             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb3a2df0-05d3-4d38-8aec-17b062ca559a@default \
    --to=drew.adams@oracle.com \
    --cc=aprekates@posteo.net \
    --cc=dieter@duenenhof-wilhelm.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).