From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: python-mode broken - zip and git issues Date: Sun, 1 Feb 2015 12:34:31 -0800 (PST) Message-ID: <34001ff4-02a9-4102-93a0-5240aad40d75@default> References: <20150131203933.GK1459@mail.akwebsoft.com> <20150131205613.GL1459@mail.akwebsoft.com> <7f9babbe-2b1f-417a-bcff-0e67d5865db2@default> <20150131222354.GM1459@mail.akwebsoft.com> <20150201202313.GA911@mail.akwebsoft.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422822916 5474 80.91.229.3 (1 Feb 2015 20:35:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Feb 2015 20:35:16 +0000 (UTC) To: Tim Johnson , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 01 21:35:15 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YI1Eg-0005VH-7h for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Feb 2015 21:35:14 +0100 Original-Received: from localhost ([::1]:51844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI1Ee-0004cf-Nw for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Feb 2015 15:35:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI1EL-0004aL-5c for help-gnu-emacs@gnu.org; Sun, 01 Feb 2015 15:34:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YI1EF-0008Hr-Tw for help-gnu-emacs@gnu.org; Sun, 01 Feb 2015 15:34:53 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:23376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI1EF-0008Ej-Nr for help-gnu-emacs@gnu.org; Sun, 01 Feb 2015 15:34:47 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t11KYPZM017677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 1 Feb 2015 20:34:26 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t11KYO8p005193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 1 Feb 2015 20:34:24 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t11KYNv4007862; Sun, 1 Feb 2015 20:34:23 GMT In-Reply-To: <20150201202313.GA911@mail.akwebsoft.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102439 Archived-At: > Would there be anything wrong about a function like this: > (defun tj-check-mode (prefix) > "Test the major mode to see if the symbol begins with prefix. > The test is case insensitive." > (interactive) > (string-prefix-p prefix (symbol-name major-mode) 1)) > ;; return t for major-mode 'python or 'python-mode No, nothing wrong with that. But: * Function names ending in `-mode' suggest mode functions. The convention for predicates is to use suffix `p' or `-p'. See (elisp) `Coding Conventions'. * You probably want the doc string to say that it returns non-nil if... Just saying that something tests something doesn't tell you how to understand the test result. ;-) * If you just want to check for those two modes then it is more correct to check membership: (memq major-mode '(python python-mode)) That rules out returning non-nil for, say, `pythonesque'. =20