all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 33375@debbugs.gnu.org
Subject: bug#33375: 27.0.50; Nested function definitions
Date: Thu, 15 Nov 2018 08:01:41 +0100	[thread overview]
Message-ID: <c56e598e-92c9-9e7e-60a2-ec46a0bac8c9@easy-emacs.de> (raw)
In-Reply-To: <835zwz8y77.fsf@gnu.org>

On 14.11.2018 16:40, Eli Zaretskii wrote:
>> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
>> Date: Wed, 14 Nov 2018 11:06:52 +0100
>>
>> (defun foo1 ()
>>     "[Some docu]
>>
>> (defun other-foo "
>>     (interactive)
>>     ;; defining another function inside
>>     (defun foo2 ()
>>       (interactive)
>>       (message "%s"   "Foo2")
>> ;; another syntactically correct function just badly indented
>> (defun foo3 ()
>>     (interactive)
>>     (message "%s" "Foo3"))
>>         )
>>     (message "%s" "Foo1"))
>>
>> ;;;;
>> Results of evaluation:
>>
>> (foo1) ==> "Foo1"
>> (foo2) ==> foo3 ?
>> (foo3) ==> "Foo3"
> 
> Why do you think there's anything wrong here?  AFAICT, each evaluation
> returns the last sexp evaluated in the respective function.  foo1 and
> foo3 have a call to 'message' as the last sexp, so they return the
> message string, but foo2's last sexp evaluates a defun form, so you
> get the result of that, which is the function foo3.  IMO, this is
> expected and correct behavior.
> 

Basically these forms were made to display a beginning-of-defun bug.

See tests in previous posts.

What puzzles me when evaluating:


(setq a (foo2))
a ==> foo3
(call-interactively 'foo2) ==> foo3

But M-x foo2 RET messages "Foo2"







  reply	other threads:[~2018-11-15  7:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14  9:39 bug#33375: 27.0.50; Nested function definitions Andreas Röhler
2018-11-14 10:06 ` Andreas Röhler
2018-11-14 11:46   ` Andreas Röhler
2018-11-14 15:40   ` Eli Zaretskii
2018-11-15  7:01     ` Andreas Röhler [this message]
2018-11-15 12:36       ` Noam Postavsky
2018-11-15 15:04         ` Andreas Röhler
2018-11-15 15:05           ` Eli Zaretskii
2018-11-15 15:14             ` Andreas Röhler
2018-11-15 15:21               ` Andreas Röhler

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=c56e598e-92c9-9e7e-60a2-ec46a0bac8c9@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=33375@debbugs.gnu.org \
    --cc=eliz@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.