aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/simple.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el41
1 files changed, 39 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 7c941fd63b9..c1ec78da7b9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1301,6 +1301,40 @@ to get different commands to edit and resubmit."
1301 (if command-history 1301 (if command-history
1302 (error "Argument %d is beyond length of command history" arg) 1302 (error "Argument %d is beyond length of command history" arg)
1303 (error "There are no previous complex commands to repeat"))))) 1303 (error "There are no previous complex commands to repeat")))))
1304
1305(defun read-extended-command ()
1306 "Read command name to invoke in `execute-extended-command'."
1307 (minibuffer-with-setup-hook
1308 (lambda ()
1309 (set (make-local-variable 'minibuffer-default-add-function)
1310 (lambda ()
1311 ;; Get a command name at point in the original buffer
1312 ;; to propose it after M-n.
1313 (with-current-buffer (window-buffer (minibuffer-selected-window))
1314 (and (commandp (function-called-at-point))
1315 (format "%S" (function-called-at-point)))))))
1316 ;; Read a string, completing from and restricting to the set of
1317 ;; all defined commands. Don't provide any initial input.
1318 ;; Save the command read on the extended-command history list.
1319 (completing-read
1320 (concat (cond
1321 ((eq current-prefix-arg '-) "- ")
1322 ((and (consp current-prefix-arg)
1323 (eq (car current-prefix-arg) 4)) "C-u ")
1324 ((and (consp current-prefix-arg)
1325 (integerp (car current-prefix-arg)))
1326 (format "%d " (car current-prefix-arg)))
1327 ((integerp current-prefix-arg)
1328 (format "%d " current-prefix-arg)))
1329 ;; This isn't strictly correct if `execute-extended-command'
1330 ;; is bound to anything else (e.g. [menu]).
1331 ;; It could use (key-description (this-single-command-keys)),
1332 ;; but actually a prompt other than "M-x" would be confusing,
1333 ;; because "M-x" is a well-known prompt to read a command
1334 ;; and it serves as a shorthand for "Extended command: ".
1335 "M-x ")
1336 obarray 'commandp t nil 'extended-command-history)))
1337
1304 1338
1305(defvar minibuffer-history nil 1339(defvar minibuffer-history nil
1306 "Default minibuffer history list. 1340 "Default minibuffer history list.
@@ -3103,7 +3137,8 @@ If the buffer is read-only, Emacs will beep and refrain from deleting
3103the text, but put the text in the kill ring anyway. This means that 3137the text, but put the text in the kill ring anyway. This means that
3104you can use the killing commands to copy text from a read-only buffer. 3138you can use the killing commands to copy text from a read-only buffer.
3105 3139
3106This is the primitive for programs to kill text (as opposed to deleting it). 3140Lisp programs should use this function for killing text.
3141 (To delete text, use `delete-region'.)
3107Supply two arguments, character positions indicating the stretch of text 3142Supply two arguments, character positions indicating the stretch of text
3108 to be killed. 3143 to be killed.
3109Any command that calls this function is a \"kill command\". 3144Any command that calls this function is a \"kill command\".
@@ -5495,7 +5530,9 @@ it skips the contents of comments that end before point."
5495 (and parse-sexp-ignore-comments 5530 (and parse-sexp-ignore-comments
5496 (not blink-matching-paren-dont-ignore-comments)))) 5531 (not blink-matching-paren-dont-ignore-comments))))
5497 (condition-case () 5532 (condition-case ()
5498 (scan-sexps oldpos -1) 5533 (progn
5534 (forward-sexp -1)
5535 (point))
5499 (error nil)))))) 5536 (error nil))))))
5500 (matching-paren 5537 (matching-paren
5501 (and blinkpos 5538 (and blinkpos