From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.devel Subject: Re: question regarding my emacs package Date: Sun, 11 Jun 2023 17:11:21 +0530 Message-ID: References: <6cG8Tc55Zz8xk6rE6mJLfDxckAINPcYqp781yltsndzqq5146yw76EZ_2CoUtQT4P2j2afSx5VRD5G1-9qzFHWAW3LxYWwmxh87lvB2MgNE=@rj95.be> <873533mfq3.fsf@posteo.net> <87y1kvkv2f.fsf@posteo.net> <2pOYRsmOk_f2sx48BICCjf9r3Z5OviLDonOFi4dhWoSpd_dAWOXFSA3jO2YeyJ5FBf-Sydd0ZTzTOsAlIg8tc_eBqM9nzq2PW4q4usn4Nuo=@rj95.be> <87ilbzkq9y.fsf@posteo.net> <877csetnwy.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30508"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Cancel-Lock: sha1:DKP5xOn/KkluXoATKZJ34Jy45U4= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 11 15:29:09 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q8L81-0007kK-KL for ged-emacs-devel@m.gmane-mx.org; Sun, 11 Jun 2023 15:29:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8L7R-0008Oa-EF; Sun, 11 Jun 2023 09:28:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8JSL-0004AY-G0 for emacs-devel@gnu.org; Sun, 11 Jun 2023 07:42:01 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8JSJ-0005Hj-WB for emacs-devel@gnu.org; Sun, 11 Jun 2023 07:42:01 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1q8JSG-0001kM-Mr for emacs-devel@gnu.org; Sun, 11 Jun 2023 13:41:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 11 Jun 2023 09:28:32 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306731 Archived-At: [Question about cl-defstruct] * Philip Kaludercic <877csetnwy.fsf @posteo.net> : Wrote on Thu, 08 Jun 2023 07:26:37 +0000: > ram 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