diff options
| author | Juanma Barranquero | 2003-02-24 10:57:59 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-02-24 10:57:59 +0000 |
| commit | d1135afcd5ac6d6ba9ec408698aecbc4ec69c320 (patch) | |
| tree | 506a185ed11429ebf1cae8f6fe9ea2b05ff87f4a /src | |
| parent | 0b063c2762130d90ceb766b9753339fc62539082 (diff) | |
| download | emacs-d1135afcd5ac6d6ba9ec408698aecbc4ec69c320.tar.gz emacs-d1135afcd5ac6d6ba9ec408698aecbc4ec69c320.zip | |
(fix_command): Declare as static void and move before Fcall_interactively.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/callint.c | 128 |
2 files changed, 67 insertions, 64 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a3f5d91d77a..efbf8cfe5bc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2003-02-24 Juanma Barranquero <lektu@terra.es> | 1 | 2003-02-24 Juanma Barranquero <lektu@terra.es> |
| 2 | 2 | ||
| 3 | * callint.c (fix_command): Declare as static void and move before | ||
| 4 | Fcall_interactively. | ||
| 5 | |||
| 3 | * xdisp.c (Qwhen): Declare external; it's now defined in callint.c. | 6 | * xdisp.c (Qwhen): Declare external; it's now defined in callint.c. |
| 4 | (syms_of_xdisp): Don't initialize Qwhen. | 7 | (syms_of_xdisp): Don't initialize Qwhen. |
| 5 | 8 | ||
diff --git a/src/callint.c b/src/callint.c index 6decd691b55..a6b83c6523f 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -174,6 +174,70 @@ check_mark (for_region) | |||
| 174 | Fsignal (Qmark_inactive, Qnil); | 174 | Fsignal (Qmark_inactive, Qnil); |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | static void | ||
| 178 | fix_command (input, values) | ||
| 179 | Lisp_Object input, values; | ||
| 180 | { | ||
| 181 | /* If the list of args was produced with an explicit call to `list', | ||
| 182 | look for elements that were computed with (region-beginning) | ||
| 183 | or (region-end), and put those expressions into VALUES | ||
| 184 | instead of the present values. */ | ||
| 185 | if (CONSP (input)) | ||
| 186 | { | ||
| 187 | Lisp_Object car; | ||
| 188 | |||
| 189 | car = XCAR (input); | ||
| 190 | /* Skip through certain special forms. */ | ||
| 191 | while (EQ (car, Qlet) || EQ (car, Qletx) | ||
| 192 | || EQ (car, Qsave_excursion) | ||
| 193 | || EQ (car, Qprogn)) | ||
| 194 | { | ||
| 195 | while (CONSP (XCDR (input))) | ||
| 196 | input = XCDR (input); | ||
| 197 | input = XCAR (input); | ||
| 198 | if (!CONSP (input)) | ||
| 199 | break; | ||
| 200 | car = XCAR (input); | ||
| 201 | } | ||
| 202 | if (EQ (car, Qlist)) | ||
| 203 | { | ||
| 204 | Lisp_Object intail, valtail; | ||
| 205 | for (intail = Fcdr (input), valtail = values; | ||
| 206 | CONSP (valtail); | ||
| 207 | intail = Fcdr (intail), valtail = Fcdr (valtail)) | ||
| 208 | { | ||
| 209 | Lisp_Object elt; | ||
| 210 | elt = Fcar (intail); | ||
| 211 | if (CONSP (elt)) | ||
| 212 | { | ||
| 213 | Lisp_Object presflag, carelt; | ||
| 214 | carelt = Fcar (elt); | ||
| 215 | /* If it is (if X Y), look at Y. */ | ||
| 216 | if (EQ (carelt, Qif) | ||
| 217 | && EQ (Fnthcdr (make_number (3), elt), Qnil)) | ||
| 218 | elt = Fnth (make_number (2), elt); | ||
| 219 | /* If it is (when ... Y), look at Y. */ | ||
| 220 | else if (EQ (carelt, Qwhen)) | ||
| 221 | { | ||
| 222 | while (CONSP (XCDR (elt))) | ||
| 223 | elt = XCDR (elt); | ||
| 224 | elt = Fcar (elt); | ||
| 225 | } | ||
| 226 | |||
| 227 | /* If the function call we're looking at | ||
| 228 | is a special preserved one, copy the | ||
| 229 | whole expression for this argument. */ | ||
| 230 | if (CONSP (elt)) | ||
| 231 | { | ||
| 232 | presflag = Fmemq (Fcar (elt), preserved_fns); | ||
| 233 | if (!NILP (presflag)) | ||
| 234 | Fsetcar (valtail, Fcar (intail)); | ||
| 235 | } | ||
| 236 | } | ||
| 237 | } | ||
| 238 | } | ||
| 239 | } | ||
| 240 | } | ||
| 177 | 241 | ||
| 178 | DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0, | 242 | DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0, |
| 179 | doc: /* Call FUNCTION, reading args according to its interactive calling specs. | 243 | doc: /* Call FUNCTION, reading args according to its interactive calling specs. |
| @@ -785,70 +849,6 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 785 | } | 849 | } |
| 786 | } | 850 | } |
| 787 | 851 | ||
| 788 | Lisp_Object | ||
| 789 | fix_command (input, values) | ||
| 790 | Lisp_Object input, values; | ||
| 791 | { | ||
| 792 | /* If the list of args was produced with an explicit call to `list', | ||
| 793 | look for elements that were computed with (region-beginning) | ||
| 794 | or (region-end), and put those expressions into VALUES | ||
| 795 | instead of the present values. */ | ||
| 796 | if (CONSP (input)) | ||
| 797 | { | ||
| 798 | Lisp_Object car; | ||
| 799 | |||
| 800 | car = XCAR (input); | ||
| 801 | /* Skip through certain special forms. */ | ||
| 802 | while (EQ (car, Qlet) || EQ (car, Qletx) | ||
| 803 | || EQ (car, Qsave_excursion) | ||
| 804 | || EQ (car, Qprogn)) | ||
| 805 | { | ||
| 806 | while (CONSP (XCDR (input))) | ||
| 807 | input = XCDR (input); | ||
| 808 | input = XCAR (input); | ||
| 809 | if (!CONSP (input)) | ||
| 810 | break; | ||
| 811 | car = XCAR (input); | ||
| 812 | } | ||
| 813 | if (EQ (car, Qlist)) | ||
| 814 | { | ||
| 815 | Lisp_Object intail, valtail; | ||
| 816 | for (intail = Fcdr (input), valtail = values; | ||
| 817 | CONSP (valtail); | ||
| 818 | intail = Fcdr (intail), valtail = Fcdr (valtail)) | ||
| 819 | { | ||
| 820 | Lisp_Object elt; | ||
| 821 | elt = Fcar (intail); | ||
| 822 | if (CONSP (elt)) | ||
| 823 | { | ||
| 824 | Lisp_Object presflag, carelt; | ||
| 825 | carelt = Fcar (elt); | ||
| 826 | /* If it is (if X Y), look at Y. */ | ||
| 827 | if (EQ (carelt, Qif) | ||
| 828 | && EQ (Fnthcdr (make_number (3), elt), Qnil)) | ||
| 829 | elt = Fnth (make_number (2), elt); | ||
| 830 | /* If it is (when ... Y), look at Y. */ | ||
| 831 | else if (EQ (carelt, Qwhen)) | ||
| 832 | { | ||
| 833 | while (CONSP (XCDR (elt))) | ||
| 834 | elt = XCDR (elt); | ||
| 835 | elt = Fcar (elt); | ||
| 836 | } | ||
| 837 | |||
| 838 | /* If the function call we're looking at | ||
| 839 | is a special preserved one, copy the | ||
| 840 | whole expression for this argument. */ | ||
| 841 | if (CONSP (elt)) | ||
| 842 | { | ||
| 843 | presflag = Fmemq (Fcar (elt), preserved_fns); | ||
| 844 | if (!NILP (presflag)) | ||
| 845 | Fsetcar (valtail, Fcar (intail)); | ||
| 846 | } | ||
| 847 | } | ||
| 848 | } | ||
| 849 | } | ||
| 850 | } | ||
| 851 | } | ||
| 852 | DEFUN ("prefix-numeric-value", Fprefix_numeric_value, Sprefix_numeric_value, | 852 | DEFUN ("prefix-numeric-value", Fprefix_numeric_value, Sprefix_numeric_value, |
| 853 | 1, 1, 0, | 853 | 1, 1, 0, |
| 854 | doc: /* Return numeric meaning of raw prefix argument RAW. | 854 | doc: /* Return numeric meaning of raw prefix argument RAW. |