best text editor for programming Python on a Mac

Rustom Mody rustompmody at gmail.com
Sat Jun 18 12:02:20 EDT 2016


On Saturday, June 18, 2016 at 3:10:23 PM UTC+5:30, Marko Rauhamaa wrote:
> Michael Vilain :
> 
> > "best" is subjective. Anytime someone wants the "best", I ask "what
> > features are important to you that would make it the best" because I'm
> > pretty sure what I find important wouldn't be what they find
> > important.
> 
> That's a bit like asking what gender, nationality and religion you'd
> prefer for yourself.
> 
> I mean, having used emacs since the mid-1980's, everything just seems to
> be in the right place -- including typing this posting.
> 
> > - syntax coloring
> > - parathesis/block matching
> > - auto indent
> 
> Yes, in active use.
> 
> > - expansion of keywords, variables, subroutines
> 
> Never learned to need that.
> 
> > - integrated documentation so you don't have to lookup the syntax and 
> > arguments of a function
> 
> I have seen that in action with eclipse and Java. It could never match
> having a web browser window next to the editor window: <URL:
> https://docs.python.org/3/library/>.
> 
> It would be nice if python provided a full set of man pages as well as
> info documentation like C. Those are integrated into emacs.
> 
> > - integration with code management systems (svn, git, github)
> > - regular expression searching
> > - multi-file regular expression search/replace
> > - multi-pane/window diff/merge
> > - programmability (e.g. write/store macros to perform repeatable tasks)
> 
> Yes, in active use.
> 
> > - integrated compile, run & syntax checking (this is really a function 
> > of an IDE)
> > - interactive debugger (program stepping, expression & variable 
> > evaluation, breakpoints, watchpoints, macros) [this is why I like perl]
> 
> As far as Python goes, emacs does have some elementary support for pdb.
> Haven't found it all that practical, though.
> 
> > - extensibility to add features (lint or code formatting, special 
> > framework, etc.)
> 
> Although they do exist for emacs, I'm not a big fan of special plugins
> of any sort.
> 
> > What's the best? That's your homework. Write 500 describing what is
> > the Best editor and why.
> 
> Emacs doesn't take up the whole screen. It integrates seamlessly with
> the Unix way of doing things (but has some trouble with non-Unix culture
> items like Java). It can be run perfectly fine in a text terminal
> session. It takes care of all of your typing needs: when you type, type
> in emacs. Shell, email, news, documentation (with ASCII graphics!),
> programming...
> 
> 
> Marko

Having expatiatated all that you could have added some tips to OP on handling unicode in emacs :-)

Some emacs tips
[Note If recommending emacs ⇒ recommender = sadist; blame is on first mention!]

Emacs has a modeline at bottom which tells all sorts of things -- one of them
the coding system (as it detects/decides) at the left corner.
For latin-1 it should show a '1' and then there should be no problem
If it shows 'U' then its utf-something (usually UTF-8) and you have a likely
problem

To force latin-1 type
C-x RET f (ie control-X followed by return followed by an 'f')
It will ask for what coding system to save file
Say latin-1-unix
[the unix is for LF line endings]
And the U should change to 1 and you are done

OTOH there may be a non-latin-1-able character it will complain and put the cursor on the offending char

[
For that matter if I had to guess whats happened I'd hazard that you cut-pasted
something from a pdf which converted ASCII quotes -- '  " -- into one
of ‘ “ And unfortunately thats not very visible
]

If this is the case emacs will helpfully tell you to do something about these

In order to check for sure put the cursor on the char and type
C-u C-x =

eg On the “ I get
============================
             position: 13 of 13 (92%), column: 0
            character: “ (displayed as “) (codepoint 8220, #o20034, #x201c)
    preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x201C
               script: symbol
               syntax: . 	which means: punctuation
             category: .:Base, c:Chinese, h:Korean, j:Japanese
             to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
          buffer code: #xE2 #x80 #x9C
            file code: #xFF #xFE #x1C #x20 (encoded by coding system utf-16-le-unix)
              display: by this font (glyph code)
    xft:-DAMA-Ubuntu Mono-normal-normal-normal-*-17-*-*-*-m-0-iso10646-1 (#x70)

Character code properties: customize what to show
  name: LEFT DOUBLE QUOTATION MARK
  old-name: DOUBLE TURNED COMMA QUOTATION MARK
  general-category: Pi (Punctuation, Initial quote)
  decomposition: (8220) ('“')
================================

Yeah thats a mouthful but that the codepoint > 127 indicates you have a problem



More information about the Python-list mailing list