diff options
| author | Joakim Verona | 2013-02-21 00:04:28 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-02-21 00:04:28 +0100 |
| commit | f0f34630a4c8b467df3ec7eb445ceedd93a12a71 (patch) | |
| tree | 8a3b203c6f091c698fcfb3ccd055f330e07e539d /lisp | |
| parent | 10fc3c3866ede374437a72f2e8c1cd7c0f51a8fa (diff) | |
| parent | e11dacb57703fb8044332d8a3933b815547911ec (diff) | |
| download | emacs-f0f34630a4c8b467df3ec7eb445ceedd93a12a71.tar.gz emacs-f0f34630a4c8b467df3ec7eb445ceedd93a12a71.zip | |
auto upstream
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 30 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 8 | ||||
| -rw-r--r-- | lisp/image-mode.el | 31 | ||||
| -rw-r--r-- | lisp/image.el | 10 | ||||
| -rw-r--r-- | lisp/jka-cmpr-hook.el | 10 | ||||
| -rw-r--r-- | lisp/outline.el | 12 | ||||
| -rw-r--r-- | lisp/simple.el | 49 |
9 files changed, 121 insertions, 37 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1e75fcdca8..abcf6578060 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,33 @@ | |||
| 1 | 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * simple.el (command-execute): Move from C. Add obsolete check. | ||
| 4 | (extended-command-history): Move from C. | ||
| 5 | |||
| 6 | 2013-02-20 Ulrich Müller <ulm@gentoo.org> | ||
| 7 | |||
| 8 | * jka-cmpr-hook.el (jka-compr-compression-info-list) | ||
| 9 | (jka-compr-mode-alist-additions): Handle .txz suffix for | ||
| 10 | XZ-compressed tar archives (bug#13770). | ||
| 11 | |||
| 12 | 2013-02-20 Bastien Guerry <bzg@gnu.org> | ||
| 13 | |||
| 14 | * outline.el (outline-regexp, outline-heading-end-regexp): | ||
| 15 | Make variables, not options (bug#13731). | ||
| 16 | |||
| 17 | 2013-02-20 Glenn Morris <rgm@gnu.org> | ||
| 18 | |||
| 19 | * image.el (image-current-frame): Change from variable to function. | ||
| 20 | (image-show-frame): Rename from image-nth-frame. Update callers. | ||
| 21 | * image-mode.el (image-multi-frame): New variable. | ||
| 22 | (image-mode-map, image-mode, image-goto-frame): | ||
| 23 | Use image-multi-frame rather than image-current-frame. | ||
| 24 | (image-mode, image-goto-frame): Use image-current-frame as | ||
| 25 | function rather than as variable. | ||
| 26 | |||
| 27 | * emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. | ||
| 28 | * emacs-lisp/cl-macs.el (cl--make-type-test) | ||
| 29 | (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. | ||
| 30 | |||
| 1 | 2013-02-19 Michael Albinus <michael.albinus@gmx.de> | 31 | 2013-02-19 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 32 | ||
| 3 | * net/tramp-cache.el (tramp-get-hash-table): New defun. | 33 | * net/tramp-cache.el (tramp-get-hash-table): New defun. |
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 2de8260c941..f3bf70b0190 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el | |||
| @@ -271,11 +271,7 @@ so that they are registered at compile-time as well as run-time." | |||
| 271 | 271 | ||
| 272 | ;;; Numbers. | 272 | ;;; Numbers. |
| 273 | 273 | ||
| 274 | (defun cl-floatp-safe (object) | 274 | (define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4") |
| 275 | "Return t if OBJECT is a floating point number. | ||
| 276 | On Emacs versions that lack floating-point support, this function | ||
| 277 | always returns nil." | ||
| 278 | (and (numberp object) (not (integerp object)))) | ||
| 279 | 275 | ||
| 280 | (defsubst cl-plusp (number) | 276 | (defsubst cl-plusp (number) |
| 281 | "Return t if NUMBER is positive." | 277 | "Return t if NUMBER is positive." |
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 89e774f830c..40dea8ddebf 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'. | |||
| 267 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when | 267 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when |
| 268 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp | 268 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp |
| 269 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) | 269 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) |
| 270 | ;;;;;; "cl-macs" "cl-macs.el" "7614365c56c74e8ed9d098d11801605b") | 270 | ;;;;;; "cl-macs" "cl-macs.el" "b36258e378f078d937e71b70b43fb532") |
| 271 | ;;; Generated autoloads from cl-macs.el | 271 | ;;; Generated autoloads from cl-macs.el |
| 272 | 272 | ||
| 273 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ | 273 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 8e1f6da3b23..89d022ecced 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -2520,7 +2520,7 @@ The type name can then be used in `cl-typecase', `cl-check-type', etc." | |||
| 2520 | ((memq type '(nil t)) type) | 2520 | ((memq type '(nil t)) type) |
| 2521 | ((eq type 'null) `(null ,val)) | 2521 | ((eq type 'null) `(null ,val)) |
| 2522 | ((eq type 'atom) `(atom ,val)) | 2522 | ((eq type 'atom) `(atom ,val)) |
| 2523 | ((eq type 'float) `(cl-floatp-safe ,val)) | 2523 | ((eq type 'float) `(floatp ,val)) |
| 2524 | ((eq type 'real) `(numberp ,val)) | 2524 | ((eq type 'real) `(numberp ,val)) |
| 2525 | ((eq type 'fixnum) `(integerp ,val)) | 2525 | ((eq type 'fixnum) `(integerp ,val)) |
| 2526 | ;; FIXME: Should `character' accept things like ?\C-\M-a ? --Stef | 2526 | ;; FIXME: Should `character' accept things like ?\C-\M-a ? --Stef |
| @@ -2739,7 +2739,7 @@ surrounded by (cl-block NAME ...). | |||
| 2739 | (cond ((eq test 'eq) `(assq ,a ,list)) | 2739 | (cond ((eq test 'eq) `(assq ,a ,list)) |
| 2740 | ((eq test 'equal) `(assoc ,a ,list)) | 2740 | ((eq test 'equal) `(assoc ,a ,list)) |
| 2741 | ((and (macroexp-const-p a) (or (null keys) (eq test 'eql))) | 2741 | ((and (macroexp-const-p a) (or (null keys) (eq test 'eql))) |
| 2742 | (if (cl-floatp-safe (cl--const-expr-val a)) | 2742 | (if (floatp (cl--const-expr-val a)) |
| 2743 | `(assoc ,a ,list) `(assq ,a ,list))) | 2743 | `(assoc ,a ,list) `(assq ,a ,list))) |
| 2744 | (t form)))) | 2744 | (t form)))) |
| 2745 | 2745 | ||
| @@ -2776,7 +2776,7 @@ surrounded by (cl-block NAME ...). | |||
| 2776 | (put y 'side-effect-free t)) | 2776 | (put y 'side-effect-free t)) |
| 2777 | 2777 | ||
| 2778 | ;;; Things that are inline. | 2778 | ;;; Things that are inline. |
| 2779 | (cl-proclaim '(inline cl-floatp-safe cl-acons cl-map cl-concatenate cl-notany | 2779 | (cl-proclaim '(inline cl-acons cl-map cl-concatenate cl-notany |
| 2780 | cl-notevery cl--set-elt cl-revappend cl-nreconc gethash)) | 2780 | cl-notevery cl--set-elt cl-revappend cl-nreconc gethash)) |
| 2781 | 2781 | ||
| 2782 | ;;; Things that are side-effect-free. | 2782 | ;;; Things that are side-effect-free. |
| @@ -2787,7 +2787,7 @@ surrounded by (cl-block NAME ...). | |||
| 2787 | 2787 | ||
| 2788 | ;;; Things that are side-effect-and-error-free. | 2788 | ;;; Things that are side-effect-and-error-free. |
| 2789 | (mapc (lambda (x) (put x 'side-effect-free 'error-free)) | 2789 | (mapc (lambda (x) (put x 'side-effect-free 'error-free)) |
| 2790 | '(eql cl-floatp-safe cl-list* cl-subst cl-acons cl-equalp | 2790 | '(eql cl-list* cl-subst cl-acons cl-equalp |
| 2791 | cl-random-state-p copy-tree cl-sublis)) | 2791 | cl-random-state-p copy-tree cl-sublis)) |
| 2792 | 2792 | ||
| 2793 | 2793 | ||
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 7787a26cc08..6ae1bb20cdc 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -329,6 +329,9 @@ call." | |||
| 329 | "The image type for the current Image mode buffer.") | 329 | "The image type for the current Image mode buffer.") |
| 330 | (make-variable-buffer-local 'image-type) | 330 | (make-variable-buffer-local 'image-type) |
| 331 | 331 | ||
| 332 | (defvar-local image-multi-frame nil | ||
| 333 | "Non-nil if image for the current Image mode buffer has multiple frames.") | ||
| 334 | |||
| 332 | (defvar image-mode-previous-major-mode nil | 335 | (defvar image-mode-previous-major-mode nil |
| 333 | "Internal variable to keep the previous non-image major mode.") | 336 | "Internal variable to keep the previous non-image major mode.") |
| 334 | 337 | ||
| @@ -390,7 +393,7 @@ call." | |||
| 390 | ["Animate Image" image-toggle-animation :style toggle | 393 | ["Animate Image" image-toggle-animation :style toggle |
| 391 | :selected (let ((image (image-get-display-property))) | 394 | :selected (let ((image (image-get-display-property))) |
| 392 | (and image (image-animate-timer image))) | 395 | (and image (image-animate-timer image))) |
| 393 | :active image-current-frame | 396 | :active image-multi-frame |
| 394 | :help "Toggle image animation"] | 397 | :help "Toggle image animation"] |
| 395 | ["Loop Animation" | 398 | ["Loop Animation" |
| 396 | (lambda () (interactive) | 399 | (lambda () (interactive) |
| @@ -403,13 +406,13 @@ call." | |||
| 403 | (image-toggle-animation) | 406 | (image-toggle-animation) |
| 404 | (image-toggle-animation))) | 407 | (image-toggle-animation))) |
| 405 | :style toggle :selected image-animate-loop | 408 | :style toggle :selected image-animate-loop |
| 406 | :active image-current-frame | 409 | :active image-multi-frame |
| 407 | :help "Animate images once, or forever?"] | 410 | :help "Animate images once, or forever?"] |
| 408 | ["Next Frame" image-next-frame :active image-current-frame | 411 | ["Next Frame" image-next-frame :active image-multi-frame |
| 409 | :help "Show the next frame of this image"] | 412 | :help "Show the next frame of this image"] |
| 410 | ["Previous Frame" image-previous-frame :active image-current-frame | 413 | ["Previous Frame" image-previous-frame :active image-multi-frame |
| 411 | :help "Show the previous frame of this image"] | 414 | :help "Show the previous frame of this image"] |
| 412 | ["Goto Frame..." image-goto-frame :active image-current-frame | 415 | ["Goto Frame..." image-goto-frame :active image-multi-frame |
| 413 | :help "Show a specific frame of this image"] | 416 | :help "Show a specific frame of this image"] |
| 414 | )) | 417 | )) |
| 415 | map) | 418 | map) |
| @@ -471,12 +474,13 @@ to toggle between display as an image and display as text." | |||
| 471 | ((null image) | 474 | ((null image) |
| 472 | (message "%s" (concat msg1 "an image."))) | 475 | (message "%s" (concat msg1 "an image."))) |
| 473 | ((setq animated (image-multi-frame-p image)) | 476 | ((setq animated (image-multi-frame-p image)) |
| 474 | (setq image-current-frame (or (plist-get (cdr image) :index) 0) | 477 | (setq image-multi-frame t |
| 475 | mode-line-process | 478 | mode-line-process |
| 476 | `(:eval (propertize (format " [%s/%s]" | 479 | `(:eval (propertize |
| 477 | (1+ image-current-frame) | 480 | (format " [%s/%s]" |
| 478 | ,(car animated)) | 481 | (1+ (image-current-frame ',image)) |
| 479 | 'help-echo "Frame number"))) | 482 | ,(car animated)) |
| 483 | 'help-echo "Frame number"))) | ||
| 480 | (message "%s" | 484 | (message "%s" |
| 481 | (concat msg1 "text. This image has multiple frames."))) | 485 | (concat msg1 "text. This image has multiple frames."))) |
| 482 | ;;; (substitute-command-keys | 486 | ;;; (substitute-command-keys |
| @@ -694,10 +698,13 @@ current frame. Frames are indexed from 1." | |||
| 694 | (cond | 698 | (cond |
| 695 | ((null image) | 699 | ((null image) |
| 696 | (error "No image is present")) | 700 | (error "No image is present")) |
| 697 | ((null image-current-frame) | 701 | ((null image-multi-frame) |
| 698 | (message "No image animation.")) | 702 | (message "No image animation.")) |
| 699 | (t | 703 | (t |
| 700 | (image-nth-frame image (if relative (+ n image-current-frame) (1- n))))))) | 704 | (image-show-frame image |
| 705 | (if relative | ||
| 706 | (+ n (image-current-frame image)) | ||
| 707 | (1- n))))))) | ||
| 701 | 708 | ||
| 702 | (defun image-next-frame (&optional n) | 709 | (defun image-next-frame (&optional n) |
| 703 | "Switch to the next frame of a multi-frame image. | 710 | "Switch to the next frame of a multi-frame image. |
diff --git a/lisp/image.el b/lisp/image.el index b91d136443d..ec7b41bf126 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -660,10 +660,11 @@ number, play until that number of seconds has elapsed." | |||
| 660 | (defconst image-minimum-frame-delay 0.01 | 660 | (defconst image-minimum-frame-delay 0.01 |
| 661 | "Minimum interval in seconds between frames of an animated image.") | 661 | "Minimum interval in seconds between frames of an animated image.") |
| 662 | 662 | ||
| 663 | (defvar-local image-current-frame nil | 663 | (defun image-current-frame (image) |
| 664 | "The frame index of the current animated image.") | 664 | "The current frame number of IMAGE, indexed from 0." |
| 665 | (or (plist-get (cdr image) :index) 0)) | ||
| 665 | 666 | ||
| 666 | (defun image-nth-frame (image n &optional nocheck) | 667 | (defun image-show-frame (image n &optional nocheck) |
| 667 | "Show frame N of IMAGE. | 668 | "Show frame N of IMAGE. |
| 668 | Frames are indexed from 0. Optional argument NOCHECK non-nil means | 669 | Frames are indexed from 0. Optional argument NOCHECK non-nil means |
| 669 | do not check N is within the range of frames present in the image." | 670 | do not check N is within the range of frames present in the image." |
| @@ -671,7 +672,6 @@ do not check N is within the range of frames present in the image." | |||
| 671 | (if (< n 0) (setq n 0) | 672 | (if (< n 0) (setq n 0) |
| 672 | (setq n (min n (1- (car (image-multi-frame-p image))))))) | 673 | (setq n (min n (1- (car (image-multi-frame-p image))))))) |
| 673 | (plist-put (cdr image) :index n) | 674 | (plist-put (cdr image) :index n) |
| 674 | (setq image-current-frame n) | ||
| 675 | (force-window-update)) | 675 | (force-window-update)) |
| 676 | 676 | ||
| 677 | ;; FIXME? The delay may not be the same for different sub-images, | 677 | ;; FIXME? The delay may not be the same for different sub-images, |
| @@ -688,7 +688,7 @@ LIMIT determines when to stop. If t, loop forever. If nil, stop | |||
| 688 | after displaying the last animation frame. Otherwise, stop | 688 | after displaying the last animation frame. Otherwise, stop |
| 689 | after LIMIT seconds have elapsed. | 689 | after LIMIT seconds have elapsed. |
| 690 | The minimum delay between successive frames is `image-minimum-frame-delay'." | 690 | The minimum delay between successive frames is `image-minimum-frame-delay'." |
| 691 | (image-nth-frame image n t) | 691 | (image-show-frame image n t) |
| 692 | (setq n (1+ n)) | 692 | (setq n (1+ n)) |
| 693 | (let* ((time (float-time)) | 693 | (let* ((time (float-time)) |
| 694 | (animation (image-multi-frame-p image)) | 694 | (animation (image-multi-frame-p image)) |
diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el index 7b36f7c1214..851bceccf30 100644 --- a/lisp/jka-cmpr-hook.el +++ b/lisp/jka-cmpr-hook.el | |||
| @@ -234,6 +234,10 @@ options through Custom does this automatically." | |||
| 234 | "XZ compressing" "xz" ("-c" "-q") | 234 | "XZ compressing" "xz" ("-c" "-q") |
| 235 | "XZ uncompressing" "xz" ("-c" "-q" "-d") | 235 | "XZ uncompressing" "xz" ("-c" "-q" "-d") |
| 236 | t t "\3757zXZ\0"] | 236 | t t "\3757zXZ\0"] |
| 237 | ["\\.txz\\'" | ||
| 238 | "XZ compressing" "xz" ("-c" "-q") | ||
| 239 | "XZ uncompressing" "xz" ("-c" "-q" "-d") | ||
| 240 | t nil "\3757zXZ\0"] | ||
| 237 | ;; dzip is gzip with random access. Its compression program can't | 241 | ;; dzip is gzip with random access. Its compression program can't |
| 238 | ;; read/write stdin/out, so .dz files can only be viewed without | 242 | ;; read/write stdin/out, so .dz files can only be viewed without |
| 239 | ;; saving, having their contents decompressed with gzip. | 243 | ;; saving, having their contents decompressed with gzip. |
| @@ -302,7 +306,9 @@ variables. Setting this through Custom does that automatically." | |||
| 302 | :group 'jka-compr) | 306 | :group 'jka-compr) |
| 303 | 307 | ||
| 304 | (defcustom jka-compr-mode-alist-additions | 308 | (defcustom jka-compr-mode-alist-additions |
| 305 | (list (cons (purecopy "\\.tgz\\'") 'tar-mode) (cons (purecopy "\\.tbz2?\\'") 'tar-mode)) | 309 | (purecopy '(("\\.tgz\\'" . tar-mode) |
| 310 | ("\\.tbz2?\\'" . tar-mode) | ||
| 311 | ("\\.txz\\'" . 'tar-mode))) | ||
| 306 | "List of pairs added to `auto-mode-alist' when installing jka-compr. | 312 | "List of pairs added to `auto-mode-alist' when installing jka-compr. |
| 307 | Uninstalling jka-compr removes all pairs from `auto-mode-alist' that | 313 | Uninstalling jka-compr removes all pairs from `auto-mode-alist' that |
| 308 | installing added. | 314 | installing added. |
| @@ -315,7 +321,7 @@ variables. Setting this through Custom does that automatically." | |||
| 315 | :set 'jka-compr-set | 321 | :set 'jka-compr-set |
| 316 | :group 'jka-compr) | 322 | :group 'jka-compr) |
| 317 | 323 | ||
| 318 | (defcustom jka-compr-load-suffixes (list (purecopy ".gz")) | 324 | (defcustom jka-compr-load-suffixes (purecopy '(".gz")) |
| 319 | "List of compression related suffixes to try when loading files. | 325 | "List of compression related suffixes to try when loading files. |
| 320 | Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', | 326 | Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', |
| 321 | which see. Disabling Auto Compression mode removes all suffixes | 327 | which see. Disabling Auto Compression mode removes all suffixes |
diff --git a/lisp/outline.el b/lisp/outline.el index 24f25fd2fb7..0ec5227a286 100644 --- a/lisp/outline.el +++ b/lisp/outline.el | |||
| @@ -43,25 +43,21 @@ | |||
| 43 | :prefix "outline-" | 43 | :prefix "outline-" |
| 44 | :group 'wp) | 44 | :group 'wp) |
| 45 | 45 | ||
| 46 | (defcustom outline-regexp "[*\^L]+" | 46 | (defvar outline-regexp "[*\^L]+" |
| 47 | "Regular expression to match the beginning of a heading. | 47 | "Regular expression to match the beginning of a heading. |
| 48 | Any line whose beginning matches this regexp is considered to start a heading. | 48 | Any line whose beginning matches this regexp is considered to start a heading. |
| 49 | Note that Outline mode only checks this regexp at the start of a line, | 49 | Note that Outline mode only checks this regexp at the start of a line, |
| 50 | so the regexp need not (and usually does not) start with `^'. | 50 | so the regexp need not (and usually does not) start with `^'. |
| 51 | The recommended way to set this is with a Local Variables: list | 51 | The recommended way to set this is with a Local Variables: list |
| 52 | in the file it applies to. See also `outline-heading-end-regexp'." | 52 | in the file it applies to. See also `outline-heading-end-regexp'.") |
| 53 | :type 'regexp | ||
| 54 | :group 'outlines) | ||
| 55 | ;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp) | 53 | ;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp) |
| 56 | 54 | ||
| 57 | (defcustom outline-heading-end-regexp "\n" | 55 | (defvar outline-heading-end-regexp "\n" |
| 58 | "Regular expression to match the end of a heading line. | 56 | "Regular expression to match the end of a heading line. |
| 59 | You can assume that point is at the beginning of a heading when this | 57 | You can assume that point is at the beginning of a heading when this |
| 60 | regexp is searched for. The heading ends at the end of the match. | 58 | regexp is searched for. The heading ends at the end of the match. |
| 61 | The recommended way to set this is with a `Local Variables:' list | 59 | The recommended way to set this is with a `Local Variables:' list |
| 62 | in the file it applies to." | 60 | in the file it applies to.") |
| 63 | :type 'regexp | ||
| 64 | :group 'outlines) | ||
| 65 | ;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp) | 61 | ;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp) |
| 66 | 62 | ||
| 67 | (defvar outline-mode-prefix-map | 63 | (defvar outline-mode-prefix-map |
diff --git a/lisp/simple.el b/lisp/simple.el index 138c2420309..3ef700a6058 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1400,6 +1400,8 @@ to get different commands to edit and resubmit." | |||
| 1400 | (error "Argument %d is beyond length of command history" arg) | 1400 | (error "Argument %d is beyond length of command history" arg) |
| 1401 | (error "There are no previous complex commands to repeat"))))) | 1401 | (error "There are no previous complex commands to repeat"))))) |
| 1402 | 1402 | ||
| 1403 | (defvar extended-command-history nil) | ||
| 1404 | |||
| 1403 | (defun read-extended-command () | 1405 | (defun read-extended-command () |
| 1404 | "Read command name to invoke in `execute-extended-command'." | 1406 | "Read command name to invoke in `execute-extended-command'." |
| 1405 | (minibuffer-with-setup-hook | 1407 | (minibuffer-with-setup-hook |
| @@ -1489,6 +1491,53 @@ give to the command you invoke, if it asks for an argument." | |||
| 1489 | (sit-for (if (numberp suggest-key-bindings) | 1491 | (sit-for (if (numberp suggest-key-bindings) |
| 1490 | suggest-key-bindings | 1492 | suggest-key-bindings |
| 1491 | 2)))))))) | 1493 | 2)))))))) |
| 1494 | |||
| 1495 | (defun command-execute (cmd &optional record-flag keys special) | ||
| 1496 | ;; BEWARE: Called directly from the C code. | ||
| 1497 | "Execute CMD as an editor command. | ||
| 1498 | CMD must be a symbol that satisfies the `commandp' predicate. | ||
| 1499 | Optional second arg RECORD-FLAG non-nil | ||
| 1500 | means unconditionally put this command in the variable `command-history'. | ||
| 1501 | Otherwise, that is done only if an arg is read using the minibuffer. | ||
| 1502 | The argument KEYS specifies the value to use instead of (this-command-keys) | ||
| 1503 | when reading the arguments; if it is nil, (this-command-keys) is used. | ||
| 1504 | The argument SPECIAL, if non-nil, means that this command is executing | ||
| 1505 | a special event, so ignore the prefix argument and don't clear it." | ||
| 1506 | (setq debug-on-next-call nil) | ||
| 1507 | (let ((prefixarg (unless special | ||
| 1508 | (prog1 prefix-arg | ||
| 1509 | (setq current-prefix-arg prefix-arg) | ||
| 1510 | (setq prefix-arg nil))))) | ||
| 1511 | (and (symbolp cmd) | ||
| 1512 | (get cmd 'disabled) | ||
| 1513 | ;; FIXME: Weird calling convention! | ||
| 1514 | (run-hooks 'disabled-command-function)) | ||
| 1515 | (let ((final cmd)) | ||
| 1516 | (while | ||
| 1517 | (progn | ||
| 1518 | (setq final (indirect-function final)) | ||
| 1519 | (if (autoloadp final) | ||
| 1520 | (setq final (autoload-do-load final cmd))))) | ||
| 1521 | (cond | ||
| 1522 | ((arrayp final) | ||
| 1523 | ;; If requested, place the macro in the command history. For | ||
| 1524 | ;; other sorts of commands, call-interactively takes care of this. | ||
| 1525 | (when record-flag | ||
| 1526 | (push `(execute-kbd-macro ,final ,prefixarg) command-history) | ||
| 1527 | ;; Don't keep command history around forever. | ||
| 1528 | (when (and (numberp history-length) (> history-length 0)) | ||
| 1529 | (let ((cell (nthcdr history-length command-history))) | ||
| 1530 | (if (consp cell) (setcdr cell nil))))) | ||
| 1531 | (execute-kbd-macro final prefixarg)) | ||
| 1532 | (t | ||
| 1533 | ;; Pass `cmd' rather than `final', for the backtrace's sake. | ||
| 1534 | (prog1 (call-interactively cmd record-flag keys) | ||
| 1535 | (when (and (symbolp cmd) | ||
| 1536 | (get cmd 'byte-obsolete-info) | ||
| 1537 | (not (get cmd 'command-execute-obsolete-warned))) | ||
| 1538 | (put cmd 'command-execute-obsolete-warned t) | ||
| 1539 | (message "%s" (macroexp--obsolete-warning | ||
| 1540 | cmd (get cmd 'byte-obsolete-info) "command"))))))))) | ||
| 1492 | 1541 | ||
| 1493 | (defvar minibuffer-history nil | 1542 | (defvar minibuffer-history nil |
| 1494 | "Default minibuffer history list. | 1543 | "Default minibuffer history list. |