From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Pushing the mark from a primitive like goto-char Date: Tue, 5 Jan 2021 20:52:44 +0100 Message-ID: References: <9815d21d-b20e-c6d8-aae0-77aa65a4138a@gmx.at> <87sg7pq2bx.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28414"; mail-complaints-to="usenet@ciao.gmane.io" Cc: martin rudalics , Juri Linkov , =?UTF-8?Q?Daniel_Mart=C3=ADn?= , Stefan Kangas , =?UTF-8?Q?Daniel_Mart=C3=ADn_via_Emacs_development_discussions=2E?= To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 05 20:54:10 2021 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 1kwsPB-0007GY-FQ for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Jan 2021 20:54:09 +0100 Original-Received: from localhost ([::1]:48742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwsPA-0003Mu-Gt for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Jan 2021 14:54:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwsO2-0002sp-Vx for emacs-devel@gnu.org; Tue, 05 Jan 2021 14:52:59 -0500 Original-Received: from mail-oo1-xc32.google.com ([2607:f8b0:4864:20::c32]:33846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwsO0-0001JO-M8 for emacs-devel@gnu.org; Tue, 05 Jan 2021 14:52:58 -0500 Original-Received: by mail-oo1-xc32.google.com with SMTP id x23so235551oop.1 for ; Tue, 05 Jan 2021 11:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F0F4gEtK2Z62ahf8nTKMc783M5cZW+U0ROHRXeE/BAw=; b=KODHPsAh9TSdyxOBOFQ6znLfN+EFL4P3V94MGwhySDL6F2/ySuWXfivtE9XaJTIg22 tcA11oPNvACq8Vm+If+UiEBR86S2BmK/kHpqoK6bp2mXBCjMLZnBbVV4EtI/bBgf1fmd OLkHiaf6zJcu/JIM8lqDf828tSu0pWaTdba+GNGvNL26P3FnceXDuoNAXZ8wlwRIURdV 5/3cBzxflACDivOAhgbJEvqhBDy1I8wPbjnoeqoa1k87NDXpJ4qZ8bX6bf4QzWd/fdj3 cgsN/H6f/ZVmR8Pppi/ZwJ4d3rubxS7sIclo3cmcUZRo/G+6se1tQcPHQYTxxKDAQl2W /Aag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F0F4gEtK2Z62ahf8nTKMc783M5cZW+U0ROHRXeE/BAw=; b=aT0NYxA0CIqA2oE+rVkHf5qe8ESHZjKppQXHRaji6s3waxwoFnUgy21jIWpmcmhdn4 ceLYA6HrV5LA6ua5ksGDu4hZpKrbn3YVTVB98RKWaIKBMtcYOKe8C9tnZoFy12zz4D24 Q391FMGOIlVwKytWwSxWBmCnxqv57RoC03hp/HTe74pnMxEOFwhRN8kYGDrO5HOIRHss phcNwxaNwTi6EsAsHy4LDerZFjXoxMDFFtgQNU6OBcevuhf95MVFBiTPQ7l9NLQDQvri 1b/kRdyGHNsHPjpU+neUrmLFwmLTdRX13EU36uOi2rVPj1DLdSCR/Py7StdHZ6y0lNwQ z8Ww== X-Gm-Message-State: AOAM533xua1Aail42ziLDrt/rjjoWbYhw3x0hNNwltJEBO4GXu0t4/QC q4oFTM3qqho69bhG0N11K/zEV99SkcnYao5AqJg= X-Google-Smtp-Source: ABdhPJxUnO/lBwdyY8Ew0KQHLK4NNzJ2m85ad3dOXr+EAPJ9zqI0iT1sUk0ToNxiQgml+1dwbRUnx26PbIhNptt6cR0= X-Received: by 2002:a4a:97a3:: with SMTP id w32mr465353ooi.81.1609876375226; Tue, 05 Jan 2021 11:52:55 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::c32; envelope-from=p.stephani2@gmail.com; helo=mail-oo1-xc32.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:262543 Archived-At: Am Di., 5. Jan. 2021 um 20:19 Uhr schrieb Stefan Monnier : > > >>>> I'd then try to make it behave like 'M-g g' in this regard. > >>> > >>> Some interactive versions of low-level primitives have the suffix > >>> `...-command' in their names, so a command like 'M-g g' and bound to > >>> 'M-g c' could be named 'goto-char-command'. > >> > >> I was more concerned about not pushing the mark when the region is > >> already active so one can use M-g c to extend the region. BTW, is there > >> a reason why 'goto-map' is so terribly unpopulated? > >> > > > > This sounds like a good idea: > > > > - Create a 'goto-char-command' command in ELisp. > > > > - Move the interactive spec that is in 'goto-char' to this new command > > and make it push the mark smartly (e.g. be careful when a region is > > active). Then call 'goto-char'. > > > > - Rebind 'M-g c' to 'goto-char-command'. > > > > - Announce the new command. > > > > What do you think? Could it break something? Thanks. > > Actually, now that I think about it: do we really need a new command, or > can we instead arrange to do all the mark-handling from within the > interactive spec? > I think that would be too confusing. The interactive specification should only gather input, but not perform state changes.