From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "numbchild@gmail.com" Newsgroups: gmane.emacs.help Subject: Re: [SOLVED] Re: How to detect two emacs process in Elisp code? Date: Thu, 3 Sep 2020 10:50:18 +0800 Message-ID: References: <87ft9s283t.fsf@gmail.com> <87363z8tvl.fsf@ebih.ebihd> <87y2lr7f14.fsf@ebih.ebihd> 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="33028"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , emacs-help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 03 04:51:11 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 1kDfLD-0008TB-FV for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 03 Sep 2020 04:51:11 +0200 Original-Received: from localhost ([::1]:54018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDfLC-0004Vn-Hh for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Sep 2020 22:51:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDfKq-0004Uu-8y for help-gnu-emacs@gnu.org; Wed, 02 Sep 2020 22:50:48 -0400 Original-Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]:37443) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDfKo-0006v5-4O for help-gnu-emacs@gnu.org; Wed, 02 Sep 2020 22:50:47 -0400 Original-Received: by mail-vs1-xe36.google.com with SMTP id y194so899781vsc.4 for ; Wed, 02 Sep 2020 19:50:45 -0700 (PDT) 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; bh=v/hoQpOG/Lal6qWkaXwfyo4COoO1ZsxBNAVXBmT1noM=; b=CJzzhF87RJNZ8A7J9nB3QLCKPUM6AYN+bd4fFFI7tV7YzLWt5CFmgJZFiYhmhcAks4 ctweqpPdtI4Kq0+/0n3SHCXtcnO0wU4TjdL6aHoi8K6TEQ8et1BAyXyMMukl4li0lv0w Dn9pt6CeZ2XvAcC/L6SQWDroIq+JzwQrFjvRp1vq0a3rk1wEAQB2Zf2gd3NvAZnO5kwb gGsc9rL6m7TrlIBlFf84NGu/1xE/ilXwld9eamww4ef21Sykgg2nugF4GaB9UWj/UxH5 MrfBAU19G9v8X6hb6j1fSlltiecu+026rGhFJ6HeZ2Iz9Lf4vNgLceR+l5m6u/poTINn RDQg== 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; bh=v/hoQpOG/Lal6qWkaXwfyo4COoO1ZsxBNAVXBmT1noM=; b=gXLaYC5VrVADqnejKZaUcG0mB+sTzfWIIQ9x+lMqAXqIvOjsp/KsxtSKnwU5ZVNejV DR/2XupT9YlBCMeU6YLgHqZWuKZGczY1imIi0lsu0MIgyjJicnGntTSAYmsjLw9eBXp3 LHnKYcU5G9ltKFabUs9OcEWGvEqXr6AwySNgO6QIwau7r67o2mCSW6KWFDlnFky/Vtfb tipNi/I2oMHhPXKAKGp5EHxFR8fq1+AAoyak2ftV+P9Ctxfau4PixEZE//yipHe1po5g RRS2EnRHzPlxETEwr+K+DXQCSNxElToyifpsYwsBm6kGRAC69VX2j/4LC7V6vR2clacG BFOQ== X-Gm-Message-State: AOAM531ERgR+0Ex7fsd5cY2sBopcsPwPICs1FBFfEoLXr+Ym25dpVs1C LPqGfcBHHYvNmpgQeqD+2CNO9mx/7147KzeCmQ== X-Google-Smtp-Source: ABdhPJw5dzq7sSlpNm7mlwPULjdRu/bQxym1Fbnmg2CQJOsyNVXjuRyiSnzbCXPa6vXoMP2bZbhOernH+erG97w1Y9g= X-Received: by 2002:a67:803:: with SMTP id 3mr393346vsi.79.1599101444765; Wed, 02 Sep 2020 19:50:44 -0700 (PDT) In-Reply-To: <87y2lr7f14.fsf@ebih.ebihd> Received-SPF: pass client-ip=2607:f8b0:4864:20::e36; envelope-from=numbchild@gmail.com; helo=mail-vs1-xe36.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, HTML_MESSAGE=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-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:123915 Archived-At: Yes, it's simpler. Ahah [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Thu, Sep 3, 2020 at 10:47 AM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > numbchild@gmail.com wrote: > > > Thanks for quick reply. Confirmed it solved my > > problem. Thanks very much! > > Np :) > > But what about this? > > (defun how-many-emacs-2 () > (let*((ps-outp (shell-command-to-string "ps -C emacs -o pid=")) > (ps-lst (split-string ps-outp)) ) > (length ps-lst) )) > ;; (how-many-emacs-2) ; 1 > > Looks better, right? > > -- > underground experts united > http://user.it.uu.se/~embe8573 > https://dataswamp.org/~incal > > >