mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Sync with python-mode project. Adds two changes:
* in py-checker-run, fall back to read-string if read-shell-command (XEmacs-specific) is not available. * highlight variables would mask builtins as if they were keywords.
This commit is contained in:
		
							parent
							
								
									828f847d66
								
							
						
					
					
						commit
						302e550403
					
				
					 1 changed files with 47 additions and 5 deletions
				
			
		| 
						 | 
					@ -358,10 +358,45 @@ support for features needed by `python-mode'.")
 | 
				
			||||||
	(kw2 (mapconcat 'identity
 | 
						(kw2 (mapconcat 'identity
 | 
				
			||||||
			'("else:" "except:" "finally:" "try:")
 | 
								'("else:" "except:" "finally:" "try:")
 | 
				
			||||||
			"\\|"))
 | 
								"\\|"))
 | 
				
			||||||
 | 
						(kw3 (mapconcat 'identity
 | 
				
			||||||
 | 
								'("ArithmeticError" "AssertionError"
 | 
				
			||||||
 | 
								  "AttributeError" "DeprecationWarning" "EOFError"
 | 
				
			||||||
 | 
								  "Ellipsis" "EnvironmentError" "Exception" "False"
 | 
				
			||||||
 | 
								  "FloatingPointError" "FutureWarning" "IOError"
 | 
				
			||||||
 | 
								  "ImportError" "IndentationError" "IndexError"
 | 
				
			||||||
 | 
								  "KeyError" "KeyboardInterrupt" "LookupError"
 | 
				
			||||||
 | 
								  "MemoryError" "NameError" "None" "NotImplemented"
 | 
				
			||||||
 | 
								  "NotImplementedError" "OSError" "OverflowError"
 | 
				
			||||||
 | 
								  "OverflowWarning" "PendingDeprecationWarning"
 | 
				
			||||||
 | 
								  "ReferenceError" "RuntimeError" "RuntimeWarning"
 | 
				
			||||||
 | 
								  "StandardError" "StopIteration" "SyntaxError"
 | 
				
			||||||
 | 
								  "SyntaxWarning" "SystemError" "SystemExit"
 | 
				
			||||||
 | 
								  "TabError" "True" "TypeError" "UnboundLocalError"
 | 
				
			||||||
 | 
								  "UnicodeDecodeError" "UnicodeEncodeError"
 | 
				
			||||||
 | 
								  "UnicodeError" "UnicodeTranslateError"
 | 
				
			||||||
 | 
								  "UserWarning" "ValueError" "Warning"
 | 
				
			||||||
 | 
								  "ZeroDivisionError" "__debug__"
 | 
				
			||||||
 | 
								  "__import__" "__name__" "abs" "apply" "basestring"
 | 
				
			||||||
 | 
								  "bool" "buffer" "callable" "chr" "classmethod"
 | 
				
			||||||
 | 
								  "cmp" "coerce" "compile" "complex" "copyright"
 | 
				
			||||||
 | 
								  "delattr" "dict" "dir" "divmod"
 | 
				
			||||||
 | 
								  "enumerate" "eval" "execfile" "exit" "file"
 | 
				
			||||||
 | 
								  "filter" "float" "getattr" "globals" "hasattr"
 | 
				
			||||||
 | 
								  "hash" "hex" "id" "input" "int" "intern"
 | 
				
			||||||
 | 
								  "isinstance" "issubclass" "iter" "len" "license"
 | 
				
			||||||
 | 
								  "list" "locals" "long" "map" "max" "min" "object"
 | 
				
			||||||
 | 
								  "oct" "open" "ord" "pow" "property" "range"
 | 
				
			||||||
 | 
								  "raw_input" "reduce" "reload" "repr" "round"
 | 
				
			||||||
 | 
								  "setattr" "slice" "staticmethod" "str" "sum"
 | 
				
			||||||
 | 
								  "super" "tuple" "type" "unichr" "unicode" "vars"
 | 
				
			||||||
 | 
								  "xrange" "zip")
 | 
				
			||||||
 | 
								"\\|"))
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
    (list
 | 
					    (list
 | 
				
			||||||
     ;; keywords
 | 
					     ;; keywords
 | 
				
			||||||
     (cons (concat "\\b\\(" kw1 "\\)\\b[ \n\t(]") 1)
 | 
					     (cons (concat "\\b\\(" kw1 "\\)\\b[ \n\t(]") 1)
 | 
				
			||||||
 | 
					     ;; builtins when they don't appear as object attributes
 | 
				
			||||||
 | 
					     (cons (concat "\\(\\b\\|[.]\\)\\(" kw3 "\\)\\b[ \n\t(]") 2)
 | 
				
			||||||
     ;; block introducing keywords with immediately following colons.
 | 
					     ;; block introducing keywords with immediately following colons.
 | 
				
			||||||
     ;; Yes "except" is in both lists.
 | 
					     ;; Yes "except" is in both lists.
 | 
				
			||||||
     (cons (concat "\\b\\(" kw2 "\\)[ \n\t(]") 1)
 | 
					     (cons (concat "\\b\\(" kw2 "\\)[ \n\t(]") 1)
 | 
				
			||||||
| 
						 | 
					@ -2867,11 +2902,18 @@ A `nomenclature' is a fancy way of saying AWordWithMixedCaseNotUnderscores."
 | 
				
			||||||
		   (mapconcat 'identity newcmd " ")))))
 | 
							   (mapconcat 'identity newcmd " ")))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     (list
 | 
					     (list
 | 
				
			||||||
 | 
					      (if (fboundp 'read-shell-command)
 | 
				
			||||||
	  (read-shell-command "Run pychecker like this: "
 | 
						  (read-shell-command "Run pychecker like this: "
 | 
				
			||||||
			      (if last
 | 
								      (if last
 | 
				
			||||||
				  last
 | 
									  last
 | 
				
			||||||
				default)
 | 
									default)
 | 
				
			||||||
                          'py-pychecker-history))))
 | 
								      'py-pychecker-history)
 | 
				
			||||||
 | 
						(read-string "Run pychecker like this: "
 | 
				
			||||||
 | 
							     (if last
 | 
				
			||||||
 | 
								 last
 | 
				
			||||||
 | 
							       default)
 | 
				
			||||||
 | 
							     'py-pychecker-history))
 | 
				
			||||||
 | 
						)))
 | 
				
			||||||
  (save-some-buffers (not py-ask-about-save) nil)
 | 
					  (save-some-buffers (not py-ask-about-save) nil)
 | 
				
			||||||
  (compile-internal command "No more errors"))
 | 
					  (compile-internal command "No more errors"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue