all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Madhu <enometh@meer.net>
To: emacs-devel@gnu.org
Subject: Re: question regarding my emacs package
Date: Sun, 11 Jun 2023 17:11:21 +0530	[thread overview]
Message-ID: <m37csacjku.fsf@leonis4.robolove.meer.net> (raw)
In-Reply-To: 877csetnwy.fsf@posteo.net

[Question about cl-defstruct]

* Philip Kaludercic <877csetnwy.fsf @posteo.net> :
Wrote on Thu, 08 Jun 2023 07:26:37 +0000:
> ram <chat @rj95.be> writes:
>
>> i believe i've incorporated your suggestions, fixed the bugs, and
>> satisfied check doc. let me know what else i need to do, eg fsf
>> copyright notice, etc
>
> Here are a few more things I noticed:
>  ;; `breadcrumbs-drop-breadcrumb' adds the current position in the
>  ;;  buffer to a ring.  If point is at a known breadcrumb, the existing
>  ;;  breadcrumb will be moved to the head of the ring.  Adding

[snip]

I tried loading the file from github on emacs master and it fails when
trying to compile

```
(defun breadcrumbs--drop ()
  "Track the buffer position as a `breadcrumbs--breadcrumb'.

If this has already been tracked, move an existing one in `breadcrumbs-ring' to head."
  (let* ((breadcrumb (make-breadcrumbs--breadcrumb))
         (index (ring-member breadcrumbs-ring breadcrumb)))
```

with
```
Debugger entered--Lisp error: (wrong-type-argument stringp (buffer-file-name))
  make-breadcrumbs--breadcrumb--cmacro((make-breadcrumbs--breadcrumb))
  apply(make-breadcrumbs--breadcrumb--cmacro (make-breadcrumbs--breadcrumb) nil)
  macroexp--compiler-macro(make-breadcrumbs--breadcrumb--cmacro (make-breadcrumbs--breadcrumb))
```

The cl-defstruct slot has an initform "(buffer-file-name)" which seems
legit since it takes an optional argument.

However when I change the form to (buffer-file-name nil) as below, it
loads


```
(cl-defstruct breadcrumbs--breadcrumb
  (buffer-file-name
   (buffer-file-name nil)
   :documentation "The file backing the breadcrumb.")
```

Common Lisp has a problem with the interpretation of the lexical
scoping of the initforms. C-h f cl-defstruct doesn't impose any
conditions on the SDEFAULT form.  Are there any guarantees or
limitations on the forms that can go into SDEFAULT




  parent reply	other threads:[~2023-06-11 11:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07  3:18 question regarding my emacs package ram
2023-06-07 15:53 ` Philip Kaludercic
2023-06-07 18:04   ` Philip Kaludercic
2023-06-07 19:45     ` ram
2023-06-07 19:48       ` Philip Kaludercic
2023-06-07 19:50         ` ram
2023-06-07 22:34           ` ram
2023-06-08  7:13             ` ram
2023-06-08  7:26               ` Philip Kaludercic
2023-06-08 18:50                 ` ram
2023-09-08  7:40                   ` Philip Kaludercic
2023-06-11 11:41                 ` Madhu [this message]
2023-06-12 12:52                   ` Madhu
2023-06-12 16:40                     ` Andrea Corallo
2023-06-13  4:01                       ` Madhu
2023-06-13  8:55                         ` Andrea Corallo
2023-06-13  9:19                           ` Madhu
2023-06-13 23:55                             ` Michael Heerdegen
2023-06-14 16:10                               ` Mattias Engdegård
2023-06-16  3:53                                 ` Michael Heerdegen
2023-06-16  4:46                                   ` Madhu
2023-06-16 15:28                   ` Michael Heerdegen
2023-06-17  3:01                     ` ram via Emacs development discussions.
2023-06-18  0:40                       ` Michael Heerdegen
2023-06-29 19:28                       ` ram
2023-06-11 18:49 ` João Távora
2023-06-11 19:08   ` ram via Emacs development discussions.
2023-06-12  8:45     ` Philip Kaludercic
2023-06-12 10:23       ` João Távora
2023-06-12 10:54         ` Philip Kaludercic
2023-06-12 20:43           ` João Távora
2023-06-13  0:36             ` ram via Emacs development discussions.
2023-06-13 18:13               ` João Távora
2023-06-13 21:46                 ` ram

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

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

  git send-email \
    --in-reply-to=m37csacjku.fsf@leonis4.robolove.meer.net \
    --to=enometh@meer.net \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.