unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Stefan Kangas <stefan@marxist.se>,
	"Charles A. Roelli" <charles@aurox.ch>,
	27229@debbugs.gnu.org
Subject: bug#27229: eldoc wrong highlighting for "when"
Date: Fri, 03 Sep 2021 10:31:19 +0200	[thread overview]
Message-ID: <87o89a12nc.fsf@gnus.org> (raw)
In-Reply-To: <87k0w6dg58.fsf@web.de> (Michael Heerdegen's message of "Sun, 04 Oct 2020 01:49:23 +0200")

Michael Heerdegen <michael_heerdegen@web.de> writes:

>> > From emacs -q, type "(when x y z": COND is highlighted
>> > instead of BODY.  This is a regression from the behavior
>> > of 24.5 (with eldoc-mode on).
>>
>> I can reproduce this on current master.
>
> Seems this code is the culprit (`elisp--highlight-function-argument'):
>
> | ;; Back to index 0 in ARG1 ARG2 ARG2 ARG3 etc...
> | ;; like in `setq'.
> | ((or (and (string-match-p "\\.\\.\\.\\'" argument)
> |           (string= argument (car (last args-lst))))
> |      (and (string-match-p "\\.\\.\\.\\'"
> |                           (substring args 1 (1- (length args))))
> |           (= (length (remove "..." args-lst)) 2)
> |           (> index 1) (eq (logand index 1) 1)))
> |  (setq index 0))
>
> In general, the problem is that "..." can have different meanings (it's
> not clear which arguments have to be repeated), so this is not trivial
> to fix I think.

I wonder -- why is this defined like this, anyway?

(defmacro when (cond &rest body)
  "If COND yields non-nil, do BODY, else return nil.
When COND yields non-nil, eval BODY forms sequentially and return
value of last one, or nil if there are none.

\(fn COND BODY...)"

(when COND &rest BODY)

is the correct signature, isn't it?  Removing the (fn ...) from the doc
string makes eldoc do the correct thing.

The commit message is helpful:

commit 7f67eea000b0ba102dd86c2666041dc395137413
Author:     Kim F. Storm <storm@cua.dk>
AuthorDate: Sun Mar 18 00:44:24 2007 +0000

    (when, unless): Doc fix.

Anybody know what the point of the (fn...) here is?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-09-03  8:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-04 10:18 bug#27229: eldoc wrong highlighting for "when" Charles A. Roelli
2017-06-04 15:58 ` Andreas Politz
2020-08-16 10:16 ` Stefan Kangas
2020-10-03 23:49   ` Michael Heerdegen
2021-09-03  8:31     ` Lars Ingebrigtsen [this message]
2021-09-03 14:20       ` Andy Moreton
2021-09-03 14:37         ` Lars Ingebrigtsen
2021-09-03 17:09           ` Andy Moreton
2021-09-04  6:36             ` Lars Ingebrigtsen
2021-09-04 13:23               ` Andy Moreton
2021-09-04 13:45                 ` Lars Ingebrigtsen
2022-05-02 10:30                   ` Lars Ingebrigtsen
2022-05-02 16:04                     ` Eli Zaretskii
2022-05-03  9:05                       ` Lars Ingebrigtsen
2022-05-03 11:03                         ` Eli Zaretskii
2022-05-03 11:09                           ` Lars Ingebrigtsen
2022-05-03 11:21                             ` Eli Zaretskii
2022-05-03 11:24                               ` Lars Ingebrigtsen
2022-05-03 11:31                                 ` Eli Zaretskii
2022-05-04  7:46                                   ` Lars Ingebrigtsen
2022-05-04  8:28                                     ` Eli Zaretskii
2022-05-04  9:06                                       ` Lars Ingebrigtsen
2022-05-04 22:47                           ` Richard Stallman

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=87o89a12nc.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=27229@debbugs.gnu.org \
    --cc=charles@aurox.ch \
    --cc=michael_heerdegen@web.de \
    --cc=stefan@marxist.se \
    /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 public inbox

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

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).