diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 53 | ||||
| -rw-r--r-- | lisp/abbrev.el | 15 | ||||
| -rw-r--r-- | lisp/avoid.el | 6 | ||||
| -rw-r--r-- | lisp/custom.el | 7 | ||||
| -rw-r--r-- | lisp/help-mode.el | 2 | ||||
| -rw-r--r-- | lisp/novice.el | 6 | ||||
| -rw-r--r-- | lisp/printing.el | 14 | ||||
| -rw-r--r-- | lisp/progmodes/etags.el | 97 | ||||
| -rw-r--r-- | lisp/replace.el | 41 | ||||
| -rw-r--r-- | lisp/subr.el | 16 | ||||
| -rw-r--r-- | lisp/windmove.el | 6 | ||||
| -rw-r--r-- | lisp/window.el | 2 |
12 files changed, 174 insertions, 91 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4f1d0859f65..b5134b2647f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,56 @@ | |||
| 1 | 2004-08-02 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * avoid.el (mouse-avoidance-point-position): Use window-inside-edges | ||
| 4 | and call compute-motion with nil for topos and width to get proper | ||
| 5 | usable width and height for both window and non-window systems. | ||
| 6 | |||
| 7 | * windmove.el (windmove-coordinates-of-position): Let compute-motion | ||
| 8 | calculate usable window width and height. | ||
| 9 | |||
| 10 | * window.el (window-buffer-height): Call compute-motion with nil width. | ||
| 11 | |||
| 12 | 2004-08-01 David Kastrup <dak@gnu.org> | ||
| 13 | |||
| 14 | * replace.el (query-replace-read-from): Use | ||
| 15 | `query-replace-compile-replacement'. | ||
| 16 | (query-replace-compile-replacement): New function. | ||
| 17 | (query-replace-read-to): Use `query-replace-compile-replacement' | ||
| 18 | for repeating the last command. | ||
| 19 | |||
| 20 | 2004-08-01 John Paul Wallington <jpw@gnu.org> | ||
| 21 | |||
| 22 | * printing.el (toplevel, pr-ps-fast-fire, pr-ps-set-utility) | ||
| 23 | (pr-ps-set-printer, pr-txt-set-printer, pr-eval-setting-alist) | ||
| 24 | (pr-switches): Remove period from end of error messages. | ||
| 25 | |||
| 26 | * help-mode.el (help-go-back): Likewise. | ||
| 27 | |||
| 28 | * abbrev.el (only-global-abbrevs): Doc fix. | ||
| 29 | (edit-abbrevs-map): Define within defvar. | ||
| 30 | (quietly-read-abbrev-file): Doc fix. | ||
| 31 | |||
| 32 | 2004-07-31 Luc Teirlinck <teirllm@auburn.edu> | ||
| 33 | |||
| 34 | * novice.el (enable-command, disable-command): Doc fixes. | ||
| 35 | |||
| 36 | * subr.el (event-modifiers, event-basic-type): Doc fixes. | ||
| 37 | |||
| 38 | 2004-07-30 Richard M. Stallman <rms@gnu.org> | ||
| 39 | |||
| 40 | * subr.el (with-local-quit): Doc fix. | ||
| 41 | |||
| 42 | 2004-07-30 Luc Teirlinck <teirllm@auburn.edu> | ||
| 43 | |||
| 44 | * international/utf-8.el (utf-translate-cjk-mode): Doc fix. | ||
| 45 | |||
| 46 | 2004-07-28 Luc Teirlinck <teirllm@auburn.edu> | ||
| 47 | |||
| 48 | * custom.el (defcustom): Doc fix. | ||
| 49 | |||
| 50 | 2004-07-28 Masatake YAMATO <jet@gyve.org> | ||
| 51 | |||
| 52 | * progmodes/etags.el (etags-tags-apropos): Show building progress. | ||
| 53 | |||
| 1 | 2004-07-26 Stefan Monnier <monnier@iro.umontreal.ca> | 54 | 2004-07-26 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 55 | ||
| 3 | * imenu.el (imenu-prev-index-position-function) | 56 | * imenu.el (imenu-prev-index-position-function) |
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 3be0014fd0e..3580c136948 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | ;;; Code: | 29 | ;;; Code: |
| 30 | 30 | ||
| 31 | (defcustom only-global-abbrevs nil | 31 | (defcustom only-global-abbrevs nil |
| 32 | "*t means user plans to use global abbrevs only. | 32 | "Non-nil means user plans to use global abbrevs only. |
| 33 | This makes the commands that normally define mode-specific abbrevs | 33 | This makes the commands that normally define mode-specific abbrevs |
| 34 | define global abbrevs instead." | 34 | define global abbrevs instead." |
| 35 | :type 'boolean | 35 | :type 'boolean |
| @@ -59,13 +59,12 @@ to enable or disable Abbrev mode in the current buffer." | |||
| 59 | :group 'abbrev-mode) | 59 | :group 'abbrev-mode) |
| 60 | 60 | ||
| 61 | 61 | ||
| 62 | (defvar edit-abbrevs-map nil | 62 | (defvar edit-abbrevs-map |
| 63 | (let ((map (make-sparse-keymap))) | ||
| 64 | (define-key map "\C-x\C-s" 'edit-abbrevs-redefine) | ||
| 65 | (define-key map "\C-c\C-c" 'edit-abbrevs-redefine) | ||
| 66 | map) | ||
| 63 | "Keymap used in `edit-abbrevs'.") | 67 | "Keymap used in `edit-abbrevs'.") |
| 64 | (if edit-abbrevs-map | ||
| 65 | nil | ||
| 66 | (setq edit-abbrevs-map (make-sparse-keymap)) | ||
| 67 | (define-key edit-abbrevs-map "\C-x\C-s" 'edit-abbrevs-redefine) | ||
| 68 | (define-key edit-abbrevs-map "\C-c\C-c" 'edit-abbrevs-redefine)) | ||
| 69 | 68 | ||
| 70 | (defun kill-all-abbrevs () | 69 | (defun kill-all-abbrevs () |
| 71 | "Undefine all defined abbrevs." | 70 | "Undefine all defined abbrevs." |
| @@ -195,7 +194,7 @@ Optional second argument QUIETLY non-nil means don't display a message." | |||
| 195 | (setq abbrevs-changed nil)) | 194 | (setq abbrevs-changed nil)) |
| 196 | 195 | ||
| 197 | (defun quietly-read-abbrev-file (&optional file) | 196 | (defun quietly-read-abbrev-file (&optional file) |
| 198 | "Read abbrev definitions from file written with write-abbrev-file. | 197 | "Read abbrev definitions from file written with `write-abbrev-file'. |
| 199 | Optional argument FILE is the name of the file to read; | 198 | Optional argument FILE is the name of the file to read; |
| 200 | it defaults to the value of `abbrev-file-name'. | 199 | it defaults to the value of `abbrev-file-name'. |
| 201 | Does not display any message." | 200 | Does not display any message." |
diff --git a/lisp/avoid.el b/lisp/avoid.el index 5a5a09622cd..536b80abdbe 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el | |||
| @@ -139,15 +139,15 @@ Only applies in mouse-avoidance-modes `animate' and `jump'." | |||
| 139 | "Return the position of point as (FRAME X . Y). | 139 | "Return the position of point as (FRAME X . Y). |
| 140 | Analogous to mouse-position." | 140 | Analogous to mouse-position." |
| 141 | (let* ((w (selected-window)) | 141 | (let* ((w (selected-window)) |
| 142 | (edges (window-edges w)) | 142 | (edges (window-inside-edges w)) |
| 143 | (list | 143 | (list |
| 144 | (compute-motion (max (window-start w) (point-min)) ; start pos | 144 | (compute-motion (max (window-start w) (point-min)) ; start pos |
| 145 | ;; window-start can be < point-min if the | 145 | ;; window-start can be < point-min if the |
| 146 | ;; latter has changed since the last redisplay | 146 | ;; latter has changed since the last redisplay |
| 147 | '(0 . 0) ; start XY | 147 | '(0 . 0) ; start XY |
| 148 | (point) ; stop pos | 148 | (point) ; stop pos |
| 149 | (cons (window-width) (window-height)); stop XY: none | 149 | nil ; stop XY: none |
| 150 | (1- (window-width)) ; width | 150 | nil ; width |
| 151 | (cons (window-hscroll w) 0) ; 0 may not be right? | 151 | (cons (window-hscroll w) 0) ; 0 may not be right? |
| 152 | (selected-window)))) | 152 | (selected-window)))) |
| 153 | ;; compute-motion returns (pos HPOS VPOS prevhpos contin) | 153 | ;; compute-motion returns (pos HPOS VPOS prevhpos contin) |
diff --git a/lisp/custom.el b/lisp/custom.el index e86308c95e7..2ddd7ceb943 100644 --- a/lisp/custom.el +++ b/lisp/custom.el | |||
| @@ -246,6 +246,13 @@ The following keywords are meaningful: | |||
| 246 | Specifies that SYMBOL should be set after the list of variables | 246 | Specifies that SYMBOL should be set after the list of variables |
| 247 | VARIABLES when both have been customized. | 247 | VARIABLES when both have been customized. |
| 248 | 248 | ||
| 249 | If SYMBOL has a local binding, then this form affects the local | ||
| 250 | binding. This is normally not what you want. Thus, if you need | ||
| 251 | to load a file defining variables with this form, or with | ||
| 252 | `defvar' or `defconst', you should always load that file | ||
| 253 | _outside_ any bindings for these variables. \(`defvar' and | ||
| 254 | `defconst' behave similarly in this respect.) | ||
| 255 | |||
| 249 | Read the section about customization in the Emacs Lisp manual for more | 256 | Read the section about customization in the Emacs Lisp manual for more |
| 250 | information." | 257 | information." |
| 251 | ;; It is better not to use backquote in this file, | 258 | ;; It is better not to use backquote in this file, |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 11656ec368c..a2dcdf91ed8 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -581,7 +581,7 @@ help buffer." | |||
| 581 | (interactive) | 581 | (interactive) |
| 582 | (if help-xref-stack | 582 | (if help-xref-stack |
| 583 | (help-xref-go-back (current-buffer)) | 583 | (help-xref-go-back (current-buffer)) |
| 584 | (error "No previous help buffer."))) | 584 | (error "No previous help buffer"))) |
| 585 | 585 | ||
| 586 | (defun help-do-xref (pos function args) | 586 | (defun help-do-xref (pos function args) |
| 587 | "Call the help cross-reference function FUNCTION with args ARGS. | 587 | "Call the help cross-reference function FUNCTION with args ARGS. |
diff --git a/lisp/novice.el b/lisp/novice.el index 159c9a96780..1cb89066481 100644 --- a/lisp/novice.el +++ b/lisp/novice.el | |||
| @@ -104,7 +104,8 @@ SPC to try the command just this once, but leave it disabled. | |||
| 104 | ;;;###autoload | 104 | ;;;###autoload |
| 105 | (defun enable-command (command) | 105 | (defun enable-command (command) |
| 106 | "Allow COMMAND to be executed without special confirmation from now on. | 106 | "Allow COMMAND to be executed without special confirmation from now on. |
| 107 | The user's .emacs file is altered so that this will apply | 107 | COMMAND must be a symbol. |
| 108 | This command alters the user's .emacs file so that this will apply | ||
| 108 | to future sessions." | 109 | to future sessions." |
| 109 | (interactive "CEnable command: ") | 110 | (interactive "CEnable command: ") |
| 110 | (put command 'disabled nil) | 111 | (put command 'disabled nil) |
| @@ -141,7 +142,8 @@ to future sessions." | |||
| 141 | ;;;###autoload | 142 | ;;;###autoload |
| 142 | (defun disable-command (command) | 143 | (defun disable-command (command) |
| 143 | "Require special confirmation to execute COMMAND from now on. | 144 | "Require special confirmation to execute COMMAND from now on. |
| 144 | The user's .emacs file is altered so that this will apply | 145 | COMMAND must be a symbol. |
| 146 | This command alters the user's .emacs file so that this will apply | ||
| 145 | to future sessions." | 147 | to future sessions." |
| 146 | (interactive "CDisable command: ") | 148 | (interactive "CDisable command: ") |
| 147 | (if (not (commandp command)) | 149 | (if (not (commandp command)) |
diff --git a/lisp/printing.el b/lisp/printing.el index 22a3f762ab6..08303e0595d 100644 --- a/lisp/printing.el +++ b/lisp/printing.el | |||
| @@ -974,7 +974,7 @@ Please send all bug fixes and enhancements to | |||
| 974 | 974 | ||
| 975 | 975 | ||
| 976 | (and (string< ps-print-version "6.6.4") | 976 | (and (string< ps-print-version "6.6.4") |
| 977 | (error "`printing' requires `ps-print' package version 6.6.4 or later.")) | 977 | (error "`printing' requires `ps-print' package version 6.6.4 or later")) |
| 978 | 978 | ||
| 979 | 979 | ||
| 980 | (eval-and-compile | 980 | (eval-and-compile |
| @@ -4254,7 +4254,7 @@ are both set to t." | |||
| 4254 | (pr-ps-buffer-ps-print | 4254 | (pr-ps-buffer-ps-print |
| 4255 | (if (integerp n-up) | 4255 | (if (integerp n-up) |
| 4256 | (min (max n-up 1) 100) | 4256 | (min (max n-up 1) 100) |
| 4257 | (error "n-up must be an integer greater than zero.")) | 4257 | (error "n-up must be an integer greater than zero")) |
| 4258 | filename))) | 4258 | filename))) |
| 4259 | 4259 | ||
| 4260 | 4260 | ||
| @@ -5031,7 +5031,7 @@ non-nil." | |||
| 5031 | (let ((item (cdr (assq value pr-ps-utility-alist)))) | 5031 | (let ((item (cdr (assq value pr-ps-utility-alist)))) |
| 5032 | (or item | 5032 | (or item |
| 5033 | (error | 5033 | (error |
| 5034 | "Invalid PostScript utility name `%s' for variable `pr-ps-utility'." | 5034 | "Invalid PostScript utility name `%s' for variable `pr-ps-utility'" |
| 5035 | value)) | 5035 | value)) |
| 5036 | (setq pr-ps-utility value) | 5036 | (setq pr-ps-utility value) |
| 5037 | (pr-eval-alist (nthcdr 9 item))) | 5037 | (pr-eval-alist (nthcdr 9 item))) |
| @@ -5042,7 +5042,7 @@ non-nil." | |||
| 5042 | (let ((ps (cdr (assq value pr-ps-printer-alist)))) | 5042 | (let ((ps (cdr (assq value pr-ps-printer-alist)))) |
| 5043 | (or ps | 5043 | (or ps |
| 5044 | (error | 5044 | (error |
| 5045 | "Invalid PostScript printer name `%s' for variable `pr-ps-name'." | 5045 | "Invalid PostScript printer name `%s' for variable `pr-ps-name'" |
| 5046 | value)) | 5046 | value)) |
| 5047 | (setq pr-ps-name value | 5047 | (setq pr-ps-name value |
| 5048 | pr-ps-command (pr-dosify-file-name (nth 0 ps)) | 5048 | pr-ps-command (pr-dosify-file-name (nth 0 ps)) |
| @@ -5068,7 +5068,7 @@ non-nil." | |||
| 5068 | (defun pr-txt-set-printer (value) | 5068 | (defun pr-txt-set-printer (value) |
| 5069 | (let ((txt (cdr (assq value pr-txt-printer-alist)))) | 5069 | (let ((txt (cdr (assq value pr-txt-printer-alist)))) |
| 5070 | (or txt | 5070 | (or txt |
| 5071 | (error "Invalid text printer name `%s' for variable `pr-txt-name'." | 5071 | (error "Invalid text printer name `%s' for variable `pr-txt-name'" |
| 5072 | value)) | 5072 | value)) |
| 5073 | (setq pr-txt-name value | 5073 | (setq pr-txt-name value |
| 5074 | pr-txt-command (pr-dosify-file-name (nth 0 txt)) | 5074 | pr-txt-command (pr-dosify-file-name (nth 0 txt)) |
| @@ -5121,7 +5121,7 @@ non-nil." | |||
| 5121 | (setq global nil))) | 5121 | (setq global nil))) |
| 5122 | (and inherits | 5122 | (and inherits |
| 5123 | (if (memq inherits old) | 5123 | (if (memq inherits old) |
| 5124 | (error "Circular inheritance for `%S'." inherits) | 5124 | (error "Circular inheritance for `%S'" inherits) |
| 5125 | (setq local-list | 5125 | (setq local-list |
| 5126 | (pr-eval-setting-alist inherits global | 5126 | (pr-eval-setting-alist inherits global |
| 5127 | (cons inherits old))))) | 5127 | (cons inherits old))))) |
| @@ -5349,7 +5349,7 @@ non-nil." | |||
| 5349 | 5349 | ||
| 5350 | (defun pr-switches (switches mess) | 5350 | (defun pr-switches (switches mess) |
| 5351 | (or (listp switches) | 5351 | (or (listp switches) |
| 5352 | (error "%S should have a list of strings." mess)) | 5352 | (error "%S should have a list of strings" mess)) |
| 5353 | (ps-flatten-list ; dynamic evaluation | 5353 | (ps-flatten-list ; dynamic evaluation |
| 5354 | (mapcar 'ps-eval-switch switches))) | 5354 | (mapcar 'ps-eval-switch switches))) |
| 5355 | 5355 | ||
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 184077f6a3a..4464df3a916 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -1453,53 +1453,58 @@ where they were found." | |||
| 1453 | (tags-with-face 'highlight (princ buffer-file-name)) | 1453 | (tags-with-face 'highlight (princ buffer-file-name)) |
| 1454 | (princ "':\n\n")) | 1454 | (princ "':\n\n")) |
| 1455 | (goto-char (point-min)) | 1455 | (goto-char (point-min)) |
| 1456 | (while (re-search-forward string nil t) | 1456 | (let ((point-max (/ (float (point-max)) 100.0))) |
| 1457 | (beginning-of-line) | 1457 | (while (re-search-forward string nil t) |
| 1458 | (message "Making tags apropos buffer for `%s'...%d%%" | ||
| 1459 | string | ||
| 1460 | (/ (point) point-max)) | ||
| 1461 | (beginning-of-line) | ||
| 1458 | 1462 | ||
| 1459 | (let* (;; Get the local value in the tags table | 1463 | (let* ( ;; Get the local value in the tags table |
| 1460 | ;; buffer before switching buffers. | 1464 | ;; buffer before switching buffers. |
| 1461 | (goto-func goto-tag-location-function) | 1465 | (goto-func goto-tag-location-function) |
| 1462 | (tag-info (save-excursion (funcall snarf-tag-function))) | 1466 | (tag-info (save-excursion (funcall snarf-tag-function))) |
| 1463 | (tag (if (eq t (car tag-info)) nil (car tag-info))) | 1467 | (tag (if (eq t (car tag-info)) nil (car tag-info))) |
| 1464 | (file-path (save-excursion (if tag (file-of-tag) | 1468 | (file-path (save-excursion (if tag (file-of-tag) |
| 1465 | (save-excursion (next-line 1) | 1469 | (save-excursion (next-line 1) |
| 1466 | (file-of-tag))))) | 1470 | (file-of-tag))))) |
| 1467 | (file-label (if tag (file-of-tag t) | 1471 | (file-label (if tag (file-of-tag t) |
| 1468 | (save-excursion (next-line 1) | 1472 | (save-excursion (next-line 1) |
| 1469 | (file-of-tag t)))) | 1473 | (file-of-tag t)))) |
| 1470 | (pt (with-current-buffer standard-output (point)))) | 1474 | (pt (with-current-buffer standard-output (point)))) |
| 1471 | (if tag | 1475 | (if tag |
| 1472 | (progn | 1476 | (progn |
| 1473 | (princ (format "[%s]: " file-label)) | 1477 | (princ (format "[%s]: " file-label)) |
| 1474 | (princ tag) | 1478 | (princ tag) |
| 1475 | (when (= (aref tag 0) ?\() (princ " ...)")) | 1479 | (when (= (aref tag 0) ?\() (princ " ...)")) |
| 1476 | (with-current-buffer standard-output | 1480 | (with-current-buffer standard-output |
| 1477 | (make-text-button pt (point) | 1481 | (make-text-button pt (point) |
| 1478 | 'tag-info tag-info | 1482 | 'tag-info tag-info |
| 1479 | 'file-path file-path | 1483 | 'file-path file-path |
| 1480 | 'goto-func goto-func | 1484 | 'goto-func goto-func |
| 1481 | 'action (lambda (button) | 1485 | 'action (lambda (button) |
| 1482 | (let ((tag-info (button-get button 'tag-info)) | 1486 | (let ((tag-info (button-get button 'tag-info)) |
| 1483 | (goto-func (button-get button 'goto-func))) | 1487 | (goto-func (button-get button 'goto-func))) |
| 1484 | (tag-find-file-of-tag (button-get button 'file-path)) | 1488 | (tag-find-file-of-tag (button-get button 'file-path)) |
| 1485 | (widen) | 1489 | (widen) |
| 1486 | (funcall goto-func tag-info))) | 1490 | (funcall goto-func tag-info))) |
| 1487 | 'face 'tags-tag-face | 1491 | 'face 'tags-tag-face |
| 1488 | 'type 'button))) | 1492 | 'type 'button))) |
| 1489 | (princ (format "- %s" file-label)) | 1493 | (princ (format "- %s" file-label)) |
| 1490 | (with-current-buffer standard-output | 1494 | (with-current-buffer standard-output |
| 1491 | (make-text-button pt (point) | 1495 | (make-text-button pt (point) |
| 1492 | 'file-path file-path | 1496 | 'file-path file-path |
| 1493 | 'action (lambda (button) | 1497 | 'action (lambda (button) |
| 1494 | (tag-find-file-of-tag (button-get button 'file-path)) | 1498 | (tag-find-file-of-tag (button-get button 'file-path)) |
| 1495 | ;; Get the local value in the tags table | 1499 | ;; Get the local value in the tags table |
| 1496 | ;; buffer before switching buffers. | 1500 | ;; buffer before switching buffers. |
| 1497 | (goto-char (point-min))) | 1501 | (goto-char (point-min))) |
| 1498 | 'face 'tags-tag-face | 1502 | 'face 'tags-tag-face |
| 1499 | 'type 'button)) | 1503 | 'type 'button)) |
| 1500 | )) | 1504 | )) |
| 1501 | (terpri) | 1505 | (terpri) |
| 1502 | (forward-line 1)) | 1506 | (forward-line 1)) |
| 1507 | (message nil)) | ||
| 1503 | (when tags-apropos-verbose (princ "\n"))) | 1508 | (when tags-apropos-verbose (princ "\n"))) |
| 1504 | 1509 | ||
| 1505 | (defun etags-tags-table-files () | 1510 | (defun etags-tags-table-files () |
diff --git a/lisp/replace.el b/lisp/replace.el index f09868cc6d3..47437659923 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -94,7 +94,8 @@ wants to replace FROM with TO." | |||
| 94 | query-replace-from-history-variable | 94 | query-replace-from-history-variable |
| 95 | nil t)))) | 95 | nil t)))) |
| 96 | (if (and (zerop (length from)) lastto lastfrom) | 96 | (if (and (zerop (length from)) lastto lastfrom) |
| 97 | (cons lastfrom lastto) | 97 | (cons lastfrom |
| 98 | (query-replace-compile-replacement lastto regexp-flag)) | ||
| 98 | ;; Warn if user types \n or \t, but don't reject the input. | 99 | ;; Warn if user types \n or \t, but don't reject the input. |
| 99 | (and regexp-flag | 100 | (and regexp-flag |
| 100 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) | 101 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) |
| @@ -107,15 +108,12 @@ wants to replace FROM with TO." | |||
| 107 | (sit-for 2))) | 108 | (sit-for 2))) |
| 108 | from)))) | 109 | from)))) |
| 109 | 110 | ||
| 110 | (defun query-replace-read-to (from string regexp-flag) | 111 | (defun query-replace-compile-replacement (to regexp-flag) |
| 111 | "Query and return the `from' argument of a query-replace operation." | 112 | "Maybe convert a regexp replacement TO to Lisp. |
| 112 | (let ((to (save-excursion | 113 | Returns a list suitable for `perform-replace' if necessary, |
| 113 | (read-from-minibuffer | 114 | the original string if not." |
| 114 | (format "%s %s with: " string (query-replace-descr from)) | 115 | (if (and regexp-flag |
| 115 | nil nil nil | 116 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)) |
| 116 | query-replace-to-history-variable from t)))) | ||
| 117 | (when (and regexp-flag | ||
| 118 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)) | ||
| 119 | (let (pos list char) | 117 | (let (pos list char) |
| 120 | (while | 118 | (while |
| 121 | (progn | 119 | (progn |
| @@ -142,14 +140,25 @@ wants to replace FROM with TO." | |||
| 142 | (cdr pos)))) | 140 | (cdr pos)))) |
| 143 | (setq to (substring to end))))) | 141 | (setq to (substring to end))))) |
| 144 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))) | 142 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))) |
| 145 | (setq to (nreverse (delete "" (cons to list))))) | 143 | (setq to (nreverse (delete "" (cons to list)))) |
| 146 | (replace-match-string-symbols to) | 144 | (replace-match-string-symbols to) |
| 147 | (setq to (cons 'replace-eval-replacement | 145 | (cons 'replace-eval-replacement |
| 148 | (if (> (length to) 1) | 146 | (if (cdr to) |
| 149 | (cons 'concat to) | 147 | (cons 'concat to) |
| 150 | (car to))))) | 148 | (car to)))) |
| 151 | to)) | 149 | to)) |
| 152 | 150 | ||
| 151 | |||
| 152 | (defun query-replace-read-to (from string regexp-flag) | ||
| 153 | "Query and return the `to' argument of a query-replace operation." | ||
| 154 | (query-replace-compile-replacement | ||
| 155 | (save-excursion | ||
| 156 | (read-from-minibuffer | ||
| 157 | (format "%s %s with: " string (query-replace-descr from)) | ||
| 158 | nil nil nil | ||
| 159 | query-replace-to-history-variable from t)) | ||
| 160 | regexp-flag)) | ||
| 161 | |||
| 153 | (defun query-replace-read-args (string regexp-flag &optional noerror) | 162 | (defun query-replace-read-args (string regexp-flag &optional noerror) |
| 154 | (unless noerror | 163 | (unless noerror |
| 155 | (barf-if-buffer-read-only)) | 164 | (barf-if-buffer-read-only)) |
diff --git a/lisp/subr.el b/lisp/subr.el index 354f911fe67..c3088cd9c0a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -644,7 +644,11 @@ The normal global definition of the character C-x indirects to this keymap.") | |||
| 644 | "Return a list of symbols representing the modifier keys in event EVENT. | 644 | "Return a list of symbols representing the modifier keys in event EVENT. |
| 645 | The elements of the list may include `meta', `control', | 645 | The elements of the list may include `meta', `control', |
| 646 | `shift', `hyper', `super', `alt', `click', `double', `triple', `drag', | 646 | `shift', `hyper', `super', `alt', `click', `double', `triple', `drag', |
| 647 | and `down'." | 647 | and `down'. |
| 648 | EVENT may be an event or an event type. If EVENT is a symbol | ||
| 649 | that has never been used in an event that has been read as input | ||
| 650 | in the current Emacs session, then this function can return nil, | ||
| 651 | even when EVENT actually has modifiers." | ||
| 648 | (let ((type event)) | 652 | (let ((type event)) |
| 649 | (if (listp type) | 653 | (if (listp type) |
| 650 | (setq type (car type))) | 654 | (setq type (car type))) |
| @@ -671,7 +675,10 @@ and `down'." | |||
| 671 | 675 | ||
| 672 | (defun event-basic-type (event) | 676 | (defun event-basic-type (event) |
| 673 | "Return the basic type of the given event (all modifiers removed). | 677 | "Return the basic type of the given event (all modifiers removed). |
| 674 | The value is a printing character (not upper case) or a symbol." | 678 | The value is a printing character (not upper case) or a symbol. |
| 679 | EVENT may be an event or an event type. If EVENT is a symbol | ||
| 680 | that has never been used in an event that has been read as input | ||
| 681 | in the current Emacs session, then this function may return nil." | ||
| 675 | (if (consp event) | 682 | (if (consp event) |
| 676 | (setq event (car event))) | 683 | (setq event (car event))) |
| 677 | (if (symbolp event) | 684 | (if (symbolp event) |
| @@ -1894,7 +1901,10 @@ See also `with-temp-file' and `with-output-to-string'." | |||
| 1894 | (kill-buffer nil))))) | 1901 | (kill-buffer nil))))) |
| 1895 | 1902 | ||
| 1896 | (defmacro with-local-quit (&rest body) | 1903 | (defmacro with-local-quit (&rest body) |
| 1897 | "Execute BODY with `inhibit-quit' temporarily bound to nil." | 1904 | "Execute BODY, allowing quits to terminate BODY but not escape further. |
| 1905 | When a quit terminates BODY, `with-local-quit' requests another quit when | ||
| 1906 | it finishes. That quit will be processed in turn, the next time quitting | ||
| 1907 | is again allowed." | ||
| 1898 | (declare (debug t) (indent 0)) | 1908 | (declare (debug t) (indent 0)) |
| 1899 | `(condition-case nil | 1909 | `(condition-case nil |
| 1900 | (let ((inhibit-quit nil)) | 1910 | (let ((inhibit-quit nil)) |
diff --git a/lisp/windmove.el b/lisp/windmove.el index 7008b86335e..642f04a1d8d 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el | |||
| @@ -429,14 +429,12 @@ the return value from `windmove-coordinates-of-position' is (0 . 0) | |||
| 429 | regardless of the where point is in the buffer and where the window | 429 | regardless of the where point is in the buffer and where the window |
| 430 | is placed in the frame." | 430 | is placed in the frame." |
| 431 | (let* ((wind (if (null window) (selected-window) window)) | 431 | (let* ((wind (if (null window) (selected-window) window)) |
| 432 | (usable-width (1- (window-width wind))) ; 1- for cont. column | ||
| 433 | (usable-height (1- (window-height wind))) ; 1- for mode line | ||
| 434 | (big-hairy-result (compute-motion | 432 | (big-hairy-result (compute-motion |
| 435 | (window-start) | 433 | (window-start) |
| 436 | '(0 . 0) | 434 | '(0 . 0) |
| 437 | pos | 435 | pos |
| 438 | (cons usable-width usable-height) | 436 | nil ; (window-width window-height) |
| 439 | usable-width | 437 | nil ; window-width |
| 440 | (cons (window-hscroll) | 438 | (cons (window-hscroll) |
| 441 | 0) ; why zero? | 439 | 0) ; why zero? |
| 442 | wind))) | 440 | wind))) |
diff --git a/lisp/window.el b/lisp/window.el index 96bfc8b5581..5ec752f3f23 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -408,7 +408,7 @@ lines than are actually needed in the case where some error may be present." | |||
| 408 | '(0 . 0) | 408 | '(0 . 0) |
| 409 | (- (point-max) (if ignore-final-newline 1 0)) | 409 | (- (point-max) (if ignore-final-newline 1 0)) |
| 410 | (cons 0 100000000) | 410 | (cons 0 100000000) |
| 411 | (window-width window) | 411 | nil |
| 412 | nil | 412 | nil |
| 413 | window)))))) | 413 | window)))))) |
| 414 | 414 | ||