diff options
| author | Joakim Verona | 2013-02-16 00:04:20 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-02-16 00:04:20 +0100 |
| commit | 613fda6799a504feff2d5a930ef7998125498d10 (patch) | |
| tree | 8c7bee1d673435d544d74477ecf20d657b7fa489 /lisp | |
| parent | 73b3f91cfcc9b42d2851ced24d7ba3d17e4c6d00 (diff) | |
| parent | f852f6d8c0db494ccb21b6020a5ebbeaa685a948 (diff) | |
| download | emacs-613fda6799a504feff2d5a930ef7998125498d10.tar.gz emacs-613fda6799a504feff2d5a930ef7998125498d10.zip | |
auto upstream
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 52 | ||||
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 58 | ||||
| -rw-r--r-- | lisp/icomplete.el | 4 | ||||
| -rw-r--r-- | lisp/ido.el | 2 | ||||
| -rw-r--r-- | lisp/iswitchb.el | 2 | ||||
| -rw-r--r-- | lisp/net/goto-addr.el | 23 | ||||
| -rw-r--r-- | lisp/play/fortune.el | 19 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 129 | ||||
| -rw-r--r-- | lisp/xml.el | 4 |
9 files changed, 194 insertions, 99 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a752fe0c3a..99704a0b532 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,55 @@ | |||
| 1 | 2013-02-15 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a | ||
| 4 | global minor mode has been enabled, call the minor mode function | ||
| 5 | for a new buffer once only, after the major mode hook, whilst | ||
| 6 | allowing that hook explicitly to disable the minor mode. | ||
| 7 | (MODE-disable-in-buffer): new (generated) function. | ||
| 8 | (disable-MODE): new (generated) buffer local variable. | ||
| 9 | |||
| 10 | 2013-02-15 Jambunathan K <kjambunathan@gmail.com> | ||
| 11 | |||
| 12 | * iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to | ||
| 13 | `iswitchb-next-match' and `iswitchb-prev-match' resply. | ||
| 14 | |||
| 15 | * ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to | ||
| 16 | `ido-next-match' and `ido-prev-match' resply. | ||
| 17 | |||
| 18 | * icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'. | ||
| 19 | Bind `C-.' and `C-,' to `icomplete-forward-completions' and | ||
| 20 | `icomplete-backward-completions' (Bug#13708). | ||
| 21 | |||
| 22 | 2013-02-15 Michael Albinus <michael.albinus@gmx.de> | ||
| 23 | |||
| 24 | * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. | ||
| 25 | |||
| 26 | 2013-02-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 27 | |||
| 28 | * net/goto-addr.el (goto-address-fontify): Add start and end args. | ||
| 29 | (goto-address-fontify-region): Use them instead of narrowing, so | ||
| 30 | syntax-ppss has access to the whole buffer. | ||
| 31 | |||
| 32 | 2013-02-15 Fabián Ezequiel Gallina <fgallina@cuca> | ||
| 33 | |||
| 34 | * progmodes/python.el: Explain how to restore "cc-mode"-like | ||
| 35 | forward-sexp movement in header documentation (Bug#13642). | ||
| 36 | (python-nav--forward-sexp): Behave like emacs-lisp-mode in | ||
| 37 | comments and strings (GH bug 114). | ||
| 38 | |||
| 39 | 2013-02-15 Fabián Ezequiel Gallina <fgallina@cuca> | ||
| 40 | |||
| 41 | * progmodes/python.el (python-info-current-defun): Fix current | ||
| 42 | defun detection (Bug#13618). | ||
| 43 | |||
| 44 | 2013-02-15 Chong Yidong <cyd@gnu.org> | ||
| 45 | |||
| 46 | * xml.el (xml-parse-string): Fix typo in handling of bad character | ||
| 47 | references. | ||
| 48 | |||
| 49 | 2013-02-15 Glenn Morris <rgm@gnu.org> | ||
| 50 | |||
| 51 | * play/fortune.el (fortune-compile): Simplify and fix previous change. | ||
| 52 | |||
| 1 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> | 53 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 54 | ||
| 3 | * net/tramp.el (tramp-debug-message): Add | 55 | * net/tramp.el (tramp-debug-message): Add |
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 9173d148c6a..2088e690228 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -132,13 +132,14 @@ BODY contains code to execute each time the mode is enabled or disabled. | |||
| 132 | :require SYM Same as in `defcustom'. | 132 | :require SYM Same as in `defcustom'. |
| 133 | :variable PLACE The location to use instead of the variable MODE to store | 133 | :variable PLACE The location to use instead of the variable MODE to store |
| 134 | the state of the mode. This can be simply a different | 134 | the state of the mode. This can be simply a different |
| 135 | named variable, or more generally anything that can be used | 135 | named variable, or a generalized variable. |
| 136 | with the CL macro `setf'. PLACE can also be of the form | 136 | PLACE can also be of the form \(GET . SET), where GET is |
| 137 | \(GET . SET), where GET is an expression that returns the | 137 | an expression that returns the current state, and SET is |
| 138 | current state, and SET is a function that takes one argument, | 138 | a function that takes one argument, the new state, and |
| 139 | the new state, and sets it. If you specify a :variable, | 139 | sets it. If you specify a :variable, this function does |
| 140 | this function does not define a MODE variable (nor any of | 140 | not define a MODE variable (nor any of the terms used |
| 141 | the terms used in :variable). | 141 | in :variable). |
| 142 | |||
| 142 | :after-hook A single lisp form which is evaluated after the mode hooks | 143 | :after-hook A single lisp form which is evaluated after the mode hooks |
| 143 | have been run. It should not be quoted. | 144 | have been run. It should not be quoted. |
| 144 | 145 | ||
| @@ -340,9 +341,14 @@ If MODE's set-up depends on the major mode in effect when it was | |||
| 340 | enabled, then disabling and reenabling MODE should make MODE work | 341 | enabled, then disabling and reenabling MODE should make MODE work |
| 341 | correctly with the current major mode. This is important to | 342 | correctly with the current major mode. This is important to |
| 342 | prevent problems with derived modes, that is, major modes that | 343 | prevent problems with derived modes, that is, major modes that |
| 343 | call another major mode in their body." | 344 | call another major mode in their body. |
| 345 | |||
| 346 | When a major mode is initialized, MODE is actually turned on just | ||
| 347 | after running the major mode's hook. However, MODE is not turned | ||
| 348 | on if the hook has explicitly disabled it." | ||
| 344 | (declare (doc-string 2)) | 349 | (declare (doc-string 2)) |
| 345 | (let* ((global-mode-name (symbol-name global-mode)) | 350 | (let* ((global-mode-name (symbol-name global-mode)) |
| 351 | (mode-name (symbol-name mode)) | ||
| 346 | (pretty-name (easy-mmode-pretty-mode-name mode)) | 352 | (pretty-name (easy-mmode-pretty-mode-name mode)) |
| 347 | (pretty-global-name (easy-mmode-pretty-mode-name global-mode)) | 353 | (pretty-global-name (easy-mmode-pretty-mode-name global-mode)) |
| 348 | (group nil) | 354 | (group nil) |
| @@ -353,6 +359,10 @@ call another major mode in their body." | |||
| 353 | (MODE-check-buffers | 359 | (MODE-check-buffers |
| 354 | (intern (concat global-mode-name "-check-buffers"))) | 360 | (intern (concat global-mode-name "-check-buffers"))) |
| 355 | (MODE-cmhh (intern (concat global-mode-name "-cmhh"))) | 361 | (MODE-cmhh (intern (concat global-mode-name "-cmhh"))) |
| 362 | (MODE-disable-in-buffer | ||
| 363 | (intern (concat global-mode-name "-disable-in-buffer"))) | ||
| 364 | (minor-MODE-hook (intern (concat mode-name "-hook"))) | ||
| 365 | (disable-MODE (intern (concat "disable-" mode-name))) | ||
| 356 | (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))) | 366 | (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))) |
| 357 | keyw) | 367 | keyw) |
| 358 | 368 | ||
| @@ -396,8 +406,6 @@ See `%s' for more information on %s." | |||
| 396 | (progn | 406 | (progn |
| 397 | (add-hook 'after-change-major-mode-hook | 407 | (add-hook 'after-change-major-mode-hook |
| 398 | ',MODE-enable-in-buffers) | 408 | ',MODE-enable-in-buffers) |
| 399 | (add-hook 'change-major-mode-after-body-hook | ||
| 400 | ',MODE-enable-in-buffers) | ||
| 401 | (add-hook 'find-file-hook ',MODE-check-buffers) | 409 | (add-hook 'find-file-hook ',MODE-check-buffers) |
| 402 | (add-hook 'change-major-mode-hook ',MODE-cmhh)) | 410 | (add-hook 'change-major-mode-hook ',MODE-cmhh)) |
| 403 | (remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) | 411 | (remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) |
| @@ -415,6 +423,10 @@ See `%s' for more information on %s." | |||
| 415 | ;; up-to-here. | 423 | ;; up-to-here. |
| 416 | :autoload-end | 424 | :autoload-end |
| 417 | 425 | ||
| 426 | ;; A function which checks whether MODE has been disabled in the major | ||
| 427 | ;; mode hook which has just been run. | ||
| 428 | (add-hook ',minor-MODE-hook ',MODE-disable-in-buffer) | ||
| 429 | |||
| 418 | ;; List of buffers left to process. | 430 | ;; List of buffers left to process. |
| 419 | (defvar ,MODE-buffers nil) | 431 | (defvar ,MODE-buffers nil) |
| 420 | 432 | ||
| @@ -423,14 +435,15 @@ See `%s' for more information on %s." | |||
| 423 | (dolist (buf ,MODE-buffers) | 435 | (dolist (buf ,MODE-buffers) |
| 424 | (when (buffer-live-p buf) | 436 | (when (buffer-live-p buf) |
| 425 | (with-current-buffer buf | 437 | (with-current-buffer buf |
| 426 | (unless (eq ,MODE-major-mode major-mode) | 438 | (if ,disable-MODE |
| 427 | (if ,mode | 439 | (if ,mode (,mode -1)) |
| 428 | (progn | 440 | (unless (eq ,MODE-major-mode major-mode) |
| 429 | (,mode -1) | 441 | (if ,mode |
| 430 | (,turn-on) | 442 | (progn |
| 431 | (setq ,MODE-major-mode major-mode)) | 443 | (,mode -1) |
| 432 | (,turn-on) | 444 | (,turn-on)) |
| 433 | (setq ,MODE-major-mode major-mode))))))) | 445 | (,turn-on)))) |
| 446 | (setq ,MODE-major-mode major-mode))))) | ||
| 434 | (put ',MODE-enable-in-buffers 'definition-name ',global-mode) | 447 | (put ',MODE-enable-in-buffers 'definition-name ',global-mode) |
| 435 | 448 | ||
| 436 | (defun ,MODE-check-buffers () | 449 | (defun ,MODE-check-buffers () |
| @@ -443,7 +456,14 @@ See `%s' for more information on %s." | |||
| 443 | (defun ,MODE-cmhh () | 456 | (defun ,MODE-cmhh () |
| 444 | (add-to-list ',MODE-buffers (current-buffer)) | 457 | (add-to-list ',MODE-buffers (current-buffer)) |
| 445 | (add-hook 'post-command-hook ',MODE-check-buffers)) | 458 | (add-hook 'post-command-hook ',MODE-check-buffers)) |
| 446 | (put ',MODE-cmhh 'definition-name ',global-mode)))) | 459 | (put ',MODE-cmhh 'definition-name ',global-mode) |
| 460 | ;; disable-MODE is set in MODE-disable-in-buffer and cleared by | ||
| 461 | ;; kill-all-local-variables. | ||
| 462 | (defvar-local ,disable-MODE nil) | ||
| 463 | (defun ,MODE-disable-in-buffer () | ||
| 464 | (unless ,mode | ||
| 465 | (setq ,disable-MODE t))) | ||
| 466 | (put ',MODE-disable-in-buffer 'definition-name ',global-mode)))) | ||
| 447 | 467 | ||
| 448 | ;;; | 468 | ;;; |
| 449 | ;;; easy-mmode-defmap | 469 | ;;; easy-mmode-defmap |
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 1f9b4a3afe6..73049df097d 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -168,8 +168,8 @@ except those on this list.") | |||
| 168 | (let ((map (make-sparse-keymap))) | 168 | (let ((map (make-sparse-keymap))) |
| 169 | (define-key map [?\M-\t] 'minibuffer-force-complete) | 169 | (define-key map [?\M-\t] 'minibuffer-force-complete) |
| 170 | (define-key map [?\C-j] 'minibuffer-force-complete-and-exit) | 170 | (define-key map [?\C-j] 'minibuffer-force-complete-and-exit) |
| 171 | (define-key map [?\C-s] 'icomplete-forward-completions) | 171 | (define-key map [?\C-.] 'icomplete-forward-completions) |
| 172 | (define-key map [?\C-r] 'icomplete-backward-completions) | 172 | (define-key map [?\C-,] 'icomplete-backward-completions) |
| 173 | map)) | 173 | map)) |
| 174 | 174 | ||
| 175 | (defun icomplete-forward-completions () | 175 | (defun icomplete-forward-completions () |
diff --git a/lisp/ido.el b/lisp/ido.el index 008561aa268..066d8276af5 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1585,6 +1585,8 @@ This function also adds a hook to the minibuffer." | |||
| 1585 | (define-key map "\C-p" 'ido-toggle-prefix) | 1585 | (define-key map "\C-p" 'ido-toggle-prefix) |
| 1586 | (define-key map "\C-r" 'ido-prev-match) | 1586 | (define-key map "\C-r" 'ido-prev-match) |
| 1587 | (define-key map "\C-s" 'ido-next-match) | 1587 | (define-key map "\C-s" 'ido-next-match) |
| 1588 | (define-key map [?\C-.] 'ido-next-match) | ||
| 1589 | (define-key map [?\C-,] 'ido-prev-match) | ||
| 1588 | (define-key map "\C-t" 'ido-toggle-regexp) | 1590 | (define-key map "\C-t" 'ido-toggle-regexp) |
| 1589 | (define-key map "\C-z" 'ido-undo-merge-work-directory) | 1591 | (define-key map "\C-z" 'ido-undo-merge-work-directory) |
| 1590 | (define-key map [(control ?\s)] 'ido-restrict-to-matches) | 1592 | (define-key map [(control ?\s)] 'ido-restrict-to-matches) |
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 93d589c7706..68749f1b012 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el | |||
| @@ -471,6 +471,8 @@ interfere with other minibuffer usage.") | |||
| 471 | (define-key map "?" 'iswitchb-completion-help) | 471 | (define-key map "?" 'iswitchb-completion-help) |
| 472 | (define-key map "\C-s" 'iswitchb-next-match) | 472 | (define-key map "\C-s" 'iswitchb-next-match) |
| 473 | (define-key map "\C-r" 'iswitchb-prev-match) | 473 | (define-key map "\C-r" 'iswitchb-prev-match) |
| 474 | (define-key map [?\C-.] 'iswitchb-next-match) | ||
| 475 | (define-key map [?\C-,] 'iswitchb-prev-match) | ||
| 474 | (define-key map "\t" 'iswitchb-complete) | 476 | (define-key map "\t" 'iswitchb-complete) |
| 475 | (define-key map "\C-j" 'iswitchb-select-buffer-text) | 477 | (define-key map "\C-j" 'iswitchb-select-buffer-text) |
| 476 | (define-key map "\C-t" 'iswitchb-toggle-regexp) | 478 | (define-key map "\C-t" 'iswitchb-toggle-regexp) |
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 1005285917e..59e4da16619 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el | |||
| @@ -156,18 +156,19 @@ A value of t means there is no limit--fontify regardless of the size." | |||
| 156 | 156 | ||
| 157 | (defvar goto-address-prog-mode) | 157 | (defvar goto-address-prog-mode) |
| 158 | 158 | ||
| 159 | (defun goto-address-fontify () | 159 | (defun goto-address-fontify (&optional start end) |
| 160 | "Fontify the URLs and e-mail addresses in the current buffer. | 160 | "Fontify the URLs and e-mail addresses in the current buffer. |
| 161 | This function implements `goto-address-highlight-p' | 161 | This function implements `goto-address-highlight-p' |
| 162 | and `goto-address-fontify-p'." | 162 | and `goto-address-fontify-p'." |
| 163 | ;; Clean up from any previous go. | 163 | ;; Clean up from any previous go. |
| 164 | (goto-address-unfontify (point-min) (point-max)) | 164 | (goto-address-unfontify (or start (point-min)) (or end (point-max))) |
| 165 | (save-excursion | 165 | (save-excursion |
| 166 | (let ((inhibit-point-motion-hooks t)) | 166 | (let ((inhibit-point-motion-hooks t)) |
| 167 | (goto-char (point-min)) | 167 | (goto-char (or start (point-min))) |
| 168 | (when (or (eq t goto-address-fontify-maximum-size) | 168 | (when (or (eq t goto-address-fontify-maximum-size) |
| 169 | (< (- (point-max) (point)) goto-address-fontify-maximum-size)) | 169 | (< (- (or end (point-max)) (point)) |
| 170 | (while (re-search-forward goto-address-url-regexp nil t) | 170 | goto-address-fontify-maximum-size)) |
| 171 | (while (re-search-forward goto-address-url-regexp end t) | ||
| 171 | (let* ((s (match-beginning 0)) | 172 | (let* ((s (match-beginning 0)) |
| 172 | (e (match-end 0)) | 173 | (e (match-end 0)) |
| 173 | this-overlay) | 174 | this-overlay) |
| @@ -187,8 +188,8 @@ and `goto-address-fontify-p'." | |||
| 187 | (overlay-put this-overlay | 188 | (overlay-put this-overlay |
| 188 | 'keymap goto-address-highlight-keymap) | 189 | 'keymap goto-address-highlight-keymap) |
| 189 | (overlay-put this-overlay 'goto-address t)))) | 190 | (overlay-put this-overlay 'goto-address t)))) |
| 190 | (goto-char (point-min)) | 191 | (goto-char (or start (point-min))) |
| 191 | (while (re-search-forward goto-address-mail-regexp nil t) | 192 | (while (re-search-forward goto-address-mail-regexp end t) |
| 192 | (let* ((s (match-beginning 0)) | 193 | (let* ((s (match-beginning 0)) |
| 193 | (e (match-end 0)) | 194 | (e (match-end 0)) |
| 194 | this-overlay) | 195 | this-overlay) |
| @@ -212,11 +213,9 @@ and `goto-address-fontify-p'." | |||
| 212 | (defun goto-address-fontify-region (start end) | 213 | (defun goto-address-fontify-region (start end) |
| 213 | "Fontify URLs and e-mail addresses in the given region." | 214 | "Fontify URLs and e-mail addresses in the given region." |
| 214 | (save-excursion | 215 | (save-excursion |
| 215 | (save-restriction | 216 | (let ((beg-line (progn (goto-char start) (line-beginning-position))) |
| 216 | (let ((beg-line (progn (goto-char start) (line-beginning-position))) | 217 | (end-line (progn (goto-char end) (line-end-position)))) |
| 217 | (end-line (progn (goto-char end) (line-end-position)))) | 218 | (goto-address-fontify beg-line end-line)))) |
| 218 | (narrow-to-region beg-line end-line) | ||
| 219 | (goto-address-fontify))))) | ||
| 220 | 219 | ||
| 221 | ;; code to find and goto addresses; much of this has been blatantly | 220 | ;; code to find and goto addresses; much of this has been blatantly |
| 222 | ;; snarfed from browse-url.el | 221 | ;; snarfed from browse-url.el |
diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el index 0920012b280..cb58c0d0af0 100644 --- a/lisp/play/fortune.el +++ b/lisp/play/fortune.el | |||
| @@ -244,17 +244,14 @@ the value of `fortune-file'. This currently cannot handle directories." | |||
| 244 | (let* ((fortune-file (expand-file-name (substitute-in-file-name file))) | 244 | (let* ((fortune-file (expand-file-name (substitute-in-file-name file))) |
| 245 | (fortune-dat (expand-file-name | 245 | (fortune-dat (expand-file-name |
| 246 | (substitute-in-file-name | 246 | (substitute-in-file-name |
| 247 | (concat fortune-file fortune-database-extension)))) | 247 | (concat fortune-file fortune-database-extension))))) |
| 248 | (fortune-dat-exist (file-exists-p fortune-dat))) | 248 | (cond ((file-exists-p fortune-file) |
| 249 | (cond ((file-exists-p fortune-file) | 249 | (cond ((file-newer-than-file-p fortune-file fortune-dat) |
| 250 | (if (or (not fortune-dat-exist) | 250 | (message "Compiling new fortune database %s" fortune-dat) |
| 251 | (and fortune-dat-exist | 251 | (shell-command |
| 252 | (file-newer-than-file-p fortune-file fortune-dat))) | 252 | (concat fortune-strfile fortune-strfile-options |
| 253 | (message "Compiling new fortune database %s" fortune-dat) | 253 | " " fortune-file fortune-quiet-strfile-options))))) |
| 254 | (shell-command | 254 | (t (error "Can't compile fortune file %s" fortune-file))))) |
| 255 | (concat fortune-strfile fortune-strfile-options | ||
| 256 | " " fortune-file fortune-quiet-strfile-options)))) | ||
| 257 | (t (error "Can't compile fortune file %s" fortune-file))))) | ||
| 258 | 255 | ||
| 259 | 256 | ||
| 260 | ;;; ************** | 257 | ;;; ************** |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 35c5ba19e33..eadb06fa61e 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -54,8 +54,13 @@ | |||
| 54 | ;; `python-nav-beginning-of-statement', `python-nav-end-of-statement', | 54 | ;; `python-nav-beginning-of-statement', `python-nav-end-of-statement', |
| 55 | ;; `python-nav-beginning-of-block' and `python-nav-end-of-block' are | 55 | ;; `python-nav-beginning-of-block' and `python-nav-end-of-block' are |
| 56 | ;; included but no bound to any key. At last but not least the | 56 | ;; included but no bound to any key. At last but not least the |
| 57 | ;; specialized `python-nav-forward-sexp' allows easy | 57 | ;; specialized `python-nav-forward-sexp' allows easy navigation |
| 58 | ;; navigation between code blocks. | 58 | ;; between code blocks. If you prefer `cc-mode'-like `forward-sexp' |
| 59 | ;; movement, setting `forward-sexp-function' to nil is enough, You can | ||
| 60 | ;; do that using the `python-mode-hook': | ||
| 61 | |||
| 62 | ;; (add-hook 'python-mode-hook | ||
| 63 | ;; (lambda () (setq forward-sexp-function nil))) | ||
| 59 | 64 | ||
| 60 | ;; Shell interaction: is provided and allows you to execute easily any | 65 | ;; Shell interaction: is provided and allows you to execute easily any |
| 61 | ;; block of code of your current buffer in an inferior Python process. | 66 | ;; block of code of your current buffer in an inferior Python process. |
| @@ -1349,13 +1354,10 @@ backwards." | |||
| 1349 | 're-search-backward)) | 1354 | 're-search-backward)) |
| 1350 | (context-type (python-syntax-context-type))) | 1355 | (context-type (python-syntax-context-type))) |
| 1351 | (cond | 1356 | (cond |
| 1352 | ((eq context-type 'string) | 1357 | ((memq context-type '(string comment)) |
| 1353 | ;; Inside of a string, get out of it. | 1358 | ;; Inside of a string, get out of it. |
| 1354 | (while (and (funcall re-search-fn "[\"']" nil t) | 1359 | (let ((forward-sexp-function)) |
| 1355 | (python-syntax-context 'string)))) | 1360 | (forward-sexp dir))) |
| 1356 | ((eq context-type 'comment) | ||
| 1357 | ;; Inside of a comment, just move forward. | ||
| 1358 | (python-util-forward-comment dir)) | ||
| 1359 | ((or (eq context-type 'paren) | 1361 | ((or (eq context-type 'paren) |
| 1360 | (and forward-p (looking-at (python-rx open-paren))) | 1362 | (and forward-p (looking-at (python-rx open-paren))) |
| 1361 | (and (not forward-p) | 1363 | (and (not forward-p) |
| @@ -1378,16 +1380,16 @@ backwards." | |||
| 1378 | (save-excursion | 1380 | (save-excursion |
| 1379 | (python-nav-lisp-forward-sexp-safe dir) | 1381 | (python-nav-lisp-forward-sexp-safe dir) |
| 1380 | (point))) | 1382 | (point))) |
| 1381 | (next-sexp-context | 1383 | (next-sexp-context |
| 1382 | (save-excursion | 1384 | (save-excursion |
| 1383 | (goto-char next-sexp-pos) | 1385 | (goto-char next-sexp-pos) |
| 1384 | (cond | 1386 | (cond |
| 1385 | ((python-info-beginning-of-block-p) 'block-start) | 1387 | ((python-info-beginning-of-block-p) 'block-start) |
| 1386 | ((python-info-end-of-block-p) 'block-end) | 1388 | ((python-info-end-of-block-p) 'block-end) |
| 1387 | ((python-info-beginning-of-statement-p) 'statement-start) | 1389 | ((python-info-beginning-of-statement-p) 'statement-start) |
| 1388 | ((python-info-end-of-statement-p) 'statement-end) | 1390 | ((python-info-end-of-statement-p) 'statement-end) |
| 1389 | ((python-info-statement-starts-block-p) 'starts-block) | 1391 | ((python-info-statement-starts-block-p) 'starts-block) |
| 1390 | ((python-info-statement-ends-block-p) 'ends-block))))) | 1392 | ((python-info-statement-ends-block-p) 'ends-block))))) |
| 1391 | (if forward-p | 1393 | (if forward-p |
| 1392 | (cond ((and (not (eobp)) | 1394 | (cond ((and (not (eobp)) |
| 1393 | (python-info-current-line-empty-p)) | 1395 | (python-info-current-line-empty-p)) |
| @@ -1411,8 +1413,8 @@ backwards." | |||
| 1411 | (t (goto-char next-sexp-pos))) | 1413 | (t (goto-char next-sexp-pos))) |
| 1412 | (cond ((and (not (bobp)) | 1414 | (cond ((and (not (bobp)) |
| 1413 | (python-info-current-line-empty-p)) | 1415 | (python-info-current-line-empty-p)) |
| 1414 | (python-util-forward-comment dir) | 1416 | (python-util-forward-comment dir) |
| 1415 | (python-nav--forward-sexp dir)) | 1417 | (python-nav--forward-sexp dir)) |
| 1416 | ((eq context 'block-end) | 1418 | ((eq context 'block-end) |
| 1417 | (python-nav-beginning-of-block)) | 1419 | (python-nav-beginning-of-block)) |
| 1418 | ((eq context 'statement-end) | 1420 | ((eq context 'statement-end) |
| @@ -2946,40 +2948,61 @@ Optional argument INCLUDE-TYPE indicates to include the type of the defun. | |||
| 2946 | This function is compatible to be used as | 2948 | This function is compatible to be used as |
| 2947 | `add-log-current-defun-function' since it returns nil if point is | 2949 | `add-log-current-defun-function' since it returns nil if point is |
| 2948 | not inside a defun." | 2950 | not inside a defun." |
| 2949 | (save-restriction | 2951 | (save-restriction |
| 2950 | (widen) | 2952 | (widen) |
| 2951 | (save-excursion | 2953 | (save-excursion |
| 2952 | (end-of-line 1) | 2954 | (end-of-line 1) |
| 2953 | (let ((names) | 2955 | (let ((names) |
| 2954 | (starting-indentation | 2956 | (starting-indentation (current-indentation)) |
| 2955 | (save-excursion | 2957 | (starting-pos (point)) |
| 2956 | (and | 2958 | (first-run t) |
| 2957 | (python-nav-beginning-of-defun 1) | 2959 | (last-indent) |
| 2958 | ;; This extra number is just for checking code | 2960 | (type)) |
| 2959 | ;; against indentation to work well on first run. | 2961 | (catch 'exit |
| 2960 | (+ (current-indentation) 4)))) | 2962 | (while (python-nav-beginning-of-defun 1) |
| 2961 | (starting-point (point))) | 2963 | (when (and |
| 2962 | ;; Check point is inside a defun. | 2964 | (or (not last-indent) |
| 2963 | (when (and starting-indentation | 2965 | (< (current-indentation) last-indent)) |
| 2964 | (< starting-point | 2966 | (or |
| 2967 | (and first-run | ||
| 2965 | (save-excursion | 2968 | (save-excursion |
| 2966 | (python-nav-end-of-defun) | 2969 | ;; If this is the first run, we may add |
| 2967 | (point)))) | 2970 | ;; the current defun at point. |
| 2968 | (catch 'exit | 2971 | (setq first-run nil) |
| 2969 | (while (python-nav-beginning-of-defun 1) | 2972 | (goto-char starting-pos) |
| 2970 | (when (< (current-indentation) starting-indentation) | 2973 | (python-nav-beginning-of-statement) |
| 2971 | (setq starting-indentation (current-indentation)) | 2974 | (beginning-of-line 1) |
| 2972 | (setq names | 2975 | (looking-at-p |
| 2973 | (cons | 2976 | python-nav-beginning-of-defun-regexp))) |
| 2974 | (if (not include-type) | 2977 | (< starting-pos |
| 2975 | (match-string-no-properties 1) | 2978 | (save-excursion |
| 2976 | (mapconcat 'identity | 2979 | (let ((min-indent |
| 2977 | (split-string | 2980 | (+ (current-indentation) |
| 2978 | (match-string-no-properties 0)) " ")) | 2981 | python-indent-offset))) |
| 2979 | names))) | 2982 | (if (< starting-indentation min-indent) |
| 2980 | (and (= (current-indentation) 0) (throw 'exit t))))) | 2983 | ;; If the starting indentation is not |
| 2981 | (and names | 2984 | ;; within the min defun indent make the |
| 2982 | (mapconcat (lambda (string) string) names ".")))))) | 2985 | ;; check fail. |
| 2986 | starting-pos | ||
| 2987 | ;; Else go to the end of defun and add | ||
| 2988 | ;; up the current indentation to the | ||
| 2989 | ;; ending position. | ||
| 2990 | (python-nav-end-of-defun) | ||
| 2991 | (+ (point) | ||
| 2992 | (if (>= (current-indentation) min-indent) | ||
| 2993 | (1+ (current-indentation)) | ||
| 2994 | 0)))))))) | ||
| 2995 | (setq last-indent (current-indentation)) | ||
| 2996 | (if (or (not include-type) type) | ||
| 2997 | (setq names (cons (match-string-no-properties 1) names)) | ||
| 2998 | (let ((match (split-string (match-string-no-properties 0)))) | ||
| 2999 | (setq type (car match)) | ||
| 3000 | (setq names (cons (cadr match) names))))) | ||
| 3001 | ;; Stop searching ASAP. | ||
| 3002 | (and (= (current-indentation) 0) (throw 'exit t)))) | ||
| 3003 | (and names | ||
| 3004 | (concat (and type (format "%s " type)) | ||
| 3005 | (mapconcat 'identity names "."))))))) | ||
| 2983 | 3006 | ||
| 2984 | (defun python-info-current-symbol (&optional replace-self) | 3007 | (defun python-info-current-symbol (&optional replace-self) |
| 2985 | "Return current symbol using dotty syntax. | 3008 | "Return current symbol using dotty syntax. |
diff --git a/lisp/xml.el b/lisp/xml.el index 2232746f02a..a3d34670bfb 100644 --- a/lisp/xml.el +++ b/lisp/xml.el | |||
| @@ -611,7 +611,7 @@ references." | |||
| 611 | xml-validating-parser | 611 | xml-validating-parser |
| 612 | (error "XML: (Validity) Invalid character reference `%s'" | 612 | (error "XML: (Validity) Invalid character reference `%s'" |
| 613 | (match-string 0))) | 613 | (match-string 0))) |
| 614 | (replace-match (or (string val) xml-undefined-entity) t t)) | 614 | (replace-match (if val (string val) xml-undefined-entity) t t)) |
| 615 | ;; For an entity reference, search again from the start of | 615 | ;; For an entity reference, search again from the start of |
| 616 | ;; the replaced text, since the replacement can contain | 616 | ;; the replaced text, since the replacement can contain |
| 617 | ;; entity or character references, or markup. | 617 | ;; entity or character references, or markup. |
| @@ -620,7 +620,7 @@ references." | |||
| 620 | (and (null val) | 620 | (and (null val) |
| 621 | xml-validating-parser | 621 | xml-validating-parser |
| 622 | (error "XML: (Validity) Undefined entity `%s'" ref)) | 622 | (error "XML: (Validity) Undefined entity `%s'" ref)) |
| 623 | (replace-match (cdr val) t t) | 623 | (replace-match (or (cdr val) xml-undefined-entity) t t) |
| 624 | (goto-char (match-beginning 0))) | 624 | (goto-char (match-beginning 0))) |
| 625 | ;; Check for XML bombs. | 625 | ;; Check for XML bombs. |
| 626 | (and xml-entity-expansion-limit | 626 | (and xml-entity-expansion-limit |