comparison lisp/progmodes/python.el @ 78487:419c5c316b51

Replace `iff' in doc-strings and comments.
author Glenn Morris <rgm@gnu.org>
date Wed, 08 Aug 2007 07:31:11 +0000
parents fb9000547438
children 38a441bc4532 e5a68f18fcb9
comparison
equal deleted inserted replaced
78486:f0a07da7dd45 78487:419c5c316b51
346 (condition-case () 346 (condition-case ()
347 (progn (backward-up-list) t) ; actually within brackets 347 (progn (backward-up-list) t) ; actually within brackets
348 (error nil)))))))) 348 (error nil))))))))
349 349
350 (defun python-comment-line-p () 350 (defun python-comment-line-p ()
351 "Return non-nil iff current line has only a comment." 351 "Return non-nil if current line has only a comment."
352 (save-excursion 352 (save-excursion
353 (end-of-line) 353 (end-of-line)
354 (when (eq 'comment (syntax-ppss-context (syntax-ppss))) 354 (when (eq 'comment (syntax-ppss-context (syntax-ppss)))
355 (back-to-indentation) 355 (back-to-indentation)
356 (looking-at (rx (or (syntax comment-start) line-end)))))) 356 (looking-at (rx (or (syntax comment-start) line-end))))))
357 357
358 (defun python-blank-line-p () 358 (defun python-blank-line-p ()
359 "Return non-nil iff current line is blank." 359 "Return non-nil if current line is blank."
360 (save-excursion 360 (save-excursion
361 (beginning-of-line) 361 (beginning-of-line)
362 (looking-at "\\s-*$"))) 362 (looking-at "\\s-*$")))
363 363
364 (defun python-beginning-of-string () 364 (defun python-beginning-of-string ()
848 848
849 (defun python-skip-out (&optional forward syntax) 849 (defun python-skip-out (&optional forward syntax)
850 "Skip out of any nested brackets. 850 "Skip out of any nested brackets.
851 Skip forward if FORWARD is non-nil, else backward. 851 Skip forward if FORWARD is non-nil, else backward.
852 If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. 852 If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point.
853 Return non-nil iff skipping was done." 853 Return non-nil if skipping was done."
854 (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) 854 (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss))))
855 (forward (if forward -1 1))) 855 (forward (if forward -1 1)))
856 (unless (zerop depth) 856 (unless (zerop depth)
857 (if (> depth 0) 857 (if (> depth 0)
858 ;; Skip forward out of nested brackets. 858 ;; Skip forward out of nested brackets.
1189 (let ((map (make-sparse-keymap))) 1189 (let ((map (make-sparse-keymap)))
1190 ;; This will inherit from comint-mode-map. 1190 ;; This will inherit from comint-mode-map.
1191 (define-key map "\C-c\C-l" 'python-load-file) 1191 (define-key map "\C-c\C-l" 'python-load-file)
1192 (define-key map "\C-c\C-v" 'python-check) 1192 (define-key map "\C-c\C-v" 'python-check)
1193 ;; Note that we _can_ still use these commands which send to the 1193 ;; Note that we _can_ still use these commands which send to the
1194 ;; Python process even at the prompt iff we have a normal prompt, 1194 ;; Python process even at the prompt provided we have a normal prompt,
1195 ;; i.e. '>>> ' and not '... '. See the comment before 1195 ;; i.e. '>>> ' and not '... '. See the comment before
1196 ;; python-send-region. Fixme: uncomment these if we address that. 1196 ;; python-send-region. Fixme: uncomment these if we address that.
1197 1197
1198 ;; (define-key map [(meta ?\t)] 'python-complete-symbol) 1198 ;; (define-key map [(meta ?\t)] 'python-complete-symbol)
1199 ;; (define-key map "\C-c\C-f" 'python-describe-symbol) 1199 ;; (define-key map "\C-c\C-f" 'python-describe-symbol)