[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Towards a cleaner build: frameset
From: |
Stefan Monnier |
Subject: |
Re: Towards a cleaner build: frameset |
Date: |
Sat, 18 May 2019 08:56:35 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> In frameset-to-register:
> frameset.el:1403:18:Warning: ‘registerv-make’ is an obsolete function (as of
> 27.1); Use your own type with methods on
> register-val-(insert|describe|jump-to)
>
> It's this code:
>
> (set-register register
> (registerv-make
> (vector (frameset-save nil
> :app 'register
> :filters frameset-session-filter-alist)
> ;; frameset-save does not include the value of point
> ;; in the current buffer, so record that separately.
> (frameset-frame-id nil)
> (point-marker))
> :print-func #'frameset--print-register
> :jump-func #'frameset--jump-to-register)))
registerv-make faked OO-style programming by having objects that carry
their methods.
> I've never used register-val-*, so I have no idea what to do here...
> anybody?
The new style uses CLOS-style OO-programming instead. I.e. the object
you put into the register should have its own distinctive type
(i.e. not `registerv`) and you define the print/jump/.. methods with
`cl-defmethod`.
So, here you'd want to use a cl-defstruct to replace the `(vector ...)`
object and then use dispatch on this defstruct's type when
cl-defmethod'ing the register-val-print/jump/... functions.
Does that make sense?
Stefan
- Re: Towards a cleaner build: ehelp, (continued)
Re: Towards a cleaner build: epa-file, Lars Ingebrigtsen, 2019/05/18