diff options
Diffstat (limited to 'lisp/simple.el')
| -rw-r--r-- | lisp/simple.el | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 6f72c3b81b9..f08015372af 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -247,7 +247,7 @@ from which next-error navigated, and a target buffer TO-BUFFER." | |||
| 247 | extra-test-exclusive) | 247 | extra-test-exclusive) |
| 248 | "Try the current buffer when outside navigation. | 248 | "Try the current buffer when outside navigation. |
| 249 | But return nil if we navigated to the current buffer by the means | 249 | But return nil if we navigated to the current buffer by the means |
| 250 | of `next-error' command. Othewise, return it if it's next-error | 250 | of `next-error' command. Otherwise, return it if it's next-error |
| 251 | capable." | 251 | capable." |
| 252 | ;; Check that next-error-buffer has no buffer-local value | 252 | ;; Check that next-error-buffer has no buffer-local value |
| 253 | ;; (i.e. we never navigated to the current buffer from another), | 253 | ;; (i.e. we never navigated to the current buffer from another), |
| @@ -1323,7 +1323,9 @@ If called from Lisp, return the number of words between START and | |||
| 1323 | END, without printing any message." | 1323 | END, without printing any message." |
| 1324 | (interactive (list nil nil)) | 1324 | (interactive (list nil nil)) |
| 1325 | (cond ((not (called-interactively-p 'any)) | 1325 | (cond ((not (called-interactively-p 'any)) |
| 1326 | (let ((words 0)) | 1326 | (let ((words 0) |
| 1327 | ;; Count across field boundaries. (Bug#41761) | ||
| 1328 | (inhibit-field-text-motion t)) | ||
| 1327 | (save-excursion | 1329 | (save-excursion |
| 1328 | (save-restriction | 1330 | (save-restriction |
| 1329 | (narrow-to-region start end) | 1331 | (narrow-to-region start end) |
| @@ -1556,6 +1558,8 @@ in *Help* buffer. See also the command `describe-char'." | |||
| 1556 | ;; Might as well bind TAB to completion, since inserting a TAB char is | 1558 | ;; Might as well bind TAB to completion, since inserting a TAB char is |
| 1557 | ;; much too rarely useful. | 1559 | ;; much too rarely useful. |
| 1558 | (define-key m "\t" 'completion-at-point) | 1560 | (define-key m "\t" 'completion-at-point) |
| 1561 | (define-key m "\r" 'read--expression-try-read) | ||
| 1562 | (define-key m "\n" 'read--expression-try-read) | ||
| 1559 | (set-keymap-parent m minibuffer-local-map) | 1563 | (set-keymap-parent m minibuffer-local-map) |
| 1560 | m)) | 1564 | m)) |
| 1561 | 1565 | ||
| @@ -1652,8 +1656,6 @@ function `read-from-minibuffer'." | |||
| 1652 | (set-syntax-table emacs-lisp-mode-syntax-table) | 1656 | (set-syntax-table emacs-lisp-mode-syntax-table) |
| 1653 | (add-hook 'completion-at-point-functions | 1657 | (add-hook 'completion-at-point-functions |
| 1654 | #'elisp-completion-at-point nil t) | 1658 | #'elisp-completion-at-point nil t) |
| 1655 | (local-set-key "\r" 'read--expression-try-read) | ||
| 1656 | (local-set-key "\n" 'read--expression-try-read) | ||
| 1657 | (run-hooks 'eval-expression-minibuffer-setup-hook)) | 1659 | (run-hooks 'eval-expression-minibuffer-setup-hook)) |
| 1658 | (read-from-minibuffer prompt initial-contents | 1660 | (read-from-minibuffer prompt initial-contents |
| 1659 | read-expression-map t | 1661 | read-expression-map t |
| @@ -1845,9 +1847,15 @@ to get different commands to edit and resubmit." | |||
| 1845 | (lambda () | 1847 | (lambda () |
| 1846 | ;; Get a command name at point in the original buffer | 1848 | ;; Get a command name at point in the original buffer |
| 1847 | ;; to propose it after M-n. | 1849 | ;; to propose it after M-n. |
| 1848 | (with-current-buffer (window-buffer (minibuffer-selected-window)) | 1850 | (let ((def (with-current-buffer |
| 1849 | (and (commandp (function-called-at-point)) | 1851 | (window-buffer (minibuffer-selected-window)) |
| 1850 | (format "%S" (function-called-at-point))))))) | 1852 | (and (commandp (function-called-at-point)) |
| 1853 | (format "%S" (function-called-at-point))))) | ||
| 1854 | (all (sort (minibuffer-default-add-completions) | ||
| 1855 | #'string<))) | ||
| 1856 | (if def | ||
| 1857 | (cons def (delete def all)) | ||
| 1858 | all))))) | ||
| 1851 | ;; Read a string, completing from and restricting to the set of | 1859 | ;; Read a string, completing from and restricting to the set of |
| 1852 | ;; all defined commands. Don't provide any initial input. | 1860 | ;; all defined commands. Don't provide any initial input. |
| 1853 | ;; Save the command read on the extended-command history list. | 1861 | ;; Save the command read on the extended-command history list. |