Groups | Search | Server Info | Login | Register


Groups > comp.emacs > #2480

Re: derive from an Emacs package without modifying it

From Mekeor Melire <mekeor@posteo.de>
Newsgroups comp.emacs
Subject Re: derive from an Emacs package without modifying it
Date 2025-09-11 23:25 +0200
Organization MB-NET.NET for Open-News-Network e.V.
Message-ID <87cy7wy940.fsf@posteo.de> (permalink)
References <87cy7w6hw5.fsf@gmx.de>

Show all headers | View raw


2025-09-11 19:03 walthervondervogelweide@gmx.de:

> My question is, how do I mitigiate these requirements? The
> changes are e. g. in a core defstruct of ejira. I would have to
> change these back to default in order to make ejira3 useful to
> others.

Maybe you can just redefine the struct in your personal
code. Redefining seems to work as expected. For example, here I
define a struct with slot "sex", then redefine it with "slot"
"replaced" with "gender":

    ;; -*- lexical-binding: t; -*-
    (require 'cl-lib)

    (cl-defstruct person first-name age sex)
    ;; => person

    (mapcar #'cl--slot-descriptor-name
            (cl--struct-class-slots
             (plist-get (symbol-plist 'person) 'cl--class)))
    ;; => (first-name age sex)

    (cl-defstruct person first-name age gender)
    ;; => person

    (mapcar #'cl--slot-descriptor-name
            (cl--struct-class-slots
             (plist-get (symbol-plist 'person) 'cl--class)))
    ;; => (first-name age gender)

Back to comp.emacs | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

derive from an Emacs package without modifying it Wolfgang Mederle <walthervondervogelweide@gmx.de> - 2025-09-11 19:03 +0200
  Re: derive from an Emacs package without modifying it Mekeor Melire <mekeor@posteo.de> - 2025-09-11 23:24 +0200
    Re: derive from an Emacs package without modifying it Wolfgang Mederle <walthervondervogelweide@gmx.de> - 2025-09-13 01:15 +0200
  Re: derive from an Emacs package without modifying it Mekeor Melire <mekeor@posteo.de> - 2025-09-11 23:24 +0200
  Re: derive from an Emacs package without modifying it Mekeor Melire <mekeor@posteo.de> - 2025-09-11 23:25 +0200
    Re: derive from an Emacs package without modifying it Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-09-11 22:21 +0000

csiph-web