From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomas Hlavaty Newsgroups: gmane.emacs.help Subject: Re: make a drawing with Emacs Date: Fri, 04 Sep 2020 10:42:20 +0200 Message-ID: <871rjilyqb.fsf@logand.com> References: <20200901145854.GF15433@tuxteam.de> <87sgbzsx4q.fsf@logand.com> <87ft7zs48u.fsf@logand.com> <874koehonj.fsf@logand.com> <87tuwen4mo.fsf@logand.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38634"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 04 10:42:42 2020 Return-path: Envelope-to: geh-help-gnu-emacs@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 1kE7Iw-0009x2-GJ for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 04 Sep 2020 10:42:42 +0200 Original-Received: from localhost ([::1]:51994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kE7Iv-0000RC-8p for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 04 Sep 2020 04:42:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kE7Ie-0000R6-7V for help-gnu-emacs@gnu.org; Fri, 04 Sep 2020 04:42:24 -0400 Original-Received: from logand.com ([37.48.87.44]:58968) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kE7Ic-0005s1-MI for help-gnu-emacs@gnu.org; Fri, 04 Sep 2020 04:42:23 -0400 Original-Received: by logand.com (Postfix, from userid 1001) id EF4CE1A5434; Fri, 4 Sep 2020 10:42:21 +0200 (CEST) X-Mailer: emacs 26.3 (via feedmail 11-beta-1 I) In-Reply-To: Received-SPF: pass client-ip=37.48.87.44; envelope-from=tom@logand.com; helo=logand.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/04 04:40:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123955 Archived-At: thanks, bug reported On Thu 03 Sep 2020 at 15:52, Stefan Monnier wrote: >> (cl-defun foo (a &rest args &key b c) >> (cons a args)) >> >> (foo 1 :b 2 :c 3) >> >> This works. >> >> But positioning cursor somewhere on :b 2 highlights args instead of b. >> Strangely enough, positioning it on :c 3 highlights c correctly. > > Probably a happy accident. > >> If this worked it would be enough to use cl-defun and add key list >> without having to change anything else. > > Indeed, that's a bug (or lack of feature). > `M-x report-emacs-bug` seems to be in order. > >>> BTW, if you're only concerned about the Eldoc and `C-h o` info, then you >>> can also just provide the more precise info in the docstring e.g.: >>> >>> (defun svg-create (width height &rest args) >>> "Create a new, empty SVG image with dimensions WIDTH x HEIGHT. >>> ARGS can be used to provide `stroke' and `stroke-width' parameters to >>> any further elements added. >>> >>> \(fn WIDTH HEIGHT &key STROKE STROKE-WIDTH)" >>> ...) >> >> I don't understand. Should \(fn WIDTH HEIGHT &key STROKE STROKE-WIDTH) >> in docstring magically make eldoc to work? It does not work for me. > > It makes eldoc work the same way as `cl-defun` does (it's actually the > mechanism used internally by eldoc to preserve the &key arguments into > the `C-h o` and the eldoc output), but without having to change the > actual code. > > > Stefan