unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: carlmarcos--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Placement of list within an interactive clause
Date: Sun, 17 Jul 2022 01:01:30 +0200 (CEST)	[thread overview]
Message-ID: <N78EhfA--3-2@tutanota.com> (raw)
In-Reply-To: <jwv7d4f761t.fsf-monnier+emacs@gnu.org-N6yYlrA----2>



Jul 14, 2022, 21:12 by monnier@iro.umontreal.ca:

> carlmarcos@tutanota.com [2022-07-14 22:52:43] wrote:
>
>> My question was about how I can determine which parts are used to fill
>> elements to the list.  Whether it is from the body of `if' and `let'
>> clauses.  Perhaps I was not so articulate in the choice of words.
>>
>
> And my answer is that the expression returns a list and the origin of
> each part of the list is determined by the general semantics of Emacs
> Lisp (which is basically the same as that of all other programming
> languages in this respect).
>
>  Stefan
>
I have been reading as instructed.  

In summary. `(let` is a special function form. And a function in lisp returns the value of the last expression evaluated as the  return value.

Consequently, the following function will only take the last expression in the `let' body (completing-read) to fill an element of a list for setting the function argument `type'.

(defun myfun (type)
(interactive
(list
  (let ( (rqmatch t) (initpk "mixed") (dflt "extended")
(cseq '("expression" "mixed")) )
    (message "This is a message")
    (completing-read "Flare_type: " cseq nil rqmatch initpk nil dflt)))))

On the other hand if I want to have multiple function arguments, I should have

(defun myfun (type other-arg)
  (interactive
   (let ( (rqmatch t) (initpk "mixed") (dflt "extended")
  (cseq '("expression" "mixed")) )
     (message "This is a message")

     (list
      (completing-read "Flare_type: " cseq nil
       rqmatch initpk nil dflt)
      (completing-read "Other_arg: " cseq nil
       rqmatch initpk nil dflt)))))






  parent reply	other threads:[~2022-07-16 23:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 18:14 Placement of list within an interactive clause carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-14 18:34 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-07-14 19:24   ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-14 20:15     ` Philip Kaludercic
2022-07-14 20:30     ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-07-14 20:52       ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-14 21:12         ` Stefan Monnier
2022-07-14 21:15           ` carlmarcos--- via Users list for the GNU Emacs text editor
     [not found]         ` <jwv7d4f761t.fsf-monnier+emacs@gnu.org-N6yYlrA----2>
2022-07-16 23:01           ` carlmarcos--- via Users list for the GNU Emacs text editor [this message]
2022-07-17  2:38             ` Stefan Monnier
     [not found]             ` <jwvcze4pj2d.fsf-monnier+emacs@gnu.org-N790PCt----2>
2022-07-17  3:02               ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-17 13:34                 ` Stefan Monnier
2022-07-14 21:23       ` [External] : " Drew Adams
2022-07-14 22:31       ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-14 22:52         ` [External] : " Drew Adams
     [not found]         ` <SJ0PR10MB54881126A1B0DB238AE8B82BF3889@SJ0PR10MB5488.namprd10.prod.outlook.com-N6yu_1j----2>
2022-07-15 20:05           ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-15  7:26 ` Jean Louis
2022-07-15  8:19   ` Christopher Dimech
2022-07-15 10:14     ` Jean Louis
2022-07-15 10:32       ` Christopher Dimech
2022-07-15 21:03         ` Jean Louis
2022-07-15 21:22           ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-15 21:31             ` Jean Louis
2022-07-15 22:53               ` Christopher Dimech
     [not found]             ` <YtHcni0c1ZTL+V8R@protected.localdomain-N72lwEe----2>
2022-07-16 22:08               ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-16 23:40                 ` Jean Louis
2022-07-17  1:22                   ` [External] : " Drew Adams
2022-07-17  2:04                     ` RE: [External] : " Christopher Dimech
2022-07-17  1:53                   ` Christopher Dimech
2022-07-17  2:16                     ` Jean Louis
2022-07-17  2:46                       ` Christopher Dimech
2022-08-01 11:52       ` Emanuel Berg
2022-07-15 19:55   ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-15 21:08     ` Jean Louis
2022-07-15 21:54   ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-07-16 10:15     ` Jean Louis

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=N78EhfA--3-2@tutanota.com \
    --to=help-gnu-emacs@gnu.org \
    --cc=carlmarcos@tutanota.com \
    --cc=monnier@iro.umontreal.ca \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).