mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	(py-shell-hook): A new hook variable, run at the end of py-shell.
Allows for some customization of the underlying comint buffer. (py-shell): Call the new hook. (info-lookup-maybe-add-help): A new call suggested by Milan Zamazal to make lookups in the Info documentation easier.
This commit is contained in:
		
							parent
							
								
									65300f17c3
								
							
						
					
					
						commit
						56bd2edeef
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -469,6 +469,9 @@ Currently-active file is at the head of the list.")
 | 
			
		|||
(defvar python-mode-hook nil
 | 
			
		||||
  "*Hook called by `python-mode'.")
 | 
			
		||||
 | 
			
		||||
(defvar py-shell-hook nil
 | 
			
		||||
  "*Hook called by `py-shell'.")
 | 
			
		||||
 | 
			
		||||
;; In previous version of python-mode.el, the hook was incorrectly
 | 
			
		||||
;; called py-mode-hook, and was not defvar'd.  Deprecate its use.
 | 
			
		||||
(and (fboundp 'make-obsolete-variable)
 | 
			
		||||
| 
						 | 
				
			
			@ -1336,6 +1339,7 @@ filter."
 | 
			
		|||
    (setq py-pdbtrack-do-tracking-p t)
 | 
			
		||||
    (set-syntax-table py-mode-syntax-table)
 | 
			
		||||
    (use-local-map py-shell-map)
 | 
			
		||||
    (run-hooks 'py-shell-hook)
 | 
			
		||||
    ))
 | 
			
		||||
 | 
			
		||||
(defun py-clear-queue ()
 | 
			
		||||
| 
						 | 
				
			
			@ -2996,6 +3000,16 @@ Obscure:  When python-mode is first loaded, it looks for all bindings
 | 
			
		|||
to newline-and-indent in the global keymap, and shadows them with
 | 
			
		||||
local bindings to py-newline-and-indent."))
 | 
			
		||||
 | 
			
		||||
(require 'info-look)
 | 
			
		||||
(info-lookup-maybe-add-help
 | 
			
		||||
 :mode 'python-mode
 | 
			
		||||
 :regexp "[a-zA-Z0-9_]+"
 | 
			
		||||
 :doc-spec '(("(python-lib)Module Index")
 | 
			
		||||
	     ("(python-lib)Class-Exception-Object Index")
 | 
			
		||||
	     ("(python-lib)Function-Method-Variable Index")
 | 
			
		||||
	     ("(python-lib)Miscellaneous Index")))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
;; Helper functions
 | 
			
		||||
(defvar py-parse-state-re
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue