Mercurial > emacs
comparison lisp/simple.el @ 49597:e88404e8f2cf
Trailing whitespace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 12:29:42 +0000 |
parents | 8b39a07c5213 |
children | 48e671543e1e |
comparison
equal
deleted
inserted
replaced
49596:b06535145619 | 49597:e88404e8f2cf |
---|---|
953 ;; you must type some other command. | 953 ;; you must type some other command. |
954 (setq this-command 'undo) | 954 (setq this-command 'undo) |
955 (let ((modified (buffer-modified-p)) | 955 (let ((modified (buffer-modified-p)) |
956 (recent-save (recent-auto-save-p))) | 956 (recent-save (recent-auto-save-p))) |
957 (or (eq (selected-window) (minibuffer-window)) | 957 (or (eq (selected-window) (minibuffer-window)) |
958 (message (if (and transient-mark-mode mark-active) | 958 (message (if (and transient-mark-mode mark-active) |
959 "Undo in region!" | 959 "Undo in region!" |
960 "Undo!"))) | 960 "Undo!"))) |
961 (unless (eq last-command 'undo) | 961 (unless (eq last-command 'undo) |
962 (if (if transient-mark-mode mark-active (and arg (not (numberp arg)))) | 962 (if (if transient-mark-mode mark-active (and arg (not (numberp arg)))) |
963 (undo-start (region-beginning) (region-end)) | 963 (undo-start (region-beginning) (region-end)) |
1002 (defun undo-more (count) | 1002 (defun undo-more (count) |
1003 "Undo back N undo-boundaries beyond what was already undone recently. | 1003 "Undo back N undo-boundaries beyond what was already undone recently. |
1004 Call `undo-start' to get ready to undo recent changes, | 1004 Call `undo-start' to get ready to undo recent changes, |
1005 then call `undo-more' one or more times to undo them." | 1005 then call `undo-more' one or more times to undo them." |
1006 (or pending-undo-list | 1006 (or pending-undo-list |
1007 (error (format "No further undo information%s" | 1007 (error (format "No further undo information%s" |
1008 (if (and transient-mark-mode mark-active) | 1008 (if (and transient-mark-mode mark-active) |
1009 " for region" "")))) | 1009 " for region" "")))) |
1010 (let ((undo-in-progress t)) | 1010 (let ((undo-in-progress t)) |
1011 (setq pending-undo-list (primitive-undo count pending-undo-list)))) | 1011 (setq pending-undo-list (primitive-undo count pending-undo-list)))) |
1012 | 1012 |
1013 ;; Deep copy of a list | 1013 ;; Deep copy of a list |
1526 (list buffer error-file) | 1526 (list buffer error-file) |
1527 buffer) | 1527 buffer) |
1528 nil shell-command-switch command))) | 1528 nil shell-command-switch command))) |
1529 ;; Report the output. | 1529 ;; Report the output. |
1530 (with-current-buffer buffer | 1530 (with-current-buffer buffer |
1531 (setq mode-line-process | 1531 (setq mode-line-process |
1532 (cond ((null exit-status) | 1532 (cond ((null exit-status) |
1533 " - Error") | 1533 " - Error") |
1534 ((stringp exit-status) | 1534 ((stringp exit-status) |
1535 (format " - Signal [%s]" exit-status)) | 1535 (format " - Signal [%s]" exit-status)) |
1536 ((not (equal 0 exit-status)) | 1536 ((not (equal 0 exit-status)) |
1763 If `interprogram-cut-function' is non-nil, apply it to STRING. | 1763 If `interprogram-cut-function' is non-nil, apply it to STRING. |
1764 Optional second argument REPLACE non-nil means that STRING will replace | 1764 Optional second argument REPLACE non-nil means that STRING will replace |
1765 the front of the kill ring, rather than being added to the list. | 1765 the front of the kill ring, rather than being added to the list. |
1766 | 1766 |
1767 Optional third arguments YANK-HANDLER controls how the STRING is later | 1767 Optional third arguments YANK-HANDLER controls how the STRING is later |
1768 inserted into a buffer; see `insert-for-yank' for details. | 1768 inserted into a buffer; see `insert-for-yank' for details. |
1769 When a yank handler is specified, STRING must be non-empty (the yank | 1769 When a yank handler is specified, STRING must be non-empty (the yank |
1770 handler is stored as a `yank-handler'text property on STRING). | 1770 handler is stored as a `yank-handler'text property on STRING). |
1771 | 1771 |
1772 When the yank handler has a non-nil PARAM element, the original STRING | 1772 When the yank handler has a non-nil PARAM element, the original STRING |
1773 argument is not used by `insert-for-yank'. However, since Lisp code | 1773 argument is not used by `insert-for-yank'. However, since Lisp code |
1774 may access and use elements from the kill-ring directly, the STRING | 1774 may access and use elements from the kill-ring directly, the STRING |
1775 argument should still be a \"useful\" string for such uses." | 1775 argument should still be a \"useful\" string for such uses." |
1776 (if (> (length string) 0) | 1776 (if (> (length string) 0) |
1777 (if yank-handler | 1777 (if yank-handler |
1778 (put-text-property 0 1 'yank-handler yank-handler string) | 1778 (put-text-property 0 1 'yank-handler yank-handler string) |
1779 (remove-list-of-text-properties 0 1 '(yank-handler) string)) | 1779 (remove-list-of-text-properties 0 1 '(yank-handler) string)) |
1780 (if yank-handler | 1780 (if yank-handler |
1781 (signal 'args-out-of-range | 1781 (signal 'args-out-of-range |
1782 (list string "yank-handler specified for empty string")))) | 1782 (list string "yank-handler specified for empty string")))) |
1783 (if (fboundp 'menu-bar-update-yank-menu) | 1783 (if (fboundp 'menu-bar-update-yank-menu) |
1784 (menu-bar-update-yank-menu string (and replace (car kill-ring)))) | 1784 (menu-bar-update-yank-menu string (and replace (car kill-ring)))) |
1785 (if (and replace kill-ring) | 1785 (if (and replace kill-ring) |
1786 (setcar kill-ring string) | 1786 (setcar kill-ring string) |
1796 If BEFORE-P is non-nil, prepend STRING to the kill. | 1796 If BEFORE-P is non-nil, prepend STRING to the kill. |
1797 Optional third argument YANK-HANDLER specifies the yank-handler text | 1797 Optional third argument YANK-HANDLER specifies the yank-handler text |
1798 property to be set on the combined kill ring string. If the specified | 1798 property to be set on the combined kill ring string. If the specified |
1799 yank-handler arg differs from the yank-handler property of the latest | 1799 yank-handler arg differs from the yank-handler property of the latest |
1800 kill string, STRING is added as a new kill ring element instead of | 1800 kill string, STRING is added as a new kill ring element instead of |
1801 being appending to the last kill. | 1801 being appending to the last kill. |
1802 If `interprogram-cut-function' is set, pass the resulting kill to it." | 1802 If `interprogram-cut-function' is set, pass the resulting kill to it." |
1803 (let* ((cur (car kill-ring))) | 1803 (let* ((cur (car kill-ring))) |
1804 (kill-new (if before-p (concat string cur) (concat cur string)) | 1804 (kill-new (if before-p (concat string cur) (concat cur string)) |
1805 (or (= (length cur) 0) | 1805 (or (= (length cur) 0) |
1806 (equal yank-handler (get-text-property 0 'yank-handler cur))) | 1806 (equal yank-handler (get-text-property 0 'yank-handler cur))) |
1866 If the previous command was also a kill command, | 1866 If the previous command was also a kill command, |
1867 the text killed this time appends to the text killed last time | 1867 the text killed this time appends to the text killed last time |
1868 to make one entry in the kill ring. | 1868 to make one entry in the kill ring. |
1869 | 1869 |
1870 In Lisp code, optional third arg YANK-HANDLER specifies the yank-handler | 1870 In Lisp code, optional third arg YANK-HANDLER specifies the yank-handler |
1871 text property to be set on the killed text. See `insert-for-yank'." | 1871 text property to be set on the killed text. See `insert-for-yank'." |
1872 (interactive "r") | 1872 (interactive "r") |
1873 (condition-case nil | 1873 (condition-case nil |
1874 (let ((string (delete-and-extract-region beg end))) | 1874 (let ((string (delete-and-extract-region beg end))) |
1875 (when string ;STRING is nil if BEG = END | 1875 (when string ;STRING is nil if BEG = END |
1876 ;; Add that string to the kill ring, one way or another. | 1876 ;; Add that string to the kill ring, one way or another. |
2535 This command works even when the mark is not active, | 2535 This command works even when the mark is not active, |
2536 and it reactivates the mark. | 2536 and it reactivates the mark. |
2537 With prefix arg, `transient-mark-mode' is enabled temporarily." | 2537 With prefix arg, `transient-mark-mode' is enabled temporarily." |
2538 (interactive "P") | 2538 (interactive "P") |
2539 (if arg | 2539 (if arg |
2540 (if mark-active | 2540 (if mark-active |
2541 (if (null transient-mark-mode) | 2541 (if (null transient-mark-mode) |
2542 (setq transient-mark-mode 'lambda)) | 2542 (setq transient-mark-mode 'lambda)) |
2543 (setq arg nil))) | 2543 (setq arg nil))) |
2544 (unless arg | 2544 (unless arg |
2545 (let ((omark (mark t))) | 2545 (let ((omark (mark t))) |
3150 (and prefix (not (equal prefix "")) | 3150 (and prefix (not (equal prefix "")) |
3151 ;; Use auto-indentation rather than a guessed empty prefix. | 3151 ;; Use auto-indentation rather than a guessed empty prefix. |
3152 (not (and fill-indent-according-to-mode | 3152 (not (and fill-indent-according-to-mode |
3153 (string-match "\\`[ \t]*\\'" prefix))) | 3153 (string-match "\\`[ \t]*\\'" prefix))) |
3154 (setq fill-prefix prefix)))) | 3154 (setq fill-prefix prefix)))) |
3155 | 3155 |
3156 (while (and (not give-up) (> (current-column) fc)) | 3156 (while (and (not give-up) (> (current-column) fc)) |
3157 ;; Determine where to split the line. | 3157 ;; Determine where to split the line. |
3158 (let* (after-prefix | 3158 (let* (after-prefix |
3159 (fill-point | 3159 (fill-point |
3160 (let ((opoint (point))) | 3160 (let ((opoint (point))) |
3738 (error "Value `%S' does not match type %S of %S" | 3738 (error "Value `%S' does not match type %S of %S" |
3739 val (car type) var)))) | 3739 val (car type) var)))) |
3740 | 3740 |
3741 (if make-local | 3741 (if make-local |
3742 (make-local-variable var)) | 3742 (make-local-variable var)) |
3743 | 3743 |
3744 (set var val) | 3744 (set var val) |
3745 | 3745 |
3746 ;; Force a thorough redisplay for the case that the variable | 3746 ;; Force a thorough redisplay for the case that the variable |
3747 ;; has an effect on the display, like `tab-width' has. | 3747 ;; has an effect on the display, like `tab-width' has. |
3748 (force-mode-line-update)) | 3748 (force-mode-line-update)) |
3906 (if (and mini-p | 3906 (if (and mini-p |
3907 (or (not (active-minibuffer-window)) | 3907 (or (not (active-minibuffer-window)) |
3908 (not (equal buffer | 3908 (not (equal buffer |
3909 (window-buffer (active-minibuffer-window)))))) | 3909 (window-buffer (active-minibuffer-window)))))) |
3910 (error "Minibuffer is not active for completion") | 3910 (error "Minibuffer is not active for completion") |
3911 (unless (run-hook-with-args-until-success | 3911 (unless (run-hook-with-args-until-success |
3912 'choose-completion-string-functions | 3912 'choose-completion-string-functions |
3913 choice buffer mini-p base-size) | 3913 choice buffer mini-p base-size) |
3914 ;; Insert the completion into the buffer where it was requested. | 3914 ;; Insert the completion into the buffer where it was requested. |
3915 (set-buffer buffer) | 3915 (set-buffer buffer) |
3916 (if base-size | 3916 (if base-size |
4403 ; (when (consp buffer-undo-list) | 4403 ; (when (consp buffer-undo-list) |
4404 ; (setq buffer-undo-list (cddr buffer-undo-list))) | 4404 ; (setq buffer-undo-list (cddr buffer-undo-list))) |
4405 ; (message "You cannot modify the prompt"))) | 4405 ; (message "You cannot modify the prompt"))) |
4406 ; | 4406 ; |
4407 ; | 4407 ; |
4408 ;(setq minibuffer-prompt-properties | 4408 ;(setq minibuffer-prompt-properties |
4409 ; (list 'modification-hooks '(minibuffer-prompt-modification) | 4409 ; (list 'modification-hooks '(minibuffer-prompt-modification) |
4410 ; 'insert-in-front-hooks '(minibuffer-prompt-insertion))) | 4410 ; 'insert-in-front-hooks '(minibuffer-prompt-insertion))) |
4411 ; | 4411 ; |
4412 | 4412 |
4413 (provide 'simple) | 4413 (provide 'simple) |
4414 ;;; simple.el ends here | 4414 ;;; simple.el ends here |