diff options
| author | Sam Steingold | 2011-02-02 12:59:44 -0500 |
|---|---|---|
| committer | Sam Steingold | 2011-02-02 12:59:44 -0500 |
| commit | e90f854587c8731d7c487723e4cc3a75b4e58f7a (patch) | |
| tree | a8e0cd656a2e038c2182a684f529d76bf56da79b | |
| parent | a2ff2fc09dd3a129aa093a9beb9e35777d7201d1 (diff) | |
| download | emacs-e90f854587c8731d7c487723e4cc3a75b4e58f7a.tar.gz emacs-e90f854587c8731d7c487723e4cc3a75b4e58f7a.zip | |
* lisp/apropos.el (apropos-print): Now that `apropos-mode' inherits
from `special-mode', entering it makes the buffer read-only, so
call it only when everything has been already inserted.
* lisp/emacs-lisp/ert.el (ert--setup-results-buffer)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-timings): Ditto.
* lisp/emacs-lisp/package.el (package--list-packages): Ditto.
* lisp/play/solitaire.el (solitaire): Ditto.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/apropos.el | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 27 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 4 | ||||
| -rw-r--r-- | lisp/play/solitaire.el | 3 |
5 files changed, 27 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index feb5daeca3b..8b7d36b8387 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2011-02-02 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * apropos.el (apropos-print): Now that `apropos-mode' inherits | ||
| 4 | from `special-mode', entering it makes the buffer read-only, so | ||
| 5 | call it only when everything has been already inserted. | ||
| 6 | * emacs-lisp/ert.el (ert--setup-results-buffer) | ||
| 7 | (ert-results-pop-to-backtrace-for-test-at-point) | ||
| 8 | (ert-results-pop-to-messages-for-test-at-point) | ||
| 9 | (ert-results-pop-to-timings): Ditto. | ||
| 10 | * emacs-lisp/package.el (package--list-packages): Ditto. | ||
| 11 | * play/solitaire.el (solitaire): Ditto. | ||
| 12 | |||
| 1 | 2011-02-02 Chong Yidong <cyd@stupidchicken.com> | 13 | 2011-02-02 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 14 | ||
| 3 | * progmodes/compile.el: Make all faces inherit. | 15 | * progmodes/compile.el: Make all faces inherit. |
diff --git a/lisp/apropos.el b/lisp/apropos.el index ac7d3d4085e..70ce860e1d7 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -974,7 +974,6 @@ If non-nil TEXT is a string that will be printed as a heading." | |||
| 974 | (old-buffer (current-buffer)) | 974 | (old-buffer (current-buffer)) |
| 975 | symbol item) | 975 | symbol item) |
| 976 | (set-buffer standard-output) | 976 | (set-buffer standard-output) |
| 977 | (apropos-mode) | ||
| 978 | (if (display-mouse-p) | 977 | (if (display-mouse-p) |
| 979 | (insert | 978 | (insert |
| 980 | "If moving the mouse over text changes the text's color, " | 979 | "If moving the mouse over text changes the text's color, " |
| @@ -1066,7 +1065,7 @@ If non-nil TEXT is a string that will be printed as a heading." | |||
| 1066 | (apropos-print-doc 4 'apropos-plist nil)) | 1065 | (apropos-print-doc 4 'apropos-plist nil)) |
| 1067 | (set (make-local-variable 'truncate-partial-width-windows) t) | 1066 | (set (make-local-variable 'truncate-partial-width-windows) t) |
| 1068 | (set (make-local-variable 'truncate-lines) t) | 1067 | (set (make-local-variable 'truncate-lines) t) |
| 1069 | (setq buffer-read-only t)))) | 1068 | (apropos-mode)))) |
| 1070 | (prog1 apropos-accumulator | 1069 | (prog1 apropos-accumulator |
| 1071 | (setq apropos-accumulator ()))) ; permit gc | 1070 | (setq apropos-accumulator ()))) ; permit gc |
| 1072 | 1071 | ||
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index fad8f822337..695dc1e2db6 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -1874,11 +1874,9 @@ BUFFER-NAME, if non-nil, is the buffer name to use." | |||
| 1874 | (unless buffer-name (setq buffer-name "*ert*")) | 1874 | (unless buffer-name (setq buffer-name "*ert*")) |
| 1875 | (let ((buffer (get-buffer-create buffer-name))) | 1875 | (let ((buffer (get-buffer-create buffer-name))) |
| 1876 | (with-current-buffer buffer | 1876 | (with-current-buffer buffer |
| 1877 | (setq buffer-read-only t) | ||
| 1878 | (let ((inhibit-read-only t)) | 1877 | (let ((inhibit-read-only t)) |
| 1879 | (buffer-disable-undo) | 1878 | (buffer-disable-undo) |
| 1880 | (erase-buffer) | 1879 | (erase-buffer) |
| 1881 | (ert-results-mode) | ||
| 1882 | ;; Erase buffer again in case switching out of the previous | 1880 | ;; Erase buffer again in case switching out of the previous |
| 1883 | ;; mode inserted anything. (This happens e.g. when switching | 1881 | ;; mode inserted anything. (This happens e.g. when switching |
| 1884 | ;; from ert-results-mode to ert-results-mode when | 1882 | ;; from ert-results-mode to ert-results-mode when |
| @@ -1897,8 +1895,9 @@ BUFFER-NAME, if non-nil, is the buffer name to use." | |||
| 1897 | (ewoc-enter-last ewoc | 1895 | (ewoc-enter-last ewoc |
| 1898 | (make-ert--ewoc-entry :test test :hidden-p t))) | 1896 | (make-ert--ewoc-entry :test test :hidden-p t))) |
| 1899 | (ert--results-update-ewoc-hf ert--results-ewoc ert--results-stats) | 1897 | (ert--results-update-ewoc-hf ert--results-ewoc ert--results-stats) |
| 1900 | (goto-char (1- (point-max))) | 1898 | (goto-char (1- (point-max))))) |
| 1901 | buffer))))) | 1899 | (ert-results-mode) |
| 1900 | buffer))) | ||
| 1902 | 1901 | ||
| 1903 | 1902 | ||
| 1904 | (defvar ert--selector-history nil | 1903 | (defvar ert--selector-history nil |
| @@ -2341,11 +2340,9 @@ To be used in the ERT results buffer." | |||
| 2341 | (let ((backtrace (ert-test-result-with-condition-backtrace result)) | 2340 | (let ((backtrace (ert-test-result-with-condition-backtrace result)) |
| 2342 | (buffer (get-buffer-create "*ERT Backtrace*"))) | 2341 | (buffer (get-buffer-create "*ERT Backtrace*"))) |
| 2343 | (pop-to-buffer buffer) | 2342 | (pop-to-buffer buffer) |
| 2344 | (setq buffer-read-only t) | ||
| 2345 | (let ((inhibit-read-only t)) | 2343 | (let ((inhibit-read-only t)) |
| 2346 | (buffer-disable-undo) | 2344 | (buffer-disable-undo) |
| 2347 | (erase-buffer) | 2345 | (erase-buffer) |
| 2348 | (ert-simple-view-mode) | ||
| 2349 | ;; Use unibyte because `debugger-setup-buffer' also does so. | 2346 | ;; Use unibyte because `debugger-setup-buffer' also does so. |
| 2350 | (set-buffer-multibyte nil) | 2347 | (set-buffer-multibyte nil) |
| 2351 | (setq truncate-lines t) | 2348 | (setq truncate-lines t) |
| @@ -2354,7 +2351,8 @@ To be used in the ERT results buffer." | |||
| 2354 | (goto-char (point-min)) | 2351 | (goto-char (point-min)) |
| 2355 | (insert "Backtrace for test `") | 2352 | (insert "Backtrace for test `") |
| 2356 | (ert-insert-test-name-button (ert-test-name test)) | 2353 | (ert-insert-test-name-button (ert-test-name test)) |
| 2357 | (insert "':\n"))))))) | 2354 | (insert "':\n") |
| 2355 | (ert-simple-view-mode))))))) | ||
| 2358 | 2356 | ||
| 2359 | (defun ert-results-pop-to-messages-for-test-at-point () | 2357 | (defun ert-results-pop-to-messages-for-test-at-point () |
| 2360 | "Display the part of the *Messages* buffer generated during the test at point. | 2358 | "Display the part of the *Messages* buffer generated during the test at point. |
| @@ -2367,16 +2365,15 @@ To be used in the ERT results buffer." | |||
| 2367 | (result (aref (ert--stats-test-results stats) pos))) | 2365 | (result (aref (ert--stats-test-results stats) pos))) |
| 2368 | (let ((buffer (get-buffer-create "*ERT Messages*"))) | 2366 | (let ((buffer (get-buffer-create "*ERT Messages*"))) |
| 2369 | (pop-to-buffer buffer) | 2367 | (pop-to-buffer buffer) |
| 2370 | (setq buffer-read-only t) | ||
| 2371 | (let ((inhibit-read-only t)) | 2368 | (let ((inhibit-read-only t)) |
| 2372 | (buffer-disable-undo) | 2369 | (buffer-disable-undo) |
| 2373 | (erase-buffer) | 2370 | (erase-buffer) |
| 2374 | (ert-simple-view-mode) | ||
| 2375 | (insert (ert-test-result-messages result)) | 2371 | (insert (ert-test-result-messages result)) |
| 2376 | (goto-char (point-min)) | 2372 | (goto-char (point-min)) |
| 2377 | (insert "Messages for test `") | 2373 | (insert "Messages for test `") |
| 2378 | (ert-insert-test-name-button (ert-test-name test)) | 2374 | (ert-insert-test-name-button (ert-test-name test)) |
| 2379 | (insert "':\n"))))) | 2375 | (insert "':\n") |
| 2376 | (ert-simple-view-mode))))) | ||
| 2380 | 2377 | ||
| 2381 | (defun ert-results-pop-to-should-forms-for-test-at-point () | 2378 | (defun ert-results-pop-to-should-forms-for-test-at-point () |
| 2382 | "Display the list of `should' forms executed during the test at point. | 2379 | "Display the list of `should' forms executed during the test at point. |
| @@ -2389,11 +2386,9 @@ To be used in the ERT results buffer." | |||
| 2389 | (result (aref (ert--stats-test-results stats) pos))) | 2386 | (result (aref (ert--stats-test-results stats) pos))) |
| 2390 | (let ((buffer (get-buffer-create "*ERT list of should forms*"))) | 2387 | (let ((buffer (get-buffer-create "*ERT list of should forms*"))) |
| 2391 | (pop-to-buffer buffer) | 2388 | (pop-to-buffer buffer) |
| 2392 | (setq buffer-read-only t) | ||
| 2393 | (let ((inhibit-read-only t)) | 2389 | (let ((inhibit-read-only t)) |
| 2394 | (buffer-disable-undo) | 2390 | (buffer-disable-undo) |
| 2395 | (erase-buffer) | 2391 | (erase-buffer) |
| 2396 | (ert-simple-view-mode) | ||
| 2397 | (if (null (ert-test-result-should-forms result)) | 2392 | (if (null (ert-test-result-should-forms result)) |
| 2398 | (insert "\n(No should forms during this test.)\n") | 2393 | (insert "\n(No should forms during this test.)\n") |
| 2399 | (loop for form-description in (ert-test-result-should-forms result) | 2394 | (loop for form-description in (ert-test-result-should-forms result) |
| @@ -2411,7 +2406,8 @@ To be used in the ERT results buffer." | |||
| 2411 | (insert (concat "(Values are shallow copies and may have " | 2406 | (insert (concat "(Values are shallow copies and may have " |
| 2412 | "looked different during the test if they\n" | 2407 | "looked different during the test if they\n" |
| 2413 | "have been modified destructively.)\n")) | 2408 | "have been modified destructively.)\n")) |
| 2414 | (forward-line 1))))) | 2409 | (forward-line 1) |
| 2410 | (ert-simple-view-mode))))) | ||
| 2415 | 2411 | ||
| 2416 | (defun ert-results-toggle-printer-limits-for-test-at-point () | 2412 | (defun ert-results-toggle-printer-limits-for-test-at-point () |
| 2417 | "Toggle how much of the condition to print for the test at point. | 2413 | "Toggle how much of the condition to print for the test at point. |
| @@ -2443,11 +2439,9 @@ To be used in the ERT results buffer." | |||
| 2443 | (setq data (sort data (lambda (a b) | 2439 | (setq data (sort data (lambda (a b) |
| 2444 | (> (second a) (second b))))) | 2440 | (> (second a) (second b))))) |
| 2445 | (pop-to-buffer buffer) | 2441 | (pop-to-buffer buffer) |
| 2446 | (setq buffer-read-only t) | ||
| 2447 | (let ((inhibit-read-only t)) | 2442 | (let ((inhibit-read-only t)) |
| 2448 | (buffer-disable-undo) | 2443 | (buffer-disable-undo) |
| 2449 | (erase-buffer) | 2444 | (erase-buffer) |
| 2450 | (ert-simple-view-mode) | ||
| 2451 | (if (null data) | 2445 | (if (null data) |
| 2452 | (insert "(No data)\n") | 2446 | (insert "(No data)\n") |
| 2453 | (insert (format "%-3s %8s %8s\n" "" "time" "cumul")) | 2447 | (insert (format "%-3s %8s %8s\n" "" "time" "cumul")) |
| @@ -2460,7 +2454,8 @@ To be used in the ERT results buffer." | |||
| 2460 | (insert "\n")))) | 2454 | (insert "\n")))) |
| 2461 | (goto-char (point-min)) | 2455 | (goto-char (point-min)) |
| 2462 | (insert "Tests by run time (seconds):\n\n") | 2456 | (insert "Tests by run time (seconds):\n\n") |
| 2463 | (forward-line 1)))) | 2457 | (forward-line 1) |
| 2458 | (ert-simple-view-mode)))) | ||
| 2464 | 2459 | ||
| 2465 | ;;;###autoload | 2460 | ;;;###autoload |
| 2466 | (defun ert-describe-test (test-or-test-name) | 2461 | (defun ert-describe-test (test-or-test-name) |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c581e586b98..af97bb1bd21 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -1658,10 +1658,10 @@ list; the default is to display everything in `package-alist'." | |||
| 1658 | (require 'finder-inf nil t) | 1658 | (require 'finder-inf nil t) |
| 1659 | (let ((buf (get-buffer-create "*Packages*"))) | 1659 | (let ((buf (get-buffer-create "*Packages*"))) |
| 1660 | (with-current-buffer buf | 1660 | (with-current-buffer buf |
| 1661 | (package-menu-mode) | ||
| 1662 | (set (make-local-variable 'package-menu-package-list) packages) | 1661 | (set (make-local-variable 'package-menu-package-list) packages) |
| 1663 | (set (make-local-variable 'package-menu-sort-key) nil) | 1662 | (set (make-local-variable 'package-menu-sort-key) nil) |
| 1664 | (package--generate-package-list)) | 1663 | (package--generate-package-list) |
| 1664 | (package-menu-mode)) | ||
| 1665 | ;; The package menu buffer has keybindings. If the user types | 1665 | ;; The package menu buffer has keybindings. If the user types |
| 1666 | ;; `M-x list-packages', that suggests it should become current. | 1666 | ;; `M-x list-packages', that suggests it should become current. |
| 1667 | (switch-to-buffer buf))) | 1667 | (switch-to-buffer buf))) |
diff --git a/lisp/play/solitaire.el b/lisp/play/solitaire.el index a9cb6c32e7d..3e6e941473f 100644 --- a/lisp/play/solitaire.el +++ b/lisp/play/solitaire.el | |||
| @@ -188,7 +188,6 @@ Pick your favourite shortcuts: | |||
| 188 | 188 | ||
| 189 | (interactive "P") | 189 | (interactive "P") |
| 190 | (switch-to-buffer "*Solitaire*") | 190 | (switch-to-buffer "*Solitaire*") |
| 191 | (solitaire-mode) | ||
| 192 | (setq buffer-read-only t) | 191 | (setq buffer-read-only t) |
| 193 | (setq solitaire-stones 32) | 192 | (setq solitaire-stones 32) |
| 194 | (solitaire-insert-board) | 193 | (solitaire-insert-board) |
| @@ -196,7 +195,7 @@ Pick your favourite shortcuts: | |||
| 196 | (goto-char (point-max)) | 195 | (goto-char (point-max)) |
| 197 | (setq solitaire-center (search-backward ".")) | 196 | (setq solitaire-center (search-backward ".")) |
| 198 | (setq buffer-undo-list (list (point))) | 197 | (setq buffer-undo-list (list (point))) |
| 199 | (set-buffer-modified-p nil)) | 198 | (solitaire-mode)) |
| 200 | 199 | ||
| 201 | (defun solitaire-build-modeline () | 200 | (defun solitaire-build-modeline () |
| 202 | (setq mode-line-format | 201 | (setq mode-line-format |