help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: python-mode broken - zip and git issues


From: Tim Johnson
Subject: Re: python-mode broken - zip and git issues
Date: Sun, 1 Feb 2015 11:23:13 -0900
User-agent: Mutt/1.4.2.3i

* Stefan Monnier <address@hidden> [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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]