From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: (copy-marker nil) Date: Mon, 7 May 2018 06:39:27 -0700 Message-ID: References: <364c8f2d-06ab-4f81-852f-eb3bac7a0615@easy-emacs.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1525700319 23082 195.159.176.226 (7 May 2018 13:38:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 May 2018 13:38:39 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 07 15:38:35 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fFgLa-0005vd-DX for geh-help-gnu-emacs@m.gmane.org; Mon, 07 May 2018 15:38:34 +0200 Original-Received: from localhost ([::1]:46375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFgNh-0003DP-Cd for geh-help-gnu-emacs@m.gmane.org; Mon, 07 May 2018 09:40:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFgMn-00035P-M1 for help-gnu-emacs@gnu.org; Mon, 07 May 2018 09:39:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fFgMm-0006Qv-PB for help-gnu-emacs@gnu.org; Mon, 07 May 2018 09:39:49 -0400 Original-Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:37822) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fFgMm-0006Qn-La for help-gnu-emacs@gnu.org; Mon, 07 May 2018 09:39:48 -0400 Original-Received: by mail-qt0-x235.google.com with SMTP id q13-v6so35437408qtp.4 for ; Mon, 07 May 2018 06:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Vy5CJlC2rAhB3voa3C4H86Z97Trrzkc1ZujIuUiYayc=; b=k18lhPV8zc2z/T5q/BVRnWMLkN46ZbzD8WkPNdabA5mfjKJtkbKiHyL9QvCFXWZobm ++RY5LaCHlvCUvIs49IBea921RMuhn38/mFvXuihs9LDpoUr5IzBO8JPe56HYCM5z1Hv Z0541l0MsHoV2MK2w8d1aYfcAgSe6zyJpZyvfcPYuimla0T16kQP03H1+A+PVRw9yn/Z Id9MZOY75CV8b72GLvyxaX93qLlhHzWwr0p986M1reGGWy5VwJtelpeLn3wslFTuJr/W jyMIboQp5Z+22DY6kNXnv+Dtw4mpC2KYssOwDHQns4esxrzUIwwp8fS1Ok9mDgCy1CSN NW+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Vy5CJlC2rAhB3voa3C4H86Z97Trrzkc1ZujIuUiYayc=; b=aYJ5ld9hBe//XAuxbN0KNhU0A5B3nFf7HOuHwu+KdU7Z3TrMDLk6aPjNPcFcowwizC aRRGbqoaeHfiE9xbI+huPZrHhCpMD/UE97IF0D2F9FQoJCFbno/YG5ikxExPvWQdC6Mm L18ikAa44s78PTXPd0+NkDlRvxtw9bOf4N0gIVCXEQSpSqvhhp41bWKZvwVCFNzEEM8w WWXqeLuj2MaovuopC9Cl907A2R+UUdL1mRzBfXuGYJUD/hJNbN190Ax1O/oAhIcSkt5U rwB3r2f33D0dYiQYfSBmIX+fWHf5cuUNao4zKXNfguiRo6hlD3jyr4WIrGGgXQEF5P85 xhrQ== X-Gm-Message-State: ALQs6tAwzJJDKk87tPat22QP2i7iD1YziDkjunVwyHUPhZ7vdjytDprk WJnuSQ7r6v0QV3yaYlLQFfLD49g8qTSrLd7BHhUDYRNJ X-Google-Smtp-Source: AB8JxZoDyqMnLYyf726gGK1OMTCCJfxmGpouyk+KckxAvLObc4Mm0Sj4kdC0m9BttOPdLuxEi9Hqm7iLVNPM1zT8F+M= X-Received: by 2002:aed:2984:: with SMTP id o4-v6mr33164568qtd.124.1525700387567; Mon, 07 May 2018 06:39:47 -0700 (PDT) Original-Received: by 10.200.55.171 with HTTP; Mon, 7 May 2018 06:39:27 -0700 (PDT) In-Reply-To: <364c8f2d-06ab-4f81-852f-eb3bac7a0615@easy-emacs.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::235 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:116673 Archived-At: Andreas R=C3=B6hler wrote: > being surprised WRT behavior of copy-marker: > > (setq a (copy-marker nil)) -> # > (markerp a) -> t > a -> # > > Is taking nil by copy-marker reasonable? > > Wanted to check for a valid buffer position, which doesn't seem > possible that way. While without copy-marker, the variable a would be > set to nil, now the result evaluates to #, which > is a kind of t. There are other ways to get a marker to no buffer, such as (let ((a (point-marker))) (set-marker a nil)) So if you don't control the creation of the marker, it's probably a scenario you need to take care for either way. Explicitly testing the marker's buffer should work: (let ((a (copy-marker nil))) (and (markerp a) (buffer-live-p (marker-buffer a)))) --=20 John