unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim Johnson <tim@akwebsoft.com>
To: help-gnu-emacs@gnu.org
Subject: Re: python-mode broken - zip and git issues
Date: Sun, 1 Feb 2015 11:23:13 -0900	[thread overview]
Message-ID: <20150201202313.GA911@mail.akwebsoft.com> (raw)
In-Reply-To: <jwv61bld7hg.fsf-monnier+gmane.emacs.help@gnu.org>

* Stefan Monnier <monnier@iro.umontreal.ca> [150201 07:11]:
> >   major-mode it is
> >   and a similar check can be done using (symbol-name major-mode)
> >   cheers
> 
> Don't use symbol-name on major-mode.  Just use the symbol itself.
> E.g. instead of (equal "foo-mode" (symbol-name major-mode)), you can
> test (equal 'foo-mode major-mode).
 
  Suppose I wrote an elisp function that dispatched actions based on
  any number of major modes. 

  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))
;; would return t for major-mode 'python or 'python-mode	  

> As for Python mode, you might also like to try the built-in python-mode
> that comes bundled with Emacs.
  
  The Röhler is very feature-rich as opposed to the native 'python
  mode. I can't remember, but I may have started using the Röhler
  before the built-in was implemented.

  -- but sometimes simpler *is* better.
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com



  parent reply	other threads:[~2015-02-01 20:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-31 20:39 python-mode broken - zip and git issues Tim Johnson
2015-01-31 20:56 ` Tim Johnson
2015-01-31 22:05   ` Drew Adams
2015-01-31 22:23     ` Tim Johnson
2015-02-01 14:38       ` Stefan Monnier
2015-02-01 15:51         ` Drew Adams
2015-02-01 17:08           ` Tim Johnson
2015-02-01 20:23         ` Tim Johnson [this message]
2015-02-01 20:34           ` Drew Adams
2015-02-01 20:40             ` Tim Johnson
2015-02-03 20:21           ` Stefan Monnier
2015-02-01 18:03 ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150201202313.GA911@mail.akwebsoft.com \
    --to=tim@akwebsoft.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).