From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Hi-Angel Newsgroups: gmane.emacs.help Subject: Re: How to navigate to next git conflict? Date: Thu, 7 Feb 2019 00:22:39 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="263009"; mail-complaints-to="usenet@blaine.gmane.org" Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 06 22:23:55 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1grUfi-0016IF-ND for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Feb 2019 22:23:54 +0100 Original-Received: from localhost ([127.0.0.1]:58704 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grUfh-000889-Mj for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Feb 2019 16:23:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grUei-00087t-Vf for help-gnu-emacs@gnu.org; Wed, 06 Feb 2019 16:22:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grUei-0007Tt-1M for help-gnu-emacs@gnu.org; Wed, 06 Feb 2019 16:22:52 -0500 Original-Received: from mail-it1-x134.google.com ([2607:f8b0:4864:20::134]:38227) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1grUeh-0007TK-R8 for help-gnu-emacs@gnu.org; Wed, 06 Feb 2019 16:22:51 -0500 Original-Received: by mail-it1-x134.google.com with SMTP id z20so9656686itc.3 for ; Wed, 06 Feb 2019 13:22:51 -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=rSvs3+9P+8ZgOBLwRmKW66WdDWJng2Af47GcznFl8zI=; b=jQyf/2gLtVE/L1GaXvLrfXibnMBAIZDW/Nrc6DA8WymCuAh51QTfN5n/q/NJ4wj2p7 Q8utVOT1Pc9eC4a9MdaYk+6cWmFzSifwUV6qy3dilJrbiiibfnxNKgGhaQ+qWTyqecll C051epzcfZO/d6RTFZFB0cQaFsQkheYex0v7vNXHuJLvX2vIJVuF5/z1H9HiFBx/ZZZo 0BrwW4fgXvKmCmUo4c051eSYkN7QuQhtmqi9esFzoJ/2DYxWblvood5HHoKp3B7NRlUz tVlIk6q1rW/5vO33aVB7TUdyuR8KuoDCXYENsPmBeJ3hgTpLPf/SHa6ZLKXWR3Se9RVT EL8w== 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=rSvs3+9P+8ZgOBLwRmKW66WdDWJng2Af47GcznFl8zI=; b=c97oHItFgdP2kiAh/JSHZ3k1maMI4cxI8KJBSIVGOSIwHwoftp7GCT+PK+9hYEz8bR ea2OlazSDWMWSGLryPEg/HjSIIl+VqfqLP+msI8PnkV5JCvtC1sv9W10We3hqFDqbD20 vV5V47z2QjDx8MX6WNQ2gtiUmegRlYluVmN0saOr84CEkrf4YhDcggnSkg9LE1xFK9nI Cwfa1CdHQ5bq6n/8uYntNUhxbeZXXt7ZYJ51MGDoaMhMnCy239gjszXLfLpEf6/T1HQ6 NEbY9FX2X/if8U/dZHSyN7/xT1w7uHFB8fqYTdpoFBVtSKmx2ixWIu/+Bm37yeeMa2gB qj7A== X-Gm-Message-State: AHQUAuY10bjRYWwF7NWl9BTMbpKq3a7LA0Fv2aVr/iQaJVPWJkXS2qNn TU58NmkljYitRXItKF/Lh0dkrwiRnDH2Reu0pHQ= X-Google-Smtp-Source: AHgI3Iaju2rI0oys/zurPeN/6tbmP0rR+cTHYXPbXMlRhh67qhl+h9KNStzmn8YicgfWyGEPVXvbx1nKfPhf242TR1A= X-Received: by 2002:a6b:7a0b:: with SMTP id h11mr1596378iom.107.1549488170927; Wed, 06 Feb 2019 13:22:50 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::134 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119235 Archived-At: On Wed, 6 Feb 2019 at 18:30, Stefan Monnier wrote: > > >> > (condition-case err > >> > (not (smerge-next)) > >> > ('error > >> This catches both the `error` and the `quote` conditions. > > What is "quote condition"? > > I don't know of any `quote` condition, indeed. Yet that's what you > wrote in your code by placing a spurious ' in front of `error`. > > When you write > > 'error > > it is 100% indistinguishable from writing > > (quote error) > > so this is the list of conditions your code catches. If you only want > to catch `error` then you can write > > (condition-case ... > ... > (error ...)) > or > (condition-case ... > ... > ((error) ...)) > > > FWIW, it's very hard to find how to catch some "error". > > Have you looked in the Emacs Lisp documentation included in Emacs, > e.g. in the Emacs Lisp Introduction? Hmm, yes. Now that I look back at the docs, there is an example of that, right at beginning. It is on this page https://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html I guess the problem is that catching an error by writing "error" on one of condition branches looks like magic, because it the word "error" supposed to evaluate to something. So, what happened, is that I read the example, it didn't make any sense (even more so because I didn't know at that moment about existence of "error", and thought smerge is using "throw"), and then I scrolled down (and completely discarded the example from my memory as useless) through other code examples on this page, found condition-case use for catching arithmetic error, and figured I need to use this construction (somewhere then I found that smerge is using "error" and not "throw"). However the part of docs for the condition-case don't have examples beside arithmetic error, so I went googling. When I found on someone's blog use of "quote error" in condition, it made sense, because 'error does not evaluate to anything. In retrospective I guess this "magic error" branch is simply a macro, that's why it looks so magical. > > I managed to find this way of doing that in someone's blog post. > > Could you warn this blogger about his mistake so it doesn't spread > yet further? Sure, I left a comment. FTR the post is here https://curiousprogrammer.wordpress.com/2009/06/08/error-handling-in-emacs-lisp/