Decouple :modeline popup rule from modeline API

The :modeline property still takes:

  t => default modeline
  nil => no modeline (the default)

But now also accepts:

  function => uses its return value as the mode-line-format
  anything non-nil => used directly as the mode-line-format

This is to decouple the popup API from the modeline API. You can still
use them compositionally:

  (set-popup-rule "abc" :modeline (lambda () (set-modeline! :project)))
This commit is contained in:
Henrik Lissner 2018-07-29 18:36:12 +02:00
parent cb7e471c90
commit 1205db0f73
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 19 additions and 19 deletions

View file

@ -143,11 +143,11 @@ PLIST can be made up of any of the following properties:
(where you were before the popup opened). The popup system does nothing else
and ignores the function's return value.
:modeline BOOL|SYMBOL|FN
Can be t (show the default modeline), a symbol representing the name of a
modeline defined with `def-modeline!', nil (show no modeline) or a function
that returns a modeline format. The function takes no arguments and is run in
the context of the popup buffer.
:modeline BOOL|FN|LIST
Can be t (show the default modeline), nil (show no modeline), a function that
returns a modeline format or a valid value for `mode-line-format' to be used
verbatim. The function takes no arguments and is run in the context of the
popup buffer.
:autosave BOOL|FN
This parameter determines what to do with modified buffers when closing popup