diff options
| author | Jim Blandy | 1992-06-30 13:54:21 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-06-30 13:54:21 +0000 |
| commit | e5d77022e8429ca757746ed5d7cf9e2420703e8e (patch) | |
| tree | 2e273d216c8f9e34d5e29547f8e7e7c6c5d32049 | |
| parent | 53b0a6f88893036a42db2abcfbc257b68906956e (diff) | |
| download | emacs-e5d77022e8429ca757746ed5d7cf9e2420703e8e.tar.gz emacs-e5d77022e8429ca757746ed5d7cf9e2420703e8e.zip | |
*** empty log message ***
41 files changed, 518 insertions, 406 deletions
diff --git a/configure1.in b/configure1.in index 5a89edea1ad..073a49843e8 100755 --- a/configure1.in +++ b/configure1.in | |||
| @@ -68,7 +68,7 @@ unsuccessful after disturbing the status quo, config.status is removed." | |||
| 68 | 68 | ||
| 69 | if [ ! -r ./src/lisp.h ]; then | 69 | if [ ! -r ./src/lisp.h ]; then |
| 70 | echo "${progname}: Can't find Emacs sources in \`./src'. | 70 | echo "${progname}: Can't find Emacs sources in \`./src'. |
| 71 | Run this config script in the top directory of the Emacs source tree." 1>&2 | 71 | Run this config script in the top directory of the Emacs source tree." >&2 |
| 72 | exit 1 | 72 | exit 1 |
| 73 | fi | 73 | fi |
| 74 | 74 | ||
| @@ -139,7 +139,11 @@ while [ $# != 0 ]; do | |||
| 139 | ;; | 139 | ;; |
| 140 | *:${opt}*:${opt}*:* ) # Ambiguous prefix. | 140 | *:${opt}*:${opt}*:* ) # Ambiguous prefix. |
| 141 | echo "\`-${opt}' is an ambiguous switch; it could be any of the following:" | 141 | echo "\`-${opt}' is an ambiguous switch; it could be any of the following:" |
| 142 | echo `echo ${options} | tr ':' '\012' | grep '^'${opt}` | 142 | # We can't just use tr to translate colons to newlines, since |
| 143 | # BSD sed and SYSV sed use different syntaxes for that. | ||
| 144 | spaced_options=`echo ${options} | tr ':' ' '` | ||
| 145 | echo `(for option in ${spaced_options}; do echo $option; done) \ | ||
| 146 | | grep "^${opt}"` | ||
| 143 | echo ${short_usage} | 147 | echo ${short_usage} |
| 144 | exit 1 | 148 | exit 1 |
| 145 | ;; | 149 | ;; |
| @@ -170,7 +174,7 @@ while [ $# != 0 ]; do | |||
| 170 | n | no ) val=no ;; | 174 | n | no ) val=no ;; |
| 171 | * ) | 175 | * ) |
| 172 | echo "The \`-${optvar}' option (\`-${opt}') is supposed to have a boolean | 176 | echo "The \`-${optvar}' option (\`-${opt}') is supposed to have a boolean |
| 173 | value - set it to either \`yes' or \`no'." 1>&2 | 177 | value - set it to either \`yes' or \`no'." >&2 |
| 174 | exit 1 | 178 | exit 1 |
| 175 | ;; | 179 | ;; |
| 176 | esac | 180 | esac |
| @@ -208,7 +212,7 @@ machfile="m/${machine}.h" | |||
| 208 | if [ ! -r src/${machfile} ]; then | 212 | if [ ! -r src/${machfile} ]; then |
| 209 | echo "${progname}: Emacs has no configuration info for the machine called | 213 | echo "${progname}: Emacs has no configuration info for the machine called |
| 210 | \`${machine}'. Look at etc/MACHINES for the names of machines | 214 | \`${machine}'. Look at etc/MACHINES for the names of machines |
| 211 | that Emacs has been ported to." 1>&2 | 215 | that Emacs has been ported to." >&2 |
| 212 | exit 1 | 216 | exit 1 |
| 213 | fi | 217 | fi |
| 214 | 218 | ||
| @@ -226,7 +230,7 @@ if [ "${opsystem}" = "" ]; then | |||
| 226 | system a \`${machine}' machine might run. Try specifying the | 230 | system a \`${machine}' machine might run. Try specifying the |
| 227 | operating system explicitly by passing ${progname} an | 231 | operating system explicitly by passing ${progname} an |
| 228 | \`-opsystem=SYSTEM-NAME' flag. Look at etc/MACHINES for the | 232 | \`-opsystem=SYSTEM-NAME' flag. Look at etc/MACHINES for the |
| 229 | names of operating systems that Emacs has been ported to." 1>&2 | 233 | names of operating systems that Emacs has been ported to." >&2 |
| 230 | exit 1 | 234 | exit 1 |
| 231 | fi | 235 | fi |
| 232 | 236 | ||
| @@ -238,7 +242,7 @@ out which one you're running. Run ${progname} with -machine and | |||
| 238 | (This information comes from the file \`etc/MACHINES' - see that | 242 | (This information comes from the file \`etc/MACHINES' - see that |
| 239 | file for more detail.) | 243 | file for more detail.) |
| 240 | 244 | ||
| 241 | " 1>&2 | 245 | " >&2 |
| 242 | sed < src/${machfile} -e '1,/NOTE-START/d' -e '/NOTE-END/,$d' | more | 246 | sed < src/${machfile} -e '1,/NOTE-START/d' -e '/NOTE-END/,$d' | more |
| 243 | echo | 247 | echo |
| 244 | exit 1 | 248 | exit 1 |
| @@ -250,7 +254,7 @@ file for more detail.) | |||
| 250 | operating system for the machine \`${machine}' is \`${opsystem}', | 254 | operating system for the machine \`${machine}' is \`${opsystem}', |
| 251 | but there is no configuration file for \`${opsystem}', so Emacs's | 255 | but there is no configuration file for \`${opsystem}', so Emacs's |
| 252 | default info is screwed up. Try specifying the operating system | 256 | default info is screwed up. Try specifying the operating system |
| 253 | explicitly by passing ${progname} an \`-opsystem=SYSTEM-NAME' flag." 1>&2 | 257 | explicitly by passing ${progname} an \`-opsystem=SYSTEM-NAME' flag." >&2 |
| 254 | exit 1 | 258 | exit 1 |
| 255 | fi | 259 | fi |
| 256 | else | 260 | else |
| @@ -258,7 +262,7 @@ else | |||
| 258 | if [ ! -r src/${opsysfile} ]; then | 262 | if [ ! -r src/${opsysfile} ]; then |
| 259 | echo "${progname}: Emacs has no configuration info for the operating system | 263 | echo "${progname}: Emacs has no configuration info for the operating system |
| 260 | \`${opsystem}'. Look at etc/MACHINES for the names of operating | 264 | \`${opsystem}'. Look at etc/MACHINES for the names of operating |
| 261 | systems that Emacs has been ported to." 1>&2 | 265 | systems that Emacs has been ported to." >&2 |
| 262 | exit 1 | 266 | exit 1 |
| 263 | fi | 267 | fi |
| 264 | fi | 268 | fi |
| @@ -312,7 +316,9 @@ if [ ! "${infodir}" ]; then | |||
| 312 | fi | 316 | fi |
| 313 | 317 | ||
| 314 | echo "Checking window system." | 318 | echo "Checking window system." |
| 315 | window_system="`echo ${window_system} | tr A-Z a-z`" | 319 | # Note that SYSV `tr' doesn't handle character ranges. |
| 320 | window_system="`echo ${window_system} \ | ||
| 321 | | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" | ||
| 316 | case "${window_system}" in | 322 | case "${window_system}" in |
| 317 | "none" | "x11" | "x10" ) ;; | 323 | "none" | "x11" | "x10" ) ;; |
| 318 | "x" ) window_system=x11 ;; | 324 | "x" ) window_system=x11 ;; |
| @@ -324,7 +330,7 @@ case "${window_system}" in | |||
| 324 | fi | 330 | fi |
| 325 | ;; | 331 | ;; |
| 326 | * ) | 332 | * ) |
| 327 | echo "The \`-window_system' option must be set to \`none' or \`X11'." 1>&2 | 333 | echo "The \`-window_system' option must be set to \`none' or \`X11'." >&2 |
| 328 | exit 1 | 334 | exit 1 |
| 329 | ;; | 335 | ;; |
| 330 | esac | 336 | esac |
| @@ -463,6 +469,7 @@ esac | |||
| 463 | sed_flags="-e 's:@machine@:${machfile}:'" | 469 | sed_flags="-e 's:@machine@:${machfile}:'" |
| 464 | sed_flags="${sed_flags} -e 's:@opsystem@:${opsysfile}:'" | 470 | sed_flags="${sed_flags} -e 's:@opsystem@:${opsysfile}:'" |
| 465 | for flag in `echo ${config_h_opts} | tr ':' ' '`; do | 471 | for flag in `echo ${config_h_opts} | tr ':' ' '`; do |
| 472 | # Note that SYSV `tr' doesn't handle character ranges. | ||
| 466 | cflagname=`echo ${flag} \ | 473 | cflagname=`echo ${flag} \ |
| 467 | | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` | 474 | | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
| 468 | val=`eval echo '$'${flag}` | 475 | val=`eval echo '$'${flag}` |
| @@ -562,28 +569,28 @@ if [ "${highpri}" ]; then | |||
| 562 | else | 569 | else |
| 563 | desc_highpri="none" | 570 | desc_highpri="none" |
| 564 | fi | 571 | fi |
| 565 | message="# Configured for machine \`${machine}' running \`${opsystem}'. | 572 | message="Configured for machine \`${machine}' running \`${opsystem}'. |
| 566 | # The following values have been set in ./Makefile and ./build-install: | 573 | The following values have been set in ./Makefile and ./build-install: |
| 567 | # Executables will be placed in | 574 | \`make install' or \`build-install' will placed executables in |
| 568 | # ${bindir}. | 575 | ${bindir}. |
| 569 | # Emacs's lisp search path will be | 576 | Emacs's lisp search path will be |
| 570 | # \`${lisppath}'. | 577 | \`${lisppath}'. |
| 571 | # Emacs will look for its architecture-independent data in | 578 | Emacs will look for its architecture-independent data in |
| 572 | # ${datadir}. | 579 | ${datadir}. |
| 573 | # Emacs will look for its utility programs and other architecture- | 580 | Emacs will look for its utility programs and other architecture- |
| 574 | # dependent data in | 581 | dependent data in |
| 575 | # ${libdir}. | 582 | ${libdir}. |
| 576 | # Emacs will keep track of file-locking in | 583 | Emacs will keep track of file-locking in |
| 577 | # ${lockdir}. | 584 | ${lockdir}. |
| 578 | # The following values have been set in src/config.h: | 585 | The following values have been set in src/config.h: |
| 579 | # At how much higher than normal priority should Emacs run? ${desc_highpri} | 586 | At how much higher than normal priority should Emacs run? ${desc_highpri} |
| 580 | # Should Emacs use the GNU version of malloc? ${gnu_malloc}${gnu_malloc_reason} | 587 | Should Emacs use the GNU version of malloc? ${gnu_malloc}${gnu_malloc_reason} |
| 581 | # Should Emacs use the relocating allocator for buffers? ${rel_alloc} | 588 | Should Emacs use the relocating allocator for buffers? ${rel_alloc} |
| 582 | # Should Emacs support a floating point Elisp type? ${lisp_float_type} | 589 | Should Emacs support a floating point Elisp type? ${lisp_float_type} |
| 583 | # What window system should Emacs use? ${window_system} | 590 | What window system should Emacs use? ${window_system} |
| 584 | # Should Emacs support mouse menus, which require X11? ${have_x_menu} | 591 | Should Emacs support mouse menus, which require X11? ${have_x_menu} |
| 585 | # What compiler should emacs be built with? ${cc} | 592 | What compiler should emacs be built with? ${cc} |
| 586 | # Should the compilation use \`-g' and/or \`-O'? ${c_switch_site- neither}" | 593 | Should the compilation use \`-g' and/or \`-O'? ${c_switch_site- neither}" |
| 587 | 594 | ||
| 588 | # Document the damage we have done by writing config.status. | 595 | # Document the damage we have done by writing config.status. |
| 589 | 596 | ||
| @@ -593,7 +600,7 @@ echo "# This file is generated by \`${progname}.' | |||
| 593 | # If you are thinking about editing it, you should seriously consider | 600 | # If you are thinking about editing it, you should seriously consider |
| 594 | # running \`${progname}' instead. | 601 | # running \`${progname}' instead. |
| 595 | " >> config.status | 602 | " >> config.status |
| 596 | echo "${message}" >> config.status | 603 | echo "${message}" | sed -e 's/^/# /' >> config.status |
| 597 | echo "'./${progname}' ${arguments} "'$@' >> config.status | 604 | echo "'./${progname}' ${arguments} "'$@' >> config.status |
| 598 | # Remind people not to edit this. | 605 | # Remind people not to edit this. |
| 599 | chmod -w config.status | 606 | chmod -w config.status |
| @@ -601,6 +608,6 @@ chmod +x config.status | |||
| 601 | 608 | ||
| 602 | # Print the description. | 609 | # Print the description. |
| 603 | echo | 610 | echo |
| 604 | echo "${message}" | sed -e 's/^# //' | 611 | echo "${message}" |
| 605 | 612 | ||
| 606 | exit 0 | 613 | exit 0 |
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index ba159233bc4..3cbeb19391b 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | ;;;###autoload | ||
| 23 | (defconst only-global-abbrevs nil "\ | 22 | (defconst only-global-abbrevs nil "\ |
| 24 | *t means user plans to use global abbrevs only. | 23 | *t means user plans to use global abbrevs only. |
| 25 | Makes the commands to define mode-specific abbrevs define global ones instead.") | 24 | Makes the commands to define mode-specific abbrevs define global ones instead.") |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 1e3fbd3194b..6eca77808c2 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | ;;; calendar.el --- Calendar functions. | 1 | ;;; calendar.el --- Calendar functions. |
| 2 | 2 | ;;; Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc. | |
| 3 | ;; Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc. | ||
| 4 | 3 | ||
| 5 | ;; This file is part of GNU Emacs. | 4 | ;; This file is part of GNU Emacs. |
| 6 | 5 | ||
| @@ -67,7 +66,7 @@ | |||
| 67 | ;; Software--Practice and Experience, Volume 20, Number 9 (September, 1990), | 66 | ;; Software--Practice and Experience, Volume 20, Number 9 (September, 1990), |
| 68 | ;; pages 899-928. | 67 | ;; pages 899-928. |
| 69 | 68 | ||
| 70 | (defconst calendar-version "Version 4.01, released August 20, 1991") | 69 | (defconst calendar-version "Version 4.02, released June 14, 1992") |
| 71 | 70 | ||
| 72 | (defvar view-diary-entries-initially nil | 71 | (defvar view-diary-entries-initially nil |
| 73 | "*If T, the diary entries for the current date will be displayed on entry. | 72 | "*If T, the diary entries for the current date will be displayed on entry. |
| @@ -102,6 +101,7 @@ The marking symbol is specified by the variable `diary-entry-marker'.") | |||
| 102 | on entry. The holidays are displayed in another window when the calendar is | 101 | on entry. The holidays are displayed in another window when the calendar is |
| 103 | first displayed.") | 102 | first displayed.") |
| 104 | 103 | ||
| 104 | ;;;###autoload | ||
| 105 | (defvar mark-holidays-in-calendar nil | 105 | (defvar mark-holidays-in-calendar nil |
| 106 | "*If t, dates of holidays will be marked in the calendar window. | 106 | "*If t, dates of holidays will be marked in the calendar window. |
| 107 | The marking symbol is specified by the variable `calendar-holiday-marker'.") | 107 | The marking symbol is specified by the variable `calendar-holiday-marker'.") |
| @@ -109,18 +109,21 @@ The marking symbol is specified by the variable `calendar-holiday-marker'.") | |||
| 109 | (defvar calendar-holiday-marker "*" | 109 | (defvar calendar-holiday-marker "*" |
| 110 | "*The symbol used to mark notable dates in the calendar.") | 110 | "*The symbol used to mark notable dates in the calendar.") |
| 111 | 111 | ||
| 112 | ;;;###autoload | ||
| 112 | (defvar all-hebrew-calendar-holidays nil | 113 | (defvar all-hebrew-calendar-holidays nil |
| 113 | "*If nil, the holidays from the Hebrew calendar that are shown will | 114 | "*If nil, the holidays from the Hebrew calendar that are shown will |
| 114 | include only those days of such major interest as to appear on secular | 115 | include only those days of such major interest as to appear on secular |
| 115 | calendars. If t, the holidays shown in the calendar will include all | 116 | calendars. If t, the holidays shown in the calendar will include all |
| 116 | special days that would be shown on a complete Hebrew calendar.") | 117 | special days that would be shown on a complete Hebrew calendar.") |
| 117 | 118 | ||
| 119 | ;;;###autoload | ||
| 118 | (defvar all-christian-calendar-holidays nil | 120 | (defvar all-christian-calendar-holidays nil |
| 119 | "*If nil, the holidays from the Christian calendar that are shown will | 121 | "*If nil, the holidays from the Christian calendar that are shown will |
| 120 | include only those days of such major interest as to appear on secular | 122 | include only those days of such major interest as to appear on secular |
| 121 | calendars. If t, the holidays shown in the calendar will include all | 123 | calendars. If t, the holidays shown in the calendar will include all |
| 122 | special days that would be shown on a complete Christian calendar.") | 124 | special days that would be shown on a complete Christian calendar.") |
| 123 | 125 | ||
| 126 | ;;;###autoload | ||
| 124 | (defvar all-islamic-calendar-holidays nil | 127 | (defvar all-islamic-calendar-holidays nil |
| 125 | "*If nil, the holidays from the Islamic calendar that are shown will | 128 | "*If nil, the holidays from the Islamic calendar that are shown will |
| 126 | include only those days of such major interest as to appear on secular | 129 | include only those days of such major interest as to appear on secular |
| @@ -401,6 +404,7 @@ include, for example, rearranging the lines into order by day and time, | |||
| 401 | saving the buffer instead of deleting it, or changing the function used to | 404 | saving the buffer instead of deleting it, or changing the function used to |
| 402 | do the printing.") | 405 | do the printing.") |
| 403 | 406 | ||
| 407 | ;;;###autoload | ||
| 404 | (defvar list-diary-entries-hook nil | 408 | (defvar list-diary-entries-hook nil |
| 405 | "*List of functions to be called after the diary file is culled for | 409 | "*List of functions to be called after the diary file is culled for |
| 406 | relevant entries. It is to be used for diary entries that are not found in | 410 | relevant entries. It is to be used for diary entries that are not found in |
| @@ -432,6 +436,7 @@ in your .emacs file to cause the fancy diary buffer to be displayed with | |||
| 432 | diary entries from various included files, each day's entries sorted into | 436 | diary entries from various included files, each day's entries sorted into |
| 433 | lexicographic order.") | 437 | lexicographic order.") |
| 434 | 438 | ||
| 439 | ;;;###autoload | ||
| 435 | (defvar diary-display-hook 'simple-diary-display | 440 | (defvar diary-display-hook 'simple-diary-display |
| 436 | "*List of functions that handle the display of the diary. | 441 | "*List of functions that handle the display of the diary. |
| 437 | 442 | ||
| @@ -453,6 +458,7 @@ diary buffer will not show days for which there are no diary entries, even | |||
| 453 | if that day is a holiday; if you want such days to be shown in the fancy | 458 | if that day is a holiday; if you want such days to be shown in the fancy |
| 454 | diary buffer, set the variable `diary-list-include-blanks' to t.") | 459 | diary buffer, set the variable `diary-list-include-blanks' to t.") |
| 455 | 460 | ||
| 461 | ;;;###autoload | ||
| 456 | (defvar nongregorian-diary-listing-hook nil | 462 | (defvar nongregorian-diary-listing-hook nil |
| 457 | "*List of functions to be called for the diary file and included files as | 463 | "*List of functions to be called for the diary file and included files as |
| 458 | they are processed for listing diary entries. You can use any or all of | 464 | they are processed for listing diary entries. You can use any or all of |
| @@ -474,12 +480,14 @@ variable `diary-include-string'. When you use `mark-included-diary-files' as | |||
| 474 | part of the mark-diary-entries-hook, you will probably also want to use the | 480 | part of the mark-diary-entries-hook, you will probably also want to use the |
| 475 | function `include-other-diary-files' as part of the list-diary-entries-hook.") | 481 | function `include-other-diary-files' as part of the list-diary-entries-hook.") |
| 476 | 482 | ||
| 483 | ;;;###autoload | ||
| 477 | (defvar nongregorian-diary-marking-hook nil | 484 | (defvar nongregorian-diary-marking-hook nil |
| 478 | "*List of functions to be called as the diary file and included files are | 485 | "*List of functions to be called as the diary file and included files are |
| 479 | processed for marking diary entries. You can use either or both of | 486 | processed for marking diary entries. You can use either or both of |
| 480 | mark-hebrew-diary-entries and mark-islamic-diary-entries. The documentation | 487 | mark-hebrew-diary-entries and mark-islamic-diary-entries. The documentation |
| 481 | for these functions describes the style of such diary entries.") | 488 | for these functions describes the style of such diary entries.") |
| 482 | 489 | ||
| 490 | ;;;###autoload | ||
| 483 | (defvar diary-list-include-blanks nil | 491 | (defvar diary-list-include-blanks nil |
| 484 | "*If nil, do not include days with no diary entry in the list of diary | 492 | "*If nil, do not include days with no diary entry in the list of diary |
| 485 | entries. Such days will then not be shown in the the fancy diary buffer, | 493 | entries. Such days will then not be shown in the the fancy diary buffer, |
| @@ -693,7 +701,6 @@ the inclusion of the functions `calendar-holiday-function-fixed', | |||
| 693 | `calendar-holiday-function-islamic', `calendar-holiday-function-julian', | 701 | `calendar-holiday-function-islamic', `calendar-holiday-function-julian', |
| 694 | and `calendar-holiday-function-if', respectively.") | 702 | and `calendar-holiday-function-if', respectively.") |
| 695 | 703 | ||
| 696 | |||
| 697 | (defconst calendar-buffer "*Calendar*" | 704 | (defconst calendar-buffer "*Calendar*" |
| 698 | "Name of the buffer used for the calendar.") | 705 | "Name of the buffer used for the calendar.") |
| 699 | 706 | ||
| @@ -726,6 +733,37 @@ sum EXPRESSION." | |||
| 726 | (setq (, index) (1+ (, index)))) | 733 | (setq (, index) (1+ (, index)))) |
| 727 | sum))) | 734 | sum))) |
| 728 | 735 | ||
| 736 | ;; The following macros are for speed; the code would be clearer if they | ||
| 737 | ;; were functions, but they can be called thousands of times when | ||
| 738 | ;; looking up holidays or processing the diary. Here, for example, are the | ||
| 739 | ;; numbers of calls to calendar/diary/holiday functions in preparing the | ||
| 740 | ;; fancy diary display, for a moderately complex diary file, with functions | ||
| 741 | ;; used instead of macros. There were a total of 10000 such calls: | ||
| 742 | ;; | ||
| 743 | ;; 1934 extract-calendar-month | ||
| 744 | ;; 1852 extract-calendar-year | ||
| 745 | ;; 1819 extract-calendar-day | ||
| 746 | ;; 845 calendar-leap-year-p | ||
| 747 | ;; 837 calendar-day-number | ||
| 748 | ;; 775 calendar-absolute-from-gregorian | ||
| 749 | ;; 346 calendar-last-day-of-month | ||
| 750 | ;; 286 hebrew-calendar-last-day-of-month | ||
| 751 | ;; 188 hebrew-calendar-leap-year-p | ||
| 752 | ;; 180 hebrew-calendar-elapsed-days | ||
| 753 | ;; 163 hebrew-calendar-last-month-of-year | ||
| 754 | ;; 66 calendar-date-compare | ||
| 755 | ;; 65 hebrew-calendar-days-in-year | ||
| 756 | ;; 60 calendar-absolute-from-julian | ||
| 757 | ;; 50 calendar-absolute-from-hebrew | ||
| 758 | ;; 43 calendar-date-equal | ||
| 759 | ;; 38 calendar-gregorian-from-absolute | ||
| 760 | ;; . | ||
| 761 | ;; . | ||
| 762 | ;; . | ||
| 763 | ;; | ||
| 764 | ;; The use of these seven macros eliminates the overhead of 92% of the function | ||
| 765 | ;; calls; it's faster this way. | ||
| 766 | |||
| 729 | (defmacro extract-calendar-month (date) | 767 | (defmacro extract-calendar-month (date) |
| 730 | "Extract the month part of DATE which has the form (month day year)." | 768 | "Extract the month part of DATE which has the form (month day year)." |
| 731 | (` (car (, date)))) | 769 | (` (car (, date)))) |
| @@ -738,6 +776,52 @@ sum EXPRESSION." | |||
| 738 | "Extract the year part of DATE which has the form (month day year)." | 776 | "Extract the year part of DATE which has the form (month day year)." |
| 739 | (` (car (cdr (cdr (, date)))))) | 777 | (` (car (cdr (cdr (, date)))))) |
| 740 | 778 | ||
| 779 | (defmacro calendar-leap-year-p (year) | ||
| 780 | "Returns t if YEAR is a Gregorian leap year." | ||
| 781 | (` (or | ||
| 782 | (and (= (% (, year) 4) 0) | ||
| 783 | (/= (% (, year) 100) 0)) | ||
| 784 | (= (% (, year) 400) 0)))) | ||
| 785 | |||
| 786 | (defmacro calendar-last-day-of-month (month year) | ||
| 787 | "The last day in MONTH during YEAR." | ||
| 788 | (` (if (and | ||
| 789 | (, (macroexpand (` (calendar-leap-year-p (, year))))) | ||
| 790 | (= (, month) 2)) | ||
| 791 | 29 | ||
| 792 | (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- (, month)))))) | ||
| 793 | |||
| 794 | (defmacro calendar-day-number (date) | ||
| 795 | "Return the day number within the year of the date DATE. | ||
| 796 | For example, (calendar-day-number '(1 1 1987)) returns the value 1, | ||
| 797 | while (calendar-day-number '(12 31 1980)) returns 366." | ||
| 798 | ;; | ||
| 799 | ;; An explanation of the calculation can be found in PascAlgorithms by | ||
| 800 | ;; Edward and Ruth Reingold, Scott-Foresman/Little, Brown, 1988. | ||
| 801 | ;; | ||
| 802 | (` (let* ((month (, (macroexpand (` (extract-calendar-month (, date)))))) | ||
| 803 | (day (, (macroexpand (` (extract-calendar-day (, date)))))) | ||
| 804 | (year (, (macroexpand (` (extract-calendar-year (, date)))))) | ||
| 805 | (day-of-year (+ day (* 31 (1- month))))) | ||
| 806 | (if (> month 2) | ||
| 807 | (progn | ||
| 808 | (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) | ||
| 809 | (if (, (macroexpand (` (calendar-leap-year-p year)))) | ||
| 810 | (setq day-of-year (1+ day-of-year))))) | ||
| 811 | day-of-year))) | ||
| 812 | |||
| 813 | (defmacro calendar-absolute-from-gregorian (date) | ||
| 814 | "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. | ||
| 815 | The Gregorian date Sunday, December 31, 1 BC is imaginary." | ||
| 816 | (` (let ((month (, (macroexpand (` (extract-calendar-month (, date)))))) | ||
| 817 | (day (, (macroexpand (` (extract-calendar-day (, date)))))) | ||
| 818 | (year (, (macroexpand (` (extract-calendar-year (, date))))))) | ||
| 819 | (+ (, (macroexpand (` (calendar-day-number (, date)))));; Days this year | ||
| 820 | (* 365 (1- year));; + Days in prior years | ||
| 821 | (/ (1- year) 4);; + Julian leap years | ||
| 822 | (- (/ (1- year) 100));; - century years | ||
| 823 | (/ (1- year) 400)))));; + Gregorian leap years | ||
| 824 | |||
| 741 | ;;;###autoload | 825 | ;;;###autoload |
| 742 | (defun calendar (&optional arg) | 826 | (defun calendar (&optional arg) |
| 743 | "Display a three-month calendar in another window. | 827 | "Display a three-month calendar in another window. |
| @@ -944,10 +1028,11 @@ from the first character on the line and does not disturb the first INDENT | |||
| 944 | characters on the line." | 1028 | characters on the line." |
| 945 | (let* ((first-day-of-month (calendar-day-of-week (list month 1 year))) | 1029 | (let* ((first-day-of-month (calendar-day-of-week (list month 1 year))) |
| 946 | (first-saturday (- 7 first-day-of-month)) | 1030 | (first-saturday (- 7 first-day-of-month)) |
| 947 | (last (calendar-last-day-of-month month year))) | 1031 | (last (calendar-last-day-of-month month year)) |
| 1032 | (heading (format "%s %d" (calendar-month-name month) year))) | ||
| 948 | (goto-char (point-min)) | 1033 | (goto-char (point-min)) |
| 949 | (calendar-insert-indented | 1034 | (calendar-insert-indented |
| 950 | (format " %s %d" (calendar-month-name month) year) indent t) | 1035 | heading (+ indent (/ (- 20 (length heading)) 2)) t) |
| 951 | (calendar-insert-indented " S M Tu W Th F S" indent t) | 1036 | (calendar-insert-indented " S M Tu W Th F S" indent t) |
| 952 | (calendar-insert-indented "" indent);; Move to appropriate spot on line | 1037 | (calendar-insert-indented "" indent);; Move to appropriate spot on line |
| 953 | ;; Add blank days before the first of the month | 1038 | ;; Add blank days before the first of the month |
| @@ -1902,32 +1987,6 @@ is a string to insert in the minibuffer before reading." | |||
| 1902 | (+ (* 12 (- yr2 yr1)) | 1987 | (+ (* 12 (- yr2 yr1)) |
| 1903 | (- mon2 mon1))) | 1988 | (- mon2 mon1))) |
| 1904 | 1989 | ||
| 1905 | (defun calendar-leap-year-p (year) | ||
| 1906 | "Returns t if YEAR is a Gregorian leap year." | ||
| 1907 | (or | ||
| 1908 | (and (= (% year 4) 0) | ||
| 1909 | (/= (% year 100) 0)) | ||
| 1910 | (= (% year 400) 0))) | ||
| 1911 | |||
| 1912 | (defun calendar-day-number (date) | ||
| 1913 | "Return the day number within the year of the date DATE. | ||
| 1914 | For example, (calendar-day-number '(1 1 1987)) returns the value 1, | ||
| 1915 | while (calendar-day-number '(12 31 1980)) returns 366." | ||
| 1916 | ;; | ||
| 1917 | ;; An explanation of the calculation can be found in PascAlgorithms by | ||
| 1918 | ;; Edward and Ruth Reingold, Scott-Foresman/Little, Brown, 1988. | ||
| 1919 | ;; | ||
| 1920 | (let* ((month (extract-calendar-month date)) | ||
| 1921 | (day (extract-calendar-day date)) | ||
| 1922 | (year (extract-calendar-year date)) | ||
| 1923 | (day-of-year (+ day (* 31 (1- month))))) | ||
| 1924 | (if (> month 2) | ||
| 1925 | (progn | ||
| 1926 | (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) | ||
| 1927 | (if (calendar-leap-year-p year) | ||
| 1928 | (setq day-of-year (1+ day-of-year))))) | ||
| 1929 | day-of-year)) | ||
| 1930 | |||
| 1931 | (defun calendar-day-name (date) | 1990 | (defun calendar-day-name (date) |
| 1932 | "Returns a string with the name of the day of the week of DATE." | 1991 | "Returns a string with the name of the day of the week of DATE." |
| 1933 | (aref calendar-day-name-array (calendar-day-of-week date))) | 1992 | (aref calendar-day-name-array (calendar-day-of-week date))) |
| @@ -1935,12 +1994,6 @@ while (calendar-day-number '(12 31 1980)) returns 366." | |||
| 1935 | (defconst calendar-day-name-array | 1994 | (defconst calendar-day-name-array |
| 1936 | ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"]) | 1995 | ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"]) |
| 1937 | 1996 | ||
| 1938 | (defun calendar-last-day-of-month (month year) | ||
| 1939 | "The last day in MONTH during YEAR." | ||
| 1940 | (if (and (calendar-leap-year-p year) (= month 2)) | ||
| 1941 | 29 | ||
| 1942 | (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) | ||
| 1943 | |||
| 1944 | (defconst calendar-month-name-array | 1997 | (defconst calendar-month-name-array |
| 1945 | ["January" "February" "March" "April" "May" "June" | 1998 | ["January" "February" "March" "April" "May" "June" |
| 1946 | "July" "August" "September" "October" "November" "December"]) | 1999 | "July" "August" "September" "October" "November" "December"]) |
| @@ -1965,18 +2018,6 @@ If FILTER is provided, apply it to each item in the list." | |||
| 1965 | "Returns the day-of-the-week index of DATE, 0 for Sunday, 1 for Monday, etc." | 2018 | "Returns the day-of-the-week index of DATE, 0 for Sunday, 1 for Monday, etc." |
| 1966 | (% (calendar-absolute-from-gregorian date) 7)) | 2019 | (% (calendar-absolute-from-gregorian date) 7)) |
| 1967 | 2020 | ||
| 1968 | (defun calendar-absolute-from-gregorian (date) | ||
| 1969 | "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. | ||
| 1970 | The Gregorian date Sunday, December 31, 1 BC is imaginary." | ||
| 1971 | (let ((month (extract-calendar-month date)) | ||
| 1972 | (day (extract-calendar-day date)) | ||
| 1973 | (year (extract-calendar-year date))) | ||
| 1974 | (+ (calendar-day-number date);; Days this year | ||
| 1975 | (* 365 (1- year));; + Days in prior years | ||
| 1976 | (/ (1- year) 4);; + Julian leap years | ||
| 1977 | (- (/ (1- year) 100));; - century years | ||
| 1978 | (/ (1- year) 400))));; + Gregorian leap years | ||
| 1979 | |||
| 1980 | (defun calendar-unmark () | 2021 | (defun calendar-unmark () |
| 1981 | "Delete the diary and holiday marks from the calendar." | 2022 | "Delete the diary and holiday marks from the calendar." |
| 1982 | (interactive) | 2023 | (interactive) |
| @@ -2459,6 +2500,94 @@ Gregorian date Sunday, December 31, 1 BC." | |||
| 2459 | calendar-hebrew-month-name-array-common-year))) | 2500 | calendar-hebrew-month-name-array-common-year))) |
| 2460 | (message "Hebrew date: %s" (calendar-date-string hebrew-date nil t)))) | 2501 | (message "Hebrew date: %s" (calendar-date-string hebrew-date nil t)))) |
| 2461 | 2502 | ||
| 2503 | (defun hebrew-calendar-yahrzeit (death-date year) | ||
| 2504 | "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR." | ||
| 2505 | (let* ((death-day (extract-calendar-day death-date)) | ||
| 2506 | (death-month (extract-calendar-month death-date)) | ||
| 2507 | (death-year (extract-calendar-year death-date))) | ||
| 2508 | (cond | ||
| 2509 | ;; If it's Heshvan 30 it depends on the first anniversary; if | ||
| 2510 | ;; that was not Heshvan 30, use the day before Kislev 1. | ||
| 2511 | ((and (= death-month 8) | ||
| 2512 | (= death-day 30) | ||
| 2513 | (not (hebrew-calendar-long-heshvan-p (1+ death-year)))) | ||
| 2514 | (1- (calendar-absolute-from-hebrew (list 9 1 year)))) | ||
| 2515 | ;; If it's Kislev 30 it depends on the first anniversary; if | ||
| 2516 | ;; that was not Kislev 30, use the day before Teveth 1. | ||
| 2517 | ((and (= death-month 9) | ||
| 2518 | (= death-day 30) | ||
| 2519 | (hebrew-calendar-short-kislev-p (1+ death-year))) | ||
| 2520 | (1- (calendar-absolute-from-hebrew (list 10 1 year)))) | ||
| 2521 | ;; If it's Adar II, use the same day in last month of | ||
| 2522 | ;; year (Adar or Adar II). | ||
| 2523 | ((= death-month 13) | ||
| 2524 | (calendar-absolute-from-hebrew | ||
| 2525 | (list (last-month-of-hebrew-year year) death-day year))) | ||
| 2526 | ;; If it's the 30th in Adar I and $year$ is not a leap year | ||
| 2527 | ;; (so Adar has only 29 days), use the last day in Shevat. | ||
| 2528 | ((and (= death-day 30) | ||
| 2529 | (= death-month 12) | ||
| 2530 | (not (hebrew-calendar-leap-year-p death-year))) | ||
| 2531 | (calendar-absolute-from-hebrew (list 11 30 year))) | ||
| 2532 | ;; In all other cases, use the normal anniversary of the date of death. | ||
| 2533 | (t (calendar-absolute-from-hebrew | ||
| 2534 | (list death-month death-day year)))))) | ||
| 2535 | |||
| 2536 | (defun list-yahrzeit-dates (death-date start-year end-year) | ||
| 2537 | "List of Yahrzeit dates for *Gregorian* DEATH-DATE | ||
| 2538 | from START-YEAR to END-YEAR. When called interactively | ||
| 2539 | the date of death is taken from the cursor in the calendar window." | ||
| 2540 | (interactive | ||
| 2541 | (let* ((death-date (calendar-cursor-to-date)) | ||
| 2542 | (death-year (extract-calendar-year death-date)) | ||
| 2543 | (start-year (calendar-read | ||
| 2544 | (format "Starting year of Yahrzeit table (>%d): " | ||
| 2545 | death-year) | ||
| 2546 | '(lambda (x) (> x death-year)) | ||
| 2547 | (int-to-string (1+ death-year)))) | ||
| 2548 | (end-year (calendar-read | ||
| 2549 | (format "Ending year of Yahrzeit table (>=%d): " | ||
| 2550 | start-year) | ||
| 2551 | '(lambda (x) (>= x start-year))))) | ||
| 2552 | (list death-date start-year end-year))) | ||
| 2553 | (message "Computing yahrzeits...") | ||
| 2554 | (let* ((yahrzeit-buffer "*Yahrzeits*") | ||
| 2555 | (h-date (calendar-hebrew-from-absolute | ||
| 2556 | (calendar-absolute-from-gregorian death-date))) | ||
| 2557 | (h-month (extract-calendar-month h-date)) | ||
| 2558 | (h-day (extract-calendar-day h-date)) | ||
| 2559 | (h-year (extract-calendar-year h-date))) | ||
| 2560 | (set-buffer (get-buffer-create yahrzeit-buffer)) | ||
| 2561 | (setq buffer-read-only nil) | ||
| 2562 | (setq mode-line-format | ||
| 2563 | (format "------Yahrzeit dates for %s = %s%%-" | ||
| 2564 | (calendar-date-string death-date) | ||
| 2565 | (let ((calendar-month-name-array | ||
| 2566 | (if (hebrew-calendar-leap-year-p h-year) | ||
| 2567 | calendar-hebrew-month-name-array-leap-year | ||
| 2568 | calendar-hebrew-month-name-array-common-year)) | ||
| 2569 | (calendar-date-display-form | ||
| 2570 | (if european-calendar-style | ||
| 2571 | '(day " " monthname " " year) | ||
| 2572 | '(monthname " " day ", " year)))) | ||
| 2573 | (calendar-date-string h-date nil t)))) | ||
| 2574 | (erase-buffer) | ||
| 2575 | (goto-char (point-min)) | ||
| 2576 | (calendar-for-loop i from start-year to end-year do | ||
| 2577 | (insert | ||
| 2578 | (calendar-date-string | ||
| 2579 | (calendar-gregorian-from-absolute | ||
| 2580 | (hebrew-calendar-yahrzeit | ||
| 2581 | h-date | ||
| 2582 | (extract-calendar-year | ||
| 2583 | (calendar-hebrew-from-absolute | ||
| 2584 | (calendar-absolute-from-gregorian (list 1 1 i))))))) "\n")) | ||
| 2585 | (goto-char (point-min)) | ||
| 2586 | (set-buffer-modified-p nil) | ||
| 2587 | (setq buffer-read-only t) | ||
| 2588 | (display-buffer yahrzeit-buffer) | ||
| 2589 | (message "Computing yahrzeits...done"))) | ||
| 2590 | |||
| 2462 | (defun french-calendar-leap-year-p (year) | 2591 | (defun french-calendar-leap-year-p (year) |
| 2463 | "True if YEAR is a leap year on the French Revolutionary calendar. | 2592 | "True if YEAR is a leap year on the French Revolutionary calendar. |
| 2464 | For Gregorian years 1793 to 1805, the years of actual operation of the | 2593 | For Gregorian years 1793 to 1805, the years of actual operation of the |
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 437be3c5aba..4f3c0daf7bd 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | ;;; holidays.el --- holiday functions for the calendar package | 1 | ;;; holidays.el --- holiday functions for the calendar package |
| 2 | 2 | ;;; Copyright (C) 1989, 1990 Free Software Foundation, Inc. | |
| 3 | ;; Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc. | ||
| 4 | 3 | ||
| 5 | ;; This file is part of GNU Emacs. | 4 | ;; This file is part of GNU Emacs. |
| 6 | 5 | ||
| @@ -34,6 +33,8 @@ | |||
| 34 | ;; pages 899-928. | 33 | ;; pages 899-928. |
| 35 | 34 | ||
| 36 | (require 'calendar) | 35 | (require 'calendar) |
| 36 | |||
| 37 | ;;;###autoload | ||
| 37 | (defun holidays () | 38 | (defun holidays () |
| 38 | "Display the holidays for last month, this month, and next month. | 39 | "Display the holidays for last month, this month, and next month. |
| 39 | This function is suitable for execution in a .emacs file." | 40 | This function is suitable for execution in a .emacs file." |
| @@ -62,7 +63,8 @@ The holidays are those in the list calendar-holidays." | |||
| 62 | "Find holidays for the date specified by the cursor in the calendar window." | 63 | "Find holidays for the date specified by the cursor in the calendar window." |
| 63 | (interactive) | 64 | (interactive) |
| 64 | (message "Checking holidays...") | 65 | (message "Checking holidays...") |
| 65 | (let* ((date (calendar-cursor-to-date)) | 66 | (let* ((date (or (calendar-cursor-to-date) |
| 67 | (error "Cursor is not on a date!"))) | ||
| 66 | (date-string (calendar-date-string date)) | 68 | (date-string (calendar-date-string date)) |
| 67 | (holiday-list (check-calendar-holidays date)) | 69 | (holiday-list (check-calendar-holidays date)) |
| 68 | (holiday-string (mapconcat 'identity holiday-list "; ")) | 70 | (holiday-string (mapconcat 'identity holiday-list "; ")) |
diff --git a/lisp/completion.el b/lisp/completion.el index 6ae62aa8a64..c62673649bf 100644 --- a/lisp/completion.el +++ b/lisp/completion.el | |||
| @@ -2834,8 +2834,8 @@ Patched to remove the most recent completion." | |||
| 2834 | (use-completion-before-separator) | 2834 | (use-completion-before-separator) |
| 2835 | (self-insert-command arg) | 2835 | (self-insert-command arg) |
| 2836 | (and (> (current-column) fill-column) | 2836 | (and (> (current-column) fill-column) |
| 2837 | auto-fill-hook | 2837 | auto-fill-function |
| 2838 | (funcall auto-fill-hook)) | 2838 | (funcall auto-fill-function)) |
| 2839 | ) | 2839 | ) |
| 2840 | 2840 | ||
| 2841 | ;;;----------------------------------------------- | 2841 | ;;;----------------------------------------------- |
diff --git a/lisp/diary-lib.el b/lisp/diary-lib.el index 83e22d52aa4..b28836ce110 100644 --- a/lisp/diary-lib.el +++ b/lisp/diary-lib.el | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | ;;; diary.el --- diary functions. | 1 | ;;; diary.el --- diary functions. |
| 2 | 2 | ;; Copyright (C) 1989, 1990 Free Software Foundation, Inc. | |
| 3 | ;; Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc. | ||
| 4 | 3 | ||
| 5 | ;; This file is part of GNU Emacs. | 4 | ;; This file is part of GNU Emacs. |
| 6 | 5 | ||
| @@ -29,6 +28,8 @@ | |||
| 29 | ;; Urbana, Illinois 61801 | 28 | ;; Urbana, Illinois 61801 |
| 30 | 29 | ||
| 31 | (require 'calendar) | 30 | (require 'calendar) |
| 31 | |||
| 32 | ;;;###autoload | ||
| 32 | (defun diary (&optional arg) | 33 | (defun diary (&optional arg) |
| 33 | "Generate the diary window for ARG days starting with the current date. | 34 | "Generate the diary window for ARG days starting with the current date. |
| 34 | If no argument is provided, the number of days of diary entries is governed | 35 | If no argument is provided, the number of days of diary entries is governed |
| @@ -1254,8 +1255,8 @@ ending of that number (that is, `st', `nd', `rd' or `th', as appropriate." | |||
| 1254 | 1255 | ||
| 1255 | (defun diary-ordinal-suffix (n) | 1256 | (defun diary-ordinal-suffix (n) |
| 1256 | "Ordinal suffix for N. (That is, `st', `nd', `rd', or `th', as appropriate.)" | 1257 | "Ordinal suffix for N. (That is, `st', `nd', `rd', or `th', as appropriate.)" |
| 1257 | (if (or (and (< 9 n) (< n 20)) | 1258 | (if (or (memq (% n 100) '(11 12 13)) |
| 1258 | (memq (% n 10) '(4 5 6 7 8 9 0))) | 1259 | (< 3 (% n 10))) |
| 1259 | "th" | 1260 | "th" |
| 1260 | (aref ["th" "st" "nd" "rd"] (% n 10)))) | 1261 | (aref ["th" "st" "nd" "rd"] (% n 10)))) |
| 1261 | 1262 | ||
| @@ -1374,8 +1375,8 @@ order of the parameters is changed to DEATH-DAY, DEATH-MONTH, DEATH-YEAR." | |||
| 1374 | (t "th")))))) | 1375 | (t "th")))))) |
| 1375 | 1376 | ||
| 1376 | (defun diary-rosh-hodesh () | 1377 | (defun diary-rosh-hodesh () |
| 1377 | "Rosh Hodesh diary entry--entry applies if date is Rosh Hodesh or the | 1378 | "Rosh Hodesh diary entry--entry applies if date is Rosh Hodesh, the day |
| 1378 | Saturday before." | 1379 | before, or the Saturday before." |
| 1379 | (let* ((d (calendar-absolute-from-gregorian date)) | 1380 | (let* ((d (calendar-absolute-from-gregorian date)) |
| 1380 | (h-date (calendar-hebrew-from-absolute d)) | 1381 | (h-date (calendar-hebrew-from-absolute d)) |
| 1381 | (h-month (extract-calendar-month h-date)) | 1382 | (h-month (extract-calendar-month h-date)) |
| @@ -1415,9 +1416,18 @@ Saturday before." | |||
| 1415 | ((and (< h-day 30) (> h-day 22) (= 30 last-day)) | 1416 | ((and (< h-day 30) (> h-day 22) (= 30 last-day)) |
| 1416 | (format "Mevarhim Rosh Hodesh %s (%s-%s)" | 1417 | (format "Mevarhim Rosh Hodesh %s (%s-%s)" |
| 1417 | (aref h-month-names h-month) | 1418 | (aref h-month-names h-month) |
| 1418 | (aref calendar-day-name-array (- 29 h-day)) | 1419 | (if (= h-day 29) |
| 1420 | "tomorrow" | ||
| 1421 | (aref calendar-day-name-array (- 29 h-day))) | ||
| 1419 | (aref calendar-day-name-array | 1422 | (aref calendar-day-name-array |
| 1420 | (mod (- 30 h-day) 7))))))))) | 1423 | (mod (- 30 h-day) 7))))) |
| 1424 | (if (and (= h-day 29) (/= h-month 6)) | ||
| 1425 | (format "Erev Rosh Hodesh %s" | ||
| 1426 | (aref h-month-names | ||
| 1427 | (if (= h-month | ||
| 1428 | (hebrew-calendar-last-month-of-year | ||
| 1429 | h-year)) | ||
| 1430 | 0 h-month)))))))) | ||
| 1421 | 1431 | ||
| 1422 | (defun diary-parasha () | 1432 | (defun diary-parasha () |
| 1423 | "Parasha diary entry--entry applies if date is a Saturday." | 1433 | "Parasha diary entry--entry applies if date is a Saturday." |
| @@ -1606,39 +1616,6 @@ start on Tuesday.") | |||
| 1606 | (aref hebrew-calendar-parashiot-names (aref p 1))) | 1616 | (aref hebrew-calendar-parashiot-names (aref p 1))) |
| 1607 | (aref hebrew-calendar-parashiot-names p))) | 1617 | (aref hebrew-calendar-parashiot-names p))) |
| 1608 | 1618 | ||
| 1609 | (defun hebrew-calendar-yahrzeit (death-date year) | ||
| 1610 | "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR." | ||
| 1611 | (let* ((death-day (extract-calendar-day death-date)) | ||
| 1612 | (death-month (extract-calendar-month death-date)) | ||
| 1613 | (death-year (extract-calendar-year death-date))) | ||
| 1614 | (cond | ||
| 1615 | ;; If it's Heshvan 30 it depends on the first anniversary; if | ||
| 1616 | ;; that was not Heshvan 30, use the day before Kislev 1. | ||
| 1617 | ((and (= death-month 8) | ||
| 1618 | (= death-day 30) | ||
| 1619 | (not (hebrew-calendar-long-heshvan-p (1+ death-year)))) | ||
| 1620 | (1- (calendar-absolute-from-hebrew (list 9 1 year)))) | ||
| 1621 | ;; If it's Kislev 30 it depends on the first anniversary; if | ||
| 1622 | ;; that was not Kislev 30, use the day before Teveth 1. | ||
| 1623 | ((and (= death-month 9) | ||
| 1624 | (= death-day 30) | ||
| 1625 | (hebrew-calendar-short-kislev-p (1+ death-year))) | ||
| 1626 | (1- (calendar-absolute-from-hebrew (list 10 1 year)))) | ||
| 1627 | ;; If it's Adar II, use the same day in last month of | ||
| 1628 | ;; year (Adar or Adar II). | ||
| 1629 | ((= death-month 13) | ||
| 1630 | (calendar-absolute-from-hebrew | ||
| 1631 | (list (last-month-of-hebrew-year year) death-day year))) | ||
| 1632 | ;; If it's the 30th in Adar I and $year$ is not a leap year | ||
| 1633 | ;; (so Adar has only 29 days), use the last day in Shevat. | ||
| 1634 | ((and (= death-day 30) | ||
| 1635 | (= death-month 12) | ||
| 1636 | (not (hebrew-calendar-leap-year-p death-year))) | ||
| 1637 | (calendar-absolute-from-hebrew (list 11 30 year))) | ||
| 1638 | ;; In all other cases, use the normal anniversary of the date of death. | ||
| 1639 | (t (calendar-absolute-from-hebrew | ||
| 1640 | (list death-month death-day year)))))) | ||
| 1641 | |||
| 1642 | (defun list-islamic-diary-entries () | 1619 | (defun list-islamic-diary-entries () |
| 1643 | "Add any Islamic date entries from the diary-file to diary-entries-list. | 1620 | "Add any Islamic date entries from the diary-file to diary-entries-list. |
| 1644 | Islamic date diary entries must be prefaced by an islamic-diary-entry-symbol | 1621 | Islamic date diary entries must be prefaced by an islamic-diary-entry-symbol |
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 767621adbd2..c6916a3dd56 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -107,7 +107,7 @@ are used." | |||
| 107 | ;; under a different path on another system, | 107 | ;; under a different path on another system, |
| 108 | ;; `update-autoloads-here' won't be able to find the files to be | 108 | ;; `update-autoloads-here' won't be able to find the files to be |
| 109 | ;; autoloaded. So, if FILE is in the same directory or a | 109 | ;; autoloaded. So, if FILE is in the same directory or a |
| 110 | ;; subdirectory of the current buffer's file, we'll make it | 110 | ;; subdirectory of the current buffer's directory, we'll make it |
| 111 | ;; relative to the current buffer's directory. | 111 | ;; relative to the current buffer's directory. |
| 112 | (setq file (expand-file-name file)) | 112 | (setq file (expand-file-name file)) |
| 113 | (if (and (< (length default-directory) (length file)) | 113 | (if (and (< (length default-directory) (length file)) |
diff --git a/lisp/help.el b/lisp/help.el index 48e34665732..91a947c99e7 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | ;; along with GNU Emacs; see the file COPYING. If not, write to | 18 | ;; along with GNU Emacs; see the file COPYING. If not, write to |
| 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | 20 | ||
| 21 | ;;;###autoload | ||
| 22 | (defvar help-map (make-sparse-keymap) | 21 | (defvar help-map (make-sparse-keymap) |
| 23 | "Keymap for characters following the Help key.") | 22 | "Keymap for characters following the Help key.") |
| 24 | 23 | ||
| @@ -42,6 +41,8 @@ | |||
| 42 | (define-key help-map "f" 'describe-function) | 41 | (define-key help-map "f" 'describe-function) |
| 43 | 42 | ||
| 44 | (define-key help-map "i" 'info) | 43 | (define-key help-map "i" 'info) |
| 44 | (define-key help-map "\C-f" 'Info-goto-emacs-command-node) | ||
| 45 | (define-key help-map "\C-k" 'Info-goto-emacs-key-command-node) | ||
| 45 | 46 | ||
| 46 | (define-key help-map "l" 'view-lossage) | 47 | (define-key help-map "l" 'view-lossage) |
| 47 | 48 | ||
diff --git a/lisp/indent.el b/lisp/indent.el index 76f16ac4555..2990a5ae2df 100644 --- a/lisp/indent.el +++ b/lisp/indent.el | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | ;;;###autoload | ||
| 23 | (defvar indent-line-function 'indent-to-left-margin "\ | 22 | (defvar indent-line-function 'indent-to-left-margin "\ |
| 24 | Function to indent current line.");Now in loaddefs.el | 23 | Function to indent current line.");Now in loaddefs.el |
| 25 | 24 | ||
diff --git a/lisp/info.el b/lisp/info.el index 7d0f0d61fed..a59bf013fc3 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -978,8 +978,6 @@ The locations are of the format used in Info-history, i.e. | |||
| 978 | (if (> num-matches 2) "ies" "y") | 978 | (if (> num-matches 2) "ies" "y") |
| 979 | (if (> num-matches 2) "them" "it")))))) | 979 | (if (> num-matches 2) "them" "it")))))) |
| 980 | (error "Couldn't find documentation for %s." command)))) | 980 | (error "Couldn't find documentation for %s." command)))) |
| 981 | ;;;###autoload | ||
| 982 | (define-key help-map "\C-f" 'Info-goto-emacs-command-node) | ||
| 983 | 981 | ||
| 984 | ;;;###autoload | 982 | ;;;###autoload |
| 985 | (defun Info-goto-emacs-key-command-node (key) | 983 | (defun Info-goto-emacs-key-command-node (key) |
| @@ -995,8 +993,6 @@ Interactively, if the binding is execute-extended-command, a command is read." | |||
| 995 | (read-command "Find documentation for command: "))) | 993 | (read-command "Find documentation for command: "))) |
| 996 | (t | 994 | (t |
| 997 | (Info-goto-emacs-command-node command))))) | 995 | (Info-goto-emacs-command-node command))))) |
| 998 | ;;;###autoload | ||
| 999 | (define-key help-map "\C-k" 'Info-goto-emacs-key-command-node) | ||
| 1000 | 996 | ||
| 1001 | (provide 'info) | 997 | (provide 'info) |
| 1002 | 998 | ||
diff --git a/lisp/isearch-old.el b/lisp/isearch-old.el index 68dc943a73a..265ea6b5682 100644 --- a/lisp/isearch-old.el +++ b/lisp/isearch-old.el | |||
| @@ -18,59 +18,45 @@ | |||
| 18 | ;; along with GNU Emacs; see the file COPYING. If not, write to | 18 | ;; along with GNU Emacs; see the file COPYING. If not, write to |
| 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | 20 | ||
| 21 | ;;;###autoload | ||
| 22 | (defvar search-last-string "" "\ | 21 | (defvar search-last-string "" "\ |
| 23 | Last string search for by a non-regexp search command. | 22 | Last string search for by a non-regexp search command. |
| 24 | This does not include direct calls to the primitive search functions, | 23 | This does not include direct calls to the primitive search functions, |
| 25 | and does not include searches that are aborted.") | 24 | and does not include searches that are aborted.") |
| 26 | 25 | ||
| 27 | ;;;###autoload | ||
| 28 | (defvar search-last-regexp "" "\ | 26 | (defvar search-last-regexp "" "\ |
| 29 | Last string searched for by a regexp search command. | 27 | Last string searched for by a regexp search command. |
| 30 | This does not include direct calls to the primitive search functions, | 28 | This does not include direct calls to the primitive search functions, |
| 31 | and does not include searches that are aborted.") | 29 | and does not include searches that are aborted.") |
| 32 | 30 | ||
| 33 | 31 | ||
| 34 | ;;;###autoload | ||
| 35 | (defconst search-repeat-char ?\C-s "\ | 32 | (defconst search-repeat-char ?\C-s "\ |
| 36 | *Character to repeat incremental search forwards.") | 33 | *Character to repeat incremental search forwards.") |
| 37 | ;;;###autoload | ||
| 38 | (defconst search-reverse-char ?\C-r "\ | 34 | (defconst search-reverse-char ?\C-r "\ |
| 39 | *Character to repeat incremental search backwards.") | 35 | *Character to repeat incremental search backwards.") |
| 40 | ;;;###autoload | ||
| 41 | (defconst search-exit-char ?\C-m "\ | 36 | (defconst search-exit-char ?\C-m "\ |
| 42 | *Character to exit incremental search.") | 37 | *Character to exit incremental search.") |
| 43 | ;;;###autoload | ||
| 44 | (defconst search-delete-char ?\177 "\ | 38 | (defconst search-delete-char ?\177 "\ |
| 45 | *Character to delete from incremental search string.") | 39 | *Character to delete from incremental search string.") |
| 46 | ;;;###autoload | ||
| 47 | (defconst search-quote-char ?\C-q "\ | 40 | (defconst search-quote-char ?\C-q "\ |
| 48 | *Character to quote special characters for incremental search.") | 41 | *Character to quote special characters for incremental search.") |
| 49 | ;;;###autoload | ||
| 50 | (defconst search-yank-word-char ?\C-w "\ | 42 | (defconst search-yank-word-char ?\C-w "\ |
| 51 | *Character to pull next word from buffer into search string.") | 43 | *Character to pull next word from buffer into search string.") |
| 52 | ;;;###autoload | ||
| 53 | (defconst search-yank-line-char ?\C-y "\ | 44 | (defconst search-yank-line-char ?\C-y "\ |
| 54 | *Character to pull rest of line from buffer into search string.") | 45 | *Character to pull rest of line from buffer into search string.") |
| 55 | ;;;###autoload | ||
| 56 | (defconst search-ring-advance-char ?\M-n "\ | 46 | (defconst search-ring-advance-char ?\M-n "\ |
| 57 | *Character to pull next (more recent) search string from the ring of same.") | 47 | *Character to pull next (more recent) search string from the ring of same.") |
| 58 | ;;;###autoload | ||
| 59 | (defconst search-ring-retreat-char ?\M-p "\ | 48 | (defconst search-ring-retreat-char ?\M-p "\ |
| 60 | *Character to pull previous (older) search string from the ring of same.") | 49 | *Character to pull previous (older) search string from the ring of same.") |
| 61 | 50 | ||
| 62 | ;;;###autoload | ||
| 63 | (defconst search-exit-option t "\ | 51 | (defconst search-exit-option t "\ |
| 64 | *Non-nil means random control characters terminate incremental search.") | 52 | *Non-nil means random control characters terminate incremental search.") |
| 65 | 53 | ||
| 66 | ;;;###autoload | ||
| 67 | (defvar search-slow-window-lines 1 "\ | 54 | (defvar search-slow-window-lines 1 "\ |
| 68 | *Number of lines in slow search display windows. | 55 | *Number of lines in slow search display windows. |
| 69 | These are the short windows used during incremental search on slow terminals. | 56 | These are the short windows used during incremental search on slow terminals. |
| 70 | Negative means put the slow search window at the top (normally it's at bottom) | 57 | Negative means put the slow search window at the top (normally it's at bottom) |
| 71 | and the value is minus the number of lines.") | 58 | and the value is minus the number of lines.") |
| 72 | 59 | ||
| 73 | ;;;###autoload | ||
| 74 | (defvar search-slow-speed 1200 "\ | 60 | (defvar search-slow-speed 1200 "\ |
| 75 | *Highest terminal speed at which to use \"slow\" style incremental search. | 61 | *Highest terminal speed at which to use \"slow\" style incremental search. |
| 76 | This is the style where a one-line window is created to show the line | 62 | This is the style where a one-line window is created to show the line |
| @@ -104,7 +90,6 @@ Each element is a cons cell of the form (STRING . UPPERCASE-FLAG).") | |||
| 104 | thing searched for.") | 90 | thing searched for.") |
| 105 | 91 | ||
| 106 | 92 | ||
| 107 | ;;;###autoload | ||
| 108 | (defun isearch-forward () | 93 | (defun isearch-forward () |
| 109 | "Do incremental search forward. | 94 | "Do incremental search forward. |
| 110 | As you type characters, they add to the search string and are found. | 95 | As you type characters, they add to the search string and are found. |
| @@ -123,36 +108,29 @@ C-g while searching or when search has failed | |||
| 123 | C-g when search is successful aborts and moves point to starting point." | 108 | C-g when search is successful aborts and moves point to starting point." |
| 124 | (interactive) | 109 | (interactive) |
| 125 | (isearch t)) | 110 | (isearch t)) |
| 126 | ;;;###autoload | ||
| 127 | (define-key global-map "\C-s" 'isearch-forward) | 111 | (define-key global-map "\C-s" 'isearch-forward) |
| 128 | 112 | ||
| 129 | ;;;###autoload | ||
| 130 | (defun isearch-forward-regexp () | 113 | (defun isearch-forward-regexp () |
| 131 | "Do incremental search forward for regular expression. | 114 | "Do incremental search forward for regular expression. |
| 132 | Like ordinary incremental search except that your input | 115 | Like ordinary incremental search except that your input |
| 133 | is treated as a regexp. See \\[isearch-forward] for more info." | 116 | is treated as a regexp. See \\[isearch-forward] for more info." |
| 134 | (interactive) | 117 | (interactive) |
| 135 | (isearch t t)) | 118 | (isearch t t)) |
| 136 | ;;;###autoload | ||
| 137 | (define-key esc-map "\C-s" 'isearch-forward-regexp) | 119 | (define-key esc-map "\C-s" 'isearch-forward-regexp) |
| 138 | 120 | ||
| 139 | ;;;###autoload | ||
| 140 | (defun isearch-backward () | 121 | (defun isearch-backward () |
| 141 | "Do incremental search backward. | 122 | "Do incremental search backward. |
| 142 | See \\[isearch-forward] for more information." | 123 | See \\[isearch-forward] for more information." |
| 143 | (interactive) | 124 | (interactive) |
| 144 | (isearch nil)) | 125 | (isearch nil)) |
| 145 | ;;;###autoload | ||
| 146 | (define-key global-map "\C-r" 'isearch-backward) | 126 | (define-key global-map "\C-r" 'isearch-backward) |
| 147 | 127 | ||
| 148 | ;;;###autoload | ||
| 149 | (defun isearch-backward-regexp () | 128 | (defun isearch-backward-regexp () |
| 150 | "Do incremental search backward for regular expression. | 129 | "Do incremental search backward for regular expression. |
| 151 | Like ordinary incremental search except that your input | 130 | Like ordinary incremental search except that your input |
| 152 | is treated as a regexp. See \\[isearch-forward] for more info." | 131 | is treated as a regexp. See \\[isearch-forward] for more info." |
| 153 | (interactive) | 132 | (interactive) |
| 154 | (isearch nil t)) | 133 | (isearch nil t)) |
| 155 | ;;;###autoload | ||
| 156 | (define-key esc-map "\C-r" 'isearch-backward-regexp) | 134 | (define-key esc-map "\C-r" 'isearch-backward-regexp) |
| 157 | 135 | ||
| 158 | 136 | ||
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index ac1be6b9773..016b31b0bf9 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -272,6 +272,7 @@ means the default). The defaults for these variables are the global values of | |||
| 272 | (set-buffer outbuf) | 272 | (set-buffer outbuf) |
| 273 | (compilation-mode) | 273 | (compilation-mode) |
| 274 | (buffer-disable-undo (current-buffer)) | 274 | (buffer-disable-undo (current-buffer)) |
| 275 | (setq buffer-read-only t) | ||
| 275 | (set (make-local-variable 'compilation-parse-errors-function) parser) | 276 | (set (make-local-variable 'compilation-parse-errors-function) parser) |
| 276 | (set (make-local-variable 'compilation-error-message) error-message) | 277 | (set (make-local-variable 'compilation-error-message) error-message) |
| 277 | (set (make-local-variable 'compilation-error-regexp-alist) regexp-alist) | 278 | (set (make-local-variable 'compilation-error-regexp-alist) regexp-alist) |
| @@ -343,6 +344,7 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)." | |||
| 343 | ;; Write something in the compilation buffer | 344 | ;; Write something in the compilation buffer |
| 344 | ;; and hack its mode line. | 345 | ;; and hack its mode line. |
| 345 | (set-buffer buffer) | 346 | (set-buffer buffer) |
| 347 | (setq buffer-read-only nil) | ||
| 346 | (setq omax (point-max) | 348 | (setq omax (point-max) |
| 347 | opoint (point)) | 349 | opoint (point)) |
| 348 | (goto-char omax) | 350 | (goto-char omax) |
| @@ -360,7 +362,8 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)." | |||
| 360 | ;; will stay around until M-x list-processes. | 362 | ;; will stay around until M-x list-processes. |
| 361 | (delete-process proc)) | 363 | (delete-process proc)) |
| 362 | ;; Force mode line redisplay soon. | 364 | ;; Force mode line redisplay soon. |
| 363 | (set-buffer-modified-p (buffer-modified-p))) | 365 | (set-buffer-modified-p (buffer-modified-p)) |
| 366 | (setq buffer-read-only t)) | ||
| 364 | (if (and opoint (< opoint omax)) | 367 | (if (and opoint (< opoint omax)) |
| 365 | (goto-char opoint)) | 368 | (goto-char opoint)) |
| 366 | (set-buffer obuf) | 369 | (set-buffer obuf) |
diff --git a/lisp/replace.el b/lisp/replace.el index 6f8601dfd8f..3dc23295218 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | ;;; replace.el --- replace commands for Emacs. | 1 | ;;; replace.el --- replace commands for Emacs. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985-1991 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 86, 87, 88, 89, 90, 91, 92 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; This file is part of GNU Emacs. | 5 | ;; This file is part of GNU Emacs. |
| 6 | 6 | ||
| 7 | ;; GNU Emacs is free software; you can redistribute it and/or modify | 7 | ;; GNU Emacs is free software; you can redistribute it and/or modify |
| 8 | ;; it under the terms of the GNU General Public License as published by | 8 | ;; it under the terms of the GNU General Public License as published by |
| 9 | ;; the Free Software Foundation; either version 1, or (at your option) | 9 | ;; the Free Software Foundation; either version 2, or (at your option) |
| 10 | ;; any later version. | 10 | ;; any later version. |
| 11 | 11 | ||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | 12 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| @@ -19,11 +19,9 @@ | |||
| 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | ;;;###autoload | ||
| 23 | (defconst case-replace t "\ | 22 | (defconst case-replace t "\ |
| 24 | *Non-nil means query-replace should preserve case in replacements.") | 23 | *Non-nil means query-replace should preserve case in replacements.") |
| 25 | 24 | ||
| 26 | ;;;###autoload | ||
| 27 | (defun query-replace (from-string to-string &optional arg) | 25 | (defun query-replace (from-string to-string &optional arg) |
| 28 | "Replace some occurrences of FROM-STRING with TO-STRING. | 26 | "Replace some occurrences of FROM-STRING with TO-STRING. |
| 29 | As each match is found, the user must type a character saying | 27 | As each match is found, the user must type a character saying |
| @@ -36,10 +34,8 @@ only matches surrounded by word boundaries." | |||
| 36 | (interactive "sQuery replace: \nsQuery replace %s with: \nP") | 34 | (interactive "sQuery replace: \nsQuery replace %s with: \nP") |
| 37 | (perform-replace from-string to-string t nil arg) | 35 | (perform-replace from-string to-string t nil arg) |
| 38 | (message "Done")) | 36 | (message "Done")) |
| 39 | ;;;###autoload | ||
| 40 | (define-key esc-map "%" 'query-replace) | 37 | (define-key esc-map "%" 'query-replace) |
| 41 | 38 | ||
| 42 | ;;;###autoload | ||
| 43 | (defun query-replace-regexp (regexp to-string &optional arg) | 39 | (defun query-replace-regexp (regexp to-string &optional arg) |
| 44 | "Replace some things after point matching REGEXP with TO-STRING. | 40 | "Replace some things after point matching REGEXP with TO-STRING. |
| 45 | As each match is found, the user must type a character saying | 41 | As each match is found, the user must type a character saying |
| @@ -55,7 +51,6 @@ and \\=\\<n> means insert what matched <n>th \\(...\\) in REGEXP." | |||
| 55 | (perform-replace regexp to-string t t arg) | 51 | (perform-replace regexp to-string t t arg) |
| 56 | (message "Done")) | 52 | (message "Done")) |
| 57 | 53 | ||
| 58 | ;;;###autoload | ||
| 59 | (defun map-query-replace-regexp (regexp to-strings &optional arg) | 54 | (defun map-query-replace-regexp (regexp to-strings &optional arg) |
| 60 | "Replace some matches for REGEXP with various strings, in rotation. | 55 | "Replace some matches for REGEXP with various strings, in rotation. |
| 61 | The second argument TO-STRINGS contains the replacement strings, separated | 56 | The second argument TO-STRINGS contains the replacement strings, separated |
| @@ -84,7 +79,6 @@ before rotating to the next." | |||
| 84 | (perform-replace regexp replacements t t nil arg)) | 79 | (perform-replace regexp replacements t t nil arg)) |
| 85 | (message "Done")) | 80 | (message "Done")) |
| 86 | 81 | ||
| 87 | ;;;###autoload | ||
| 88 | (defun replace-string (from-string to-string &optional delimited) | 82 | (defun replace-string (from-string to-string &optional delimited) |
| 89 | "Replace occurrences of FROM-STRING with TO-STRING. | 83 | "Replace occurrences of FROM-STRING with TO-STRING. |
| 90 | Preserve case in each match if `case-replace' and `case-fold-search' | 84 | Preserve case in each match if `case-replace' and `case-fold-search' |
| @@ -101,7 +95,6 @@ which will run faster and will not set the mark or print anything." | |||
| 101 | (perform-replace from-string to-string nil nil delimited) | 95 | (perform-replace from-string to-string nil nil delimited) |
| 102 | (message "Done")) | 96 | (message "Done")) |
| 103 | 97 | ||
| 104 | ;;;###autoload | ||
| 105 | (defun replace-regexp (regexp to-string &optional delimited) | 98 | (defun replace-regexp (regexp to-string &optional delimited) |
| 106 | "Replace things after point matching REGEXP with TO-STRING. | 99 | "Replace things after point matching REGEXP with TO-STRING. |
| 107 | Preserve case in each match if case-replace and case-fold-search | 100 | Preserve case in each match if case-replace and case-fold-search |
| @@ -348,7 +341,6 @@ C-l to clear the screen, redisplay, and offer same replacement again, | |||
| 348 | ^ to move point back to previous match." | 341 | ^ to move point back to previous match." |
| 349 | "Help message while in query-replace") | 342 | "Help message while in query-replace") |
| 350 | 343 | ||
| 351 | ;;;###autoload | ||
| 352 | (defun perform-replace (from-string replacements | 344 | (defun perform-replace (from-string replacements |
| 353 | query-flag regexp-flag delimited-flag | 345 | query-flag regexp-flag delimited-flag |
| 354 | &optional repeat-count) | 346 | &optional repeat-count) |
| @@ -364,6 +356,7 @@ which will run faster and do exactly what you probably want." | |||
| 364 | (literal (not regexp-flag)) | 356 | (literal (not regexp-flag)) |
| 365 | (search-function (if regexp-flag 're-search-forward 'search-forward)) | 357 | (search-function (if regexp-flag 're-search-forward 'search-forward)) |
| 366 | (search-string from-string) | 358 | (search-string from-string) |
| 359 | (real-match-data nil) ; the match data for the current match | ||
| 367 | (next-replacement nil) | 360 | (next-replacement nil) |
| 368 | (replacement-index 0) | 361 | (replacement-index 0) |
| 369 | (keep-going t) | 362 | (keep-going t) |
| @@ -400,6 +393,10 @@ which will run faster and do exactly what you probably want." | |||
| 400 | (forward-char 1) | 393 | (forward-char 1) |
| 401 | (funcall search-function search-string nil t)) | 394 | (funcall search-function search-string nil t)) |
| 402 | t)) | 395 | t)) |
| 396 | |||
| 397 | ;; Save the data associated with the real match. | ||
| 398 | (setq real-match-data (match-data)) | ||
| 399 | |||
| 403 | ;; Before we make the replacement, decide whether the search string | 400 | ;; Before we make the replacement, decide whether the search string |
| 404 | ;; can match again just after this match. | 401 | ;; can match again just after this match. |
| 405 | (if regexp-flag | 402 | (if regexp-flag |
| @@ -414,15 +411,13 @@ which will run faster and do exactly what you probably want." | |||
| 414 | (setq replacement-index (% (1+ replacement-index) (length replacements))))) | 411 | (setq replacement-index (% (1+ replacement-index) (length replacements))))) |
| 415 | (if (not query-flag) | 412 | (if (not query-flag) |
| 416 | (progn | 413 | (progn |
| 414 | (store-match-data real-match-data) | ||
| 417 | (replace-match next-replacement nocasify literal) | 415 | (replace-match next-replacement nocasify literal) |
| 418 | (setq replace-count (1+ replace-count))) | 416 | (setq replace-count (1+ replace-count))) |
| 419 | (undo-boundary) | 417 | (undo-boundary) |
| 420 | (let (done replaced) | 418 | (let (done replaced) |
| 421 | (while (not done) | 419 | (while (not done) |
| 422 | ;; Preserve the match data. Process filters and sentinels | 420 | (let ((help-form |
| 423 | ;; could run inside read-char.. | ||
| 424 | (let ((data (match-data)) | ||
| 425 | (help-form | ||
| 426 | '(concat "Query replacing " | 421 | '(concat "Query replacing " |
| 427 | (if regexp-flag "regexp " "") | 422 | (if regexp-flag "regexp " "") |
| 428 | from-string " with " next-replacement ".\n\n" | 423 | from-string " with " next-replacement ".\n\n" |
| @@ -432,8 +427,9 @@ which will run faster and do exactly what you probably want." | |||
| 432 | (message "Query replacing %s with %s: " from-string next-replacement) | 427 | (message "Query replacing %s with %s: " from-string next-replacement) |
| 433 | (setq char (read-event)) | 428 | (setq char (read-event)) |
| 434 | (if (and (numberp char) (= char ??)) | 429 | (if (and (numberp char) (= char ??)) |
| 435 | (setq unread-command-char help-char char help-char))) | 430 | (setq unread-command-char help-char char help-char)))) |
| 436 | (store-match-data data)) | 431 | ;; Restore the match data while we process the command. |
| 432 | (store-match-data real-match-data) | ||
| 437 | (cond ((or (= char ?\e) | 433 | (cond ((or (= char ?\e) |
| 438 | (= char ?q)) | 434 | (= char ?q)) |
| 439 | (setq keep-going nil) | 435 | (setq keep-going nil) |
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 31626ccb0e9..e4e02a68f67 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -321,4 +321,4 @@ MAIL-FLAG for a mail message, i. e. don't fill header lines." | |||
| 321 | (fill-region-as-paragraph start (point) justifyp) | 321 | (fill-region-as-paragraph start (point) justifyp) |
| 322 | (or had-newline (delete-char -1)))))))) | 322 | (or had-newline (delete-char -1)))))))) |
| 323 | 323 | ||
| 324 | ;;; fill.el ends here \ No newline at end of file | 324 | ;;; fill.el ends here |
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 2235c0b903a..79a07781a33 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el | |||
| @@ -19,25 +19,20 @@ | |||
| 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | ;;;###autoload | ||
| 23 | (defconst paragraph-start "^[ \t\n\f]" "\ | 22 | (defconst paragraph-start "^[ \t\n\f]" "\ |
| 24 | *Regexp for beginning of a line that starts OR separates paragraphs.") | 23 | *Regexp for beginning of a line that starts OR separates paragraphs.") |
| 25 | 24 | ||
| 26 | ;;;###autoload | ||
| 27 | (defconst paragraph-separate "^[ \t\f]*$" "\ | 25 | (defconst paragraph-separate "^[ \t\f]*$" "\ |
| 28 | *Regexp for beginning of a line that separates paragraphs. | 26 | *Regexp for beginning of a line that separates paragraphs. |
| 29 | If you change this, you may have to change paragraph-start also.") | 27 | If you change this, you may have to change paragraph-start also.") |
| 30 | 28 | ||
| 31 | ;;;###autoload | ||
| 32 | (defconst sentence-end (purecopy "[.?!][]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*") "\ | 29 | (defconst sentence-end (purecopy "[.?!][]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*") "\ |
| 33 | *Regexp describing the end of a sentence. | 30 | *Regexp describing the end of a sentence. |
| 34 | All paragraph boundaries also end sentences, regardless.") | 31 | All paragraph boundaries also end sentences, regardless.") |
| 35 | 32 | ||
| 36 | ;;;###autoload | ||
| 37 | (defconst page-delimiter "^\014" "\ | 33 | (defconst page-delimiter "^\014" "\ |
| 38 | *Regexp describing line-beginnings that separate pages.") | 34 | *Regexp describing line-beginnings that separate pages.") |
| 39 | 35 | ||
| 40 | ;;;###autoload | ||
| 41 | (defvar paragraph-ignore-fill-prefix nil "\ | 36 | (defvar paragraph-ignore-fill-prefix nil "\ |
| 42 | Non-nil means the paragraph commands are not affected by `fill-prefix'. | 37 | Non-nil means the paragraph commands are not affected by `fill-prefix'. |
| 43 | This is desirable in modes where blank lines are the paragraph delimiters.") | 38 | This is desirable in modes where blank lines are the paragraph delimiters.") |
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el index 377de8a6ab9..f089b090bb0 100644 --- a/lisp/textmodes/texnfo-upd.el +++ b/lisp/textmodes/texnfo-upd.el | |||
| @@ -2,13 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | ;;;; Version 2.00 14 Dec 1990 | 3 | ;;;; Version 2.00 14 Dec 1990 |
| 4 | 4 | ||
| 5 | ;;;; Copyright 1989, 1990 Free Software Foundation | 5 | ;;;; Copyright 1989, 1990, 1992 Free Software Foundation |
| 6 | 6 | ||
| 7 | ;; This file is part of GNU Emacs. | 7 | ;; This file is part of GNU Emacs. |
| 8 | 8 | ||
| 9 | ;; GNU Emacs is free software; you can redistribute it and/or modify | 9 | ;; GNU Emacs is free software; you can redistribute it and/or modify |
| 10 | ;; it under the terms of the GNU General Public License as published by | 10 | ;; it under the terms of the GNU General Public License as published by |
| 11 | ;; the Free Software Foundation; either version 1, or (at your option) | 11 | ;; the Free Software Foundation; either version 2, or (at your option) |
| 12 | ;; any later version. | 12 | ;; any later version. |
| 13 | 13 | ||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | 14 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| @@ -1031,13 +1031,13 @@ which menu descriptions are indented. Its default value is 24." | |||
| 1031 | 1031 | ||
| 1032 | (interactive "P") | 1032 | (interactive "P") |
| 1033 | (if (not region-p) | 1033 | (if (not region-p) |
| 1034 | (let ((auto-fill-hook nil)) ; update a single node | 1034 | (let ((auto-fill-function nil)) ; update a single node |
| 1035 | (if (not (re-search-backward "^@node" (point-min) t)) | 1035 | (if (not (re-search-backward "^@node" (point-min) t)) |
| 1036 | (error "Node line not found before this position.")) | 1036 | (error "Node line not found before this position.")) |
| 1037 | (texinfo-update-the-node) | 1037 | (texinfo-update-the-node) |
| 1038 | (message "Done...updated the node. You may save the buffer.")) | 1038 | (message "Done...updated the node. You may save the buffer.")) |
| 1039 | ;; else | 1039 | ;; else |
| 1040 | (let ((auto-fill-hook nil) | 1040 | (let ((auto-fill-function nil) |
| 1041 | (beginning (region-beginning)) | 1041 | (beginning (region-beginning)) |
| 1042 | (end (region-end))) | 1042 | (end (region-end))) |
| 1043 | (if (= end beginning) | 1043 | (if (= end beginning) |
| @@ -1245,14 +1245,14 @@ Info `g*' command is inadequate." | |||
| 1245 | 1245 | ||
| 1246 | (interactive "P") | 1246 | (interactive "P") |
| 1247 | (if (not region-p) | 1247 | (if (not region-p) |
| 1248 | (let ((auto-fill-hook nil)) ; update a single node | 1248 | (let ((auto-fill-function nil)) ; update a single node |
| 1249 | (if (not (re-search-backward "^@node" (point-min) t)) | 1249 | (if (not (re-search-backward "^@node" (point-min) t)) |
| 1250 | (error "Node line not found before this position.")) | 1250 | (error "Node line not found before this position.")) |
| 1251 | (texinfo-sequentially-update-the-node) | 1251 | (texinfo-sequentially-update-the-node) |
| 1252 | (message | 1252 | (message |
| 1253 | "Done...sequentially updated the node . You may save the buffer.")) | 1253 | "Done...sequentially updated the node . You may save the buffer.")) |
| 1254 | ;; else | 1254 | ;; else |
| 1255 | (let ((auto-fill-hook nil) | 1255 | (let ((auto-fill-function nil) |
| 1256 | (beginning (region-beginning)) | 1256 | (beginning (region-beginning)) |
| 1257 | (end (region-end))) | 1257 | (end (region-end))) |
| 1258 | (if (= end beginning) | 1258 | (if (= end beginning) |
diff --git a/src/.gdbinit b/src/.gdbinit index fd470e31384..6d2c08a4ee4 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -119,6 +119,12 @@ end | |||
| 119 | 119 | ||
| 120 | set print pretty on | 120 | set print pretty on |
| 121 | 121 | ||
| 122 | unset environment TERMCAP | ||
| 123 | unset environment TERM | ||
| 124 | set environment DISPLAY :0.0 | ||
| 125 | show environment DISPLAY | ||
| 126 | set args -q | ||
| 127 | |||
| 122 | # Don't let abort actually run, as it will make | 128 | # Don't let abort actually run, as it will make |
| 123 | # stdio stop working and therefore the `pr' command below as well. | 129 | # stdio stop working and therefore the `pr' command below as well. |
| 124 | break abort | 130 | break abort |
| @@ -128,8 +134,3 @@ break abort | |||
| 128 | # instead... | 134 | # instead... |
| 129 | break _XPrintDefaultError | 135 | break _XPrintDefaultError |
| 130 | 136 | ||
| 131 | unset environment TERMCAP | ||
| 132 | unset environment TERM | ||
| 133 | set environment DISPLAY :0.0 | ||
| 134 | show environment DISPLAY | ||
| 135 | set args -q | ||
diff --git a/src/Makefile.in b/src/Makefile.in index 8cb7bdbdefa..0717ee9644b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -2,7 +2,7 @@ MAKE = make | |||
| 2 | # BSD doesn't have it as a default. | 2 | # BSD doesn't have it as a default. |
| 3 | 3 | ||
| 4 | CC =gcc | 4 | CC =gcc |
| 5 | CPP = $(CC) -E | 5 | CPP = $(CC) -E -Is -Im |
| 6 | #Note: an alternative is CPP = /lib/cpp | 6 | #Note: an alternative is CPP = /lib/cpp |
| 7 | 7 | ||
| 8 | # Just to avoid uncertainty. | 8 | # Just to avoid uncertainty. |
| @@ -19,7 +19,7 @@ distclean: | |||
| 19 | -rm -f paths.h config.h machine.h system.h emacs-* temacs xemacs xmakefile core *~ \#* *.o | 19 | -rm -f paths.h config.h machine.h system.h emacs-* temacs xemacs xmakefile core *~ \#* *.o |
| 20 | 20 | ||
| 21 | clean: | 21 | clean: |
| 22 | -rm -f temacs xemacs xmakefile core \#* *.o | 22 | -rm -f temacs xemacs xmakefile* core \#* *.o |
| 23 | 23 | ||
| 24 | xemacs: xmakefile doxemacs | 24 | xemacs: xmakefile doxemacs |
| 25 | 25 | ||
| @@ -34,10 +34,16 @@ dotemacs: | |||
| 34 | # If you have a problem with cc -E here, changing | 34 | # If you have a problem with cc -E here, changing |
| 35 | # the definition of CPP above may fix it. | 35 | # the definition of CPP above may fix it. |
| 36 | xmakefile: ymakefile config.h | 36 | xmakefile: ymakefile config.h |
| 37 | -rm -f xmakefile junk.c | 37 | -rm -f xmakefile xmakefile.new junk.c junk.cpp |
| 38 | cp ymakefile junk.c | 38 | cp ymakefile junk.c |
| 39 | $(CPP) junk.c | sed -e 's/^#.*//' -e 's/^[ \f\t][ \f\t]*$$//' -e 's/^ / /' | \ | 39 | $(CPP) junk.c > junk.cpp |
| 40 | sed -n -e '/^..*$$/p' > xmakefile | 40 | < junk.cpp \ |
| 41 | sed -e 's/^#.*//' \ | ||
| 42 | -e 's/^[ \f\t][ \f\t]*$$//' \ | ||
| 43 | -e 's/^ / /' \ | ||
| 44 | | sed -n -e '/^..*$$/p' \ | ||
| 45 | > xmakefile.new | ||
| 46 | mv -f xmakefile.new xmakefile | ||
| 41 | rm -f junk.c | 47 | rm -f junk.c |
| 42 | 48 | ||
| 43 | tags TAGS: | 49 | tags TAGS: |
diff --git a/src/callint.c b/src/callint.c index aeb6ef38720..bb39604744b 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -174,7 +174,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.") | |||
| 174 | int arg_from_tty = 0; | 174 | int arg_from_tty = 0; |
| 175 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 175 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 176 | 176 | ||
| 177 | /* Save this now, since use ofminibuffer will clobber it. */ | 177 | /* Save this now, since use of minibuffer will clobber it. */ |
| 178 | prefix_arg = Vcurrent_prefix_arg; | 178 | prefix_arg = Vcurrent_prefix_arg; |
| 179 | 179 | ||
| 180 | retry: | 180 | retry: |
| @@ -233,7 +233,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.") | |||
| 233 | { | 233 | { |
| 234 | /* Make a copy of string so that if a GC relocates specs, | 234 | /* Make a copy of string so that if a GC relocates specs, |
| 235 | `string' will still be valid. */ | 235 | `string' will still be valid. */ |
| 236 | string = (char *) alloca (XSTRING (specs)->size + 1); | 236 | string = (unsigned char *) alloca (XSTRING (specs)->size + 1); |
| 237 | bcopy (XSTRING (specs)->data, string, XSTRING (specs)->size + 1); | 237 | bcopy (XSTRING (specs)->data, string, XSTRING (specs)->size + 1); |
| 238 | } | 238 | } |
| 239 | else if (string == 0) | 239 | else if (string == 0) |
| @@ -388,6 +388,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.") | |||
| 388 | (XTYPE (function) == Lisp_Symbol | 388 | (XTYPE (function) == Lisp_Symbol |
| 389 | ? (char *) XSYMBOL (function)->name->data | 389 | ? (char *) XSYMBOL (function)->name->data |
| 390 | : "Command")); | 390 | : "Command")); |
| 391 | varies[i] = -1; | ||
| 391 | break; | 392 | break; |
| 392 | 393 | ||
| 393 | case 'm': /* Value of mark. Does not do I/O. */ | 394 | case 'm': /* Value of mark. Does not do I/O. */ |
diff --git a/src/dispextern.h b/src/dispextern.h index 365f229fb53..19a0bfcecfa 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* Interface definitions for display code. | 1 | /* Interface definitions for display code. |
| 2 | Copyright (C) 1985 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 1992 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | 6 | GNU Emacs is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 1, or (at your option) | 8 | the Free Software Foundation; either version 2, or (at your option) |
| 9 | any later version. | 9 | any later version. |
| 10 | 10 | ||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | 11 | GNU Emacs is distributed in the hope that it will be useful, |
| @@ -93,10 +93,3 @@ struct screen_glyphs | |||
| 93 | * SCREEN_CURRENT_GLYPHS(s)->enable[(n)]) | 93 | * SCREEN_CURRENT_GLYPHS(s)->enable[(n)]) |
| 94 | 94 | ||
| 95 | extern void get_display_line (); | 95 | extern void get_display_line (); |
| 96 | |||
| 97 | /* Buffer used by `message' for formatting a message. */ | ||
| 98 | extern char *message_buf; | ||
| 99 | extern int message_buf_size; | ||
| 100 | |||
| 101 | /* Nonzero means message_buf is being used by print. */ | ||
| 102 | extern int message_buf_print; | ||
diff --git a/src/dispnew.c b/src/dispnew.c index b1ea5d22664..c5b802679d4 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -106,25 +106,17 @@ int cursor_in_echo_area; | |||
| 106 | 106 | ||
| 107 | SCREEN_PTR selected_screen; | 107 | SCREEN_PTR selected_screen; |
| 108 | 108 | ||
| 109 | /* A screen which is not just a minibuffer, or 0 if there are no such | ||
| 110 | screens. This is usually the most recent such screen that was | ||
| 111 | selected. In a single-screen version, this variable always remains 0. */ | ||
| 112 | SCREEN_PTR last_nonminibuf_screen; | ||
| 113 | |||
| 109 | /* In a single-screen version, the information that would otherwise | 114 | /* In a single-screen version, the information that would otherwise |
| 110 | exist inside a `struct screen' lives in the following variables instead. */ | 115 | exist inside screen objects lives in the following structure instead. */ |
| 111 | 116 | ||
| 112 | #ifndef MULTI_SCREEN | 117 | #ifndef MULTI_SCREEN |
| 113 | 118 | struct screen the_only_screen; | |
| 114 | /* Desired terminal cursor position (to show position of point), | 119 | #endif |
| 115 | origin zero */ | ||
| 116 | |||
| 117 | int cursX, cursY; | ||
| 118 | |||
| 119 | /* Description of current screen contents */ | ||
| 120 | |||
| 121 | struct screen_glyphs *current_glyphs; | ||
| 122 | |||
| 123 | /* Description of desired screen contents */ | ||
| 124 | |||
| 125 | struct screen_glyphs *desired_glyphs; | ||
| 126 | |||
| 127 | #endif /* not MULTI_SCREEN */ | ||
| 128 | 120 | ||
| 129 | /* This is a vector, made larger whenever it isn't large enough, | 121 | /* This is a vector, made larger whenever it isn't large enough, |
| 130 | which is used inside `update_screen' to hold the old contents | 122 | which is used inside `update_screen' to hold the old contents |
| @@ -142,8 +134,6 @@ extern short ospeed; /* Output speed (from sg_ospeed) */ | |||
| 142 | int in_display; /* 1 if in redisplay: can't handle SIGWINCH now. */ | 134 | int in_display; /* 1 if in redisplay: can't handle SIGWINCH now. */ |
| 143 | 135 | ||
| 144 | int delayed_size_change; /* 1 means SIGWINCH happened when not safe. */ | 136 | int delayed_size_change; /* 1 means SIGWINCH happened when not safe. */ |
| 145 | int delayed_screen_height; /* Remembered new screen height. */ | ||
| 146 | int delayed_screen_width; /* Remembered new screen width. */ | ||
| 147 | 137 | ||
| 148 | #ifdef MULTI_SCREEN | 138 | #ifdef MULTI_SCREEN |
| 149 | 139 | ||
| @@ -834,8 +824,8 @@ cancel_my_columns (w) | |||
| 834 | struct window *w; | 824 | struct window *w; |
| 835 | { | 825 | { |
| 836 | register int vpos; | 826 | register int vpos; |
| 837 | register SCREEN_PTR screen = XSCREEN (w->screen); | 827 | register struct screen_glyphs *desired_glyphs = |
| 838 | register struct screen_glyphs *desired_glyphs = screen->desired_glyphs; | 828 | SCREEN_DESIRED_GLYPHS (XSCREEN (w->screen)); |
| 839 | register int start = XFASTINT (w->left); | 829 | register int start = XFASTINT (w->left); |
| 840 | register int bot = XFASTINT (w->top) + XFASTINT (w->height); | 830 | register int bot = XFASTINT (w->top) + XFASTINT (w->height); |
| 841 | 831 | ||
| @@ -1049,8 +1039,10 @@ update_screen (s, force, inhibit_hairy_id) | |||
| 1049 | #endif /* HAVE_X_WINDOWS */ | 1039 | #endif /* HAVE_X_WINDOWS */ |
| 1050 | } | 1040 | } |
| 1051 | 1041 | ||
| 1042 | #ifdef HAVE_X_WINDOWS | ||
| 1052 | if (SCREEN_IS_X (s)) | 1043 | if (SCREEN_IS_X (s)) |
| 1053 | downto += LINE_HEIGHT(s, i); | 1044 | downto += LINE_HEIGHT(s, i); |
| 1045 | #endif | ||
| 1054 | } | 1046 | } |
| 1055 | pause = (i < SCREEN_HEIGHT (s) - 1) ? i : 0; | 1047 | pause = (i < SCREEN_HEIGHT (s) - 1) ? i : 0; |
| 1056 | 1048 | ||
| @@ -1603,11 +1595,10 @@ window_change_signal () | |||
| 1603 | 1595 | ||
| 1604 | { | 1596 | { |
| 1605 | Lisp_Object tail; | 1597 | Lisp_Object tail; |
| 1598 | SCREEN_PTR s; | ||
| 1606 | 1599 | ||
| 1607 | for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) | 1600 | FOR_EACH_SCREEN (tail, s) |
| 1608 | { | 1601 | { |
| 1609 | SCREEN_PTR s = XSCREEN (XCONS (tail)->car); | ||
| 1610 | |||
| 1611 | if (SCREEN_IS_TERMCAP (s)) | 1602 | if (SCREEN_IS_TERMCAP (s)) |
| 1612 | { | 1603 | { |
| 1613 | ++in_display; | 1604 | ++in_display; |
| @@ -1632,12 +1623,12 @@ do_pending_window_change () | |||
| 1632 | while (delayed_size_change) | 1623 | while (delayed_size_change) |
| 1633 | { | 1624 | { |
| 1634 | Lisp_Object tail; | 1625 | Lisp_Object tail; |
| 1626 | SCREEN_PTR s; | ||
| 1635 | 1627 | ||
| 1636 | delayed_size_change = 0; | 1628 | delayed_size_change = 0; |
| 1637 | 1629 | ||
| 1638 | for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) | 1630 | FOR_EACH_SCREEN (tail, s) |
| 1639 | { | 1631 | { |
| 1640 | SCREEN_PTR s = XSCREEN (XCONS (tail)->car); | ||
| 1641 | int height = SCREEN_NEW_HEIGHT (s); | 1632 | int height = SCREEN_NEW_HEIGHT (s); |
| 1642 | int width = SCREEN_NEW_WIDTH (s); | 1633 | int width = SCREEN_NEW_WIDTH (s); |
| 1643 | 1634 | ||
diff --git a/src/emacs.c b/src/emacs.c index 104ba671253..df698ee8309 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -63,6 +63,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 63 | /* Command line args from shell, as list of strings */ | 63 | /* Command line args from shell, as list of strings */ |
| 64 | Lisp_Object Vcommand_line_args; | 64 | Lisp_Object Vcommand_line_args; |
| 65 | 65 | ||
| 66 | /* Hook run by `kill-emacs' before it does really anything. */ | ||
| 67 | Lisp_Object Vkill_emacs_hook; | ||
| 68 | |||
| 66 | /* Set nonzero after Emacs has started up the first time. | 69 | /* Set nonzero after Emacs has started up the first time. |
| 67 | Prevents reinitialization of the Lisp world and keymaps | 70 | Prevents reinitialization of the Lisp world and keymaps |
| 68 | on subsequent starts. */ | 71 | on subsequent starts. */ |
| @@ -761,4 +764,9 @@ syms_of_emacs () | |||
| 761 | 764 | ||
| 762 | DEFVAR_BOOL ("noninteractive", &noninteractive1, | 765 | DEFVAR_BOOL ("noninteractive", &noninteractive1, |
| 763 | "Non-nil means Emacs is running without interactive terminal."); | 766 | "Non-nil means Emacs is running without interactive terminal."); |
| 767 | |||
| 768 | Vkill_emacs_hook = Qnil; | ||
| 769 | |||
| 770 | DEFVAR_LISP ("kill-emacs-hook", &Vkill_emacs_hook, | ||
| 771 | "Hook to be run whenever kill-emacs is called."); | ||
| 764 | } | 772 | } |
diff --git a/src/eval.c b/src/eval.c index 0e012d45008..572410e9617 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1094,7 +1094,9 @@ See also the function `condition-case'.") | |||
| 1094 | if (gc_in_progress || waiting_for_input) | 1094 | if (gc_in_progress || waiting_for_input) |
| 1095 | abort (); | 1095 | abort (); |
| 1096 | 1096 | ||
| 1097 | #ifdef HAVE_X_WINDOWS | ||
| 1097 | TOTALLY_UNBLOCK_INPUT; | 1098 | TOTALLY_UNBLOCK_INPUT; |
| 1099 | #endif | ||
| 1098 | 1100 | ||
| 1099 | conditions = Fget (sig, Qerror_conditions); | 1101 | conditions = Fget (sig, Qerror_conditions); |
| 1100 | 1102 | ||
diff --git a/src/fileio.c b/src/fileio.c index c6d3ee424fc..71a07938b11 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -621,7 +621,7 @@ See also the function `substitute-in-file-name'.") | |||
| 621 | #ifdef VMS | 621 | #ifdef VMS |
| 622 | || nm[1] == ':' | 622 | || nm[1] == ':' |
| 623 | #endif /* VMS */ | 623 | #endif /* VMS */ |
| 624 | || nm[1] == 0)/* ~/filename */ | 624 | || nm[1] == 0)/* ~ by itself */ |
| 625 | { | 625 | { |
| 626 | if (!(newdir = (unsigned char *) egetenv ("HOME"))) | 626 | if (!(newdir = (unsigned char *) egetenv ("HOME"))) |
| 627 | newdir = (unsigned char *) ""; | 627 | newdir = (unsigned char *) ""; |
| @@ -642,15 +642,18 @@ See also the function `substitute-in-file-name'.") | |||
| 642 | o [p - nm] = 0; | 642 | o [p - nm] = 0; |
| 643 | 643 | ||
| 644 | pw = (struct passwd *) getpwnam (o + 1); | 644 | pw = (struct passwd *) getpwnam (o + 1); |
| 645 | if (!pw) | 645 | if (pw) |
| 646 | error ("\"%s\" isn't a registered user", o + 1); | 646 | { |
| 647 | 647 | newdir = (unsigned char *) pw -> pw_dir; | |
| 648 | #ifdef VMS | 648 | #ifdef VMS |
| 649 | nm = p + 1; /* skip the terminator */ | 649 | nm = p + 1; /* skip the terminator */ |
| 650 | #else | 650 | #else |
| 651 | nm = p; | 651 | nm = p; |
| 652 | #endif /* VMS */ | 652 | #endif /* VMS */ |
| 653 | newdir = (unsigned char *) pw -> pw_dir; | 653 | } |
| 654 | |||
| 655 | /* If we don't find a user of that name, leave the name | ||
| 656 | unchanged; don't move nm forward to p. */ | ||
| 654 | } | 657 | } |
| 655 | 658 | ||
| 656 | if (nm[0] != '/' | 659 | if (nm[0] != '/' |
| @@ -794,7 +797,8 @@ See also the function `substitute-in-file-name'.") | |||
| 794 | return make_string (target, o - target); | 797 | return make_string (target, o - target); |
| 795 | } | 798 | } |
| 796 | #if 0 | 799 | #if 0 |
| 797 | DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, | 800 | /* Changed this DEFUN to a DEAFUN, so as not to confuse `make-docfile'. |
| 801 | DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, | ||
| 798 | "Convert FILENAME to absolute, and canonicalize it.\n\ | 802 | "Convert FILENAME to absolute, and canonicalize it.\n\ |
| 799 | Second arg DEFAULT is directory to start with if FILENAME is relative\n\ | 803 | Second arg DEFAULT is directory to start with if FILENAME is relative\n\ |
| 800 | (does not start with slash); if DEFAULT is nil or missing,\n\ | 804 | (does not start with slash); if DEFAULT is nil or missing,\n\ |
| @@ -1589,38 +1593,38 @@ Signals a `file-already-exists' error if a file NEWNAME already exists\n\ | |||
| 1589 | unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.\n\ | 1593 | unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.\n\ |
| 1590 | A number as third arg means request confirmation if NEWNAME already exists.\n\ | 1594 | A number as third arg means request confirmation if NEWNAME already exists.\n\ |
| 1591 | This happens for interactive use with M-x.") | 1595 | This happens for interactive use with M-x.") |
| 1592 | (filename, newname, ok_if_already_exists) | 1596 | (filename, linkname, ok_if_already_exists) |
| 1593 | Lisp_Object filename, newname, ok_if_already_exists; | 1597 | Lisp_Object filename, linkname, ok_if_already_exists; |
| 1594 | { | 1598 | { |
| 1595 | #ifdef NO_ARG_ARRAY | 1599 | #ifdef NO_ARG_ARRAY |
| 1596 | Lisp_Object args[2]; | 1600 | Lisp_Object args[2]; |
| 1597 | #endif | 1601 | #endif |
| 1598 | struct gcpro gcpro1, gcpro2; | 1602 | struct gcpro gcpro1, gcpro2; |
| 1599 | 1603 | ||
| 1600 | GCPRO2 (filename, newname); | 1604 | GCPRO2 (filename, linkname); |
| 1601 | CHECK_STRING (filename, 0); | 1605 | CHECK_STRING (filename, 0); |
| 1602 | CHECK_STRING (newname, 1); | 1606 | CHECK_STRING (linkname, 1); |
| 1603 | #if 0 /* This made it impossible to make a link to a relative name. */ | 1607 | #if 0 /* This made it impossible to make a link to a relative name. */ |
| 1604 | filename = Fexpand_file_name (filename, Qnil); | 1608 | filename = Fexpand_file_name (filename, Qnil); |
| 1605 | #endif | 1609 | #endif |
| 1606 | newname = Fexpand_file_name (newname, Qnil); | 1610 | linkname = Fexpand_file_name (linkname, Qnil); |
| 1607 | if (NILP (ok_if_already_exists) | 1611 | if (NILP (ok_if_already_exists) |
| 1608 | || XTYPE (ok_if_already_exists) == Lisp_Int) | 1612 | || XTYPE (ok_if_already_exists) == Lisp_Int) |
| 1609 | barf_or_query_if_file_exists (newname, "make it a link", | 1613 | barf_or_query_if_file_exists (linkname, "make it a link", |
| 1610 | XTYPE (ok_if_already_exists) == Lisp_Int); | 1614 | XTYPE (ok_if_already_exists) == Lisp_Int); |
| 1611 | if (0 > symlink (XSTRING (filename)->data, XSTRING (newname)->data)) | 1615 | if (0 > symlink (XSTRING (filename)->data, XSTRING (linkname)->data)) |
| 1612 | { | 1616 | { |
| 1613 | /* If we didn't complain already, silently delete existing file. */ | 1617 | /* If we didn't complain already, silently delete existing file. */ |
| 1614 | if (errno == EEXIST) | 1618 | if (errno == EEXIST) |
| 1615 | { | 1619 | { |
| 1616 | unlink (XSTRING (filename)->data); | 1620 | unlink (XSTRING (filename)->data); |
| 1617 | if (0 <= symlink (XSTRING (filename)->data, XSTRING (newname)->data)) | 1621 | if (0 <= symlink (XSTRING (filename)->data, XSTRING (linkname)->data)) |
| 1618 | return Qnil; | 1622 | return Qnil; |
| 1619 | } | 1623 | } |
| 1620 | 1624 | ||
| 1621 | #ifdef NO_ARG_ARRAY | 1625 | #ifdef NO_ARG_ARRAY |
| 1622 | args[0] = filename; | 1626 | args[0] = filename; |
| 1623 | args[1] = newname; | 1627 | args[1] = linkname; |
| 1624 | report_file_error ("Making symbolic link", Flist (2, args)); | 1628 | report_file_error ("Making symbolic link", Flist (2, args)); |
| 1625 | #else | 1629 | #else |
| 1626 | report_file_error ("Making symbolic link", Flist (2, &filename)); | 1630 | report_file_error ("Making symbolic link", Flist (2, &filename)); |
diff --git a/src/frame.c b/src/frame.c index 6f190e4c535..41df7e26caf 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -20,6 +20,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 20 | #include <stdio.h> | 20 | #include <stdio.h> |
| 21 | 21 | ||
| 22 | #include "config.h" | 22 | #include "config.h" |
| 23 | |||
| 24 | #ifdef MULTI_SCREEN | ||
| 25 | |||
| 23 | #include "lisp.h" | 26 | #include "lisp.h" |
| 24 | #include "screen.h" | 27 | #include "screen.h" |
| 25 | #include "window.h" | 28 | #include "window.h" |
| @@ -34,11 +37,6 @@ Lisp_Object Vdefault_minibuffer_screen; | |||
| 34 | Lisp_Object Vdefault_screen_alist; | 37 | Lisp_Object Vdefault_screen_alist; |
| 35 | Lisp_Object Qminibuffer; | 38 | Lisp_Object Qminibuffer; |
| 36 | 39 | ||
| 37 | /* A screen which is not just a minibuffer, or 0 if there are no | ||
| 38 | such screens. This is usually the most recent such screen that | ||
| 39 | was selected. */ | ||
| 40 | struct screen *last_nonminibuf_screen; | ||
| 41 | |||
| 42 | extern Lisp_Object Vminibuffer_list; | 40 | extern Lisp_Object Vminibuffer_list; |
| 43 | extern Lisp_Object get_minibuffer (); | 41 | extern Lisp_Object get_minibuffer (); |
| 44 | 42 | ||
| @@ -1220,3 +1218,5 @@ For values specific to the separate minibuffer screen, see\n\ | |||
| 1220 | defsubr (&Srubber_band_rectangle); | 1218 | defsubr (&Srubber_band_rectangle); |
| 1221 | #endif /* HAVE_X11 */ | 1219 | #endif /* HAVE_X11 */ |
| 1222 | } | 1220 | } |
| 1221 | |||
| 1222 | #endif | ||
diff --git a/src/frame.h b/src/frame.h index a9fca616c8c..f9e270e52c5 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* Define screen-object for GNU Emacs. | 1 | /* Define screen-object for GNU Emacs. |
| 2 | Copyright (C) 1988 Free Software Foundation, Inc. | 2 | Copyright (C) 1988, 1992 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | 6 | GNU Emacs is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 1, or (at your option) | 8 | the Free Software Foundation; either version 2, or (at your option) |
| 9 | any later version. | 9 | any later version. |
| 10 | 10 | ||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | 11 | GNU Emacs is distributed in the hope that it will be useful, |
| @@ -18,7 +18,12 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | 18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | #ifdef MULTI_SCREEN | 21 | /* The structure representing a screen. |
| 22 | |||
| 23 | We declare this even if MULTI_SCREEN is not defined, because when | ||
| 24 | we lack multi-screen support, we use one instance of this structure | ||
| 25 | to represent the one screen we support. This is cleaner than | ||
| 26 | having miscellaneous random variables scattered about. */ | ||
| 22 | 27 | ||
| 23 | enum output_method | 28 | enum output_method |
| 24 | { output_termcap, output_x_window }; | 29 | { output_termcap, output_x_window }; |
| @@ -34,15 +39,13 @@ struct screen | |||
| 34 | /* glyphs we'd like to appear on the screen */ | 39 | /* glyphs we'd like to appear on the screen */ |
| 35 | struct screen_glyphs *desired_glyphs; | 40 | struct screen_glyphs *desired_glyphs; |
| 36 | 41 | ||
| 42 | /* See do_line_insertion_deletion_costs for info on these arrays. */ | ||
| 37 | /* Cost of inserting 1 line on this screen */ | 43 | /* Cost of inserting 1 line on this screen */ |
| 38 | int *insert_line_cost; | 44 | int *insert_line_cost; |
| 39 | |||
| 40 | /* Cost of deleting 1 line on this screen */ | 45 | /* Cost of deleting 1 line on this screen */ |
| 41 | int *delete_line_cost; | 46 | int *delete_line_cost; |
| 42 | |||
| 43 | /* Cost of inserting n lines on this screen */ | 47 | /* Cost of inserting n lines on this screen */ |
| 44 | int *insert_n_lines_cost; | 48 | int *insert_n_lines_cost; |
| 45 | |||
| 46 | /* Cost of deleting n lines on this screen */ | 49 | /* Cost of deleting n lines on this screen */ |
| 47 | int *delete_n_lines_cost; | 50 | int *delete_n_lines_cost; |
| 48 | 51 | ||
| @@ -148,6 +151,8 @@ struct screen | |||
| 148 | int scroll_bottom_vpos; | 151 | int scroll_bottom_vpos; |
| 149 | }; | 152 | }; |
| 150 | 153 | ||
| 154 | #ifdef MULTI_SCREEN | ||
| 155 | |||
| 151 | typedef struct screen *SCREEN_PTR; | 156 | typedef struct screen *SCREEN_PTR; |
| 152 | 157 | ||
| 153 | #define XSCREEN(p) ((struct screen *) XPNTR (p)) | 158 | #define XSCREEN(p) ((struct screen *) XPNTR (p)) |
| @@ -157,7 +162,6 @@ typedef struct screen *SCREEN_PTR; | |||
| 157 | 162 | ||
| 158 | #define SCREENP(s) (XTYPE(s) == Lisp_Screen) | 163 | #define SCREENP(s) (XTYPE(s) == Lisp_Screen) |
| 159 | #define SCREEN_LIVE_P(s) ((s)->display.nothing != 0) | 164 | #define SCREEN_LIVE_P(s) ((s)->display.nothing != 0) |
| 160 | #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) | ||
| 161 | #define SCREEN_IS_TERMCAP(s) ((s)->output_method == output_termcap) | 165 | #define SCREEN_IS_TERMCAP(s) ((s)->output_method == output_termcap) |
| 162 | #define SCREEN_IS_X(s) ((s)->output_method == output_x_window) | 166 | #define SCREEN_IS_X(s) ((s)->output_method == output_x_window) |
| 163 | #define SCREEN_MINIBUF_ONLY_P(s) \ | 167 | #define SCREEN_MINIBUF_ONLY_P(s) \ |
| @@ -173,6 +177,7 @@ typedef struct screen *SCREEN_PTR; | |||
| 173 | #define SCREEN_CURSOR_X(s) (s)->cursor_x | 177 | #define SCREEN_CURSOR_X(s) (s)->cursor_x |
| 174 | #define SCREEN_CURSOR_Y(s) (s)->cursor_y | 178 | #define SCREEN_CURSOR_Y(s) (s)->cursor_y |
| 175 | #define SCREEN_VISIBLE_P(s) (s)->visible | 179 | #define SCREEN_VISIBLE_P(s) (s)->visible |
| 180 | #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) | ||
| 176 | #define SCREEN_GARBAGED_P(s) (s)->garbaged | 181 | #define SCREEN_GARBAGED_P(s) (s)->garbaged |
| 177 | #define SCREEN_NO_SPLIT_P(s) (s)->no_split | 182 | #define SCREEN_NO_SPLIT_P(s) (s)->no_split |
| 178 | #define SCREEN_WANTS_MODELINE_P(s) (s)->wants_modeline | 183 | #define SCREEN_WANTS_MODELINE_P(s) (s)->wants_modeline |
| @@ -202,6 +207,22 @@ typedef struct screen *SCREEN_PTR; | |||
| 202 | x = wrong_type_argument (Qlive_screen_p, (x)); \ | 207 | x = wrong_type_argument (Qlive_screen_p, (x)); \ |
| 203 | } | 208 | } |
| 204 | 209 | ||
| 210 | /* FOR_EACH_SCREEN (LIST_VAR, SCREEN_VAR) followed by a statement is a | ||
| 211 | `for' loop which iterates over the elements of Vscreen_list. The | ||
| 212 | loop will set SCREEN_VAR, a SCREEN_PTR, to each screen in | ||
| 213 | Vscreen_list in succession and execute the statement. LIST_VAR | ||
| 214 | should be a Lisp_Object; it is used to iterate through the | ||
| 215 | Vscreen_list. | ||
| 216 | |||
| 217 | If MULTI_SCREEN isn't defined, then this loop expands to something which | ||
| 218 | executes the statement once. */ | ||
| 219 | #define FOR_EACH_SCREEN(list_var, screen_var) \ | ||
| 220 | for ((list_var) = Vscreen_list; \ | ||
| 221 | (CONSP (list_var) \ | ||
| 222 | && (screen_var = XSCREEN (XCONS (list_var)->car), 1)); \ | ||
| 223 | list_var = XCONS (list_var)->cdr) | ||
| 224 | |||
| 225 | |||
| 205 | extern Lisp_Object Qscreenp, Qlive_screen_p; | 226 | extern Lisp_Object Qscreenp, Qlive_screen_p; |
| 206 | 227 | ||
| 207 | extern struct screen *selected_screen; | 228 | extern struct screen *selected_screen; |
| @@ -212,6 +233,10 @@ extern struct screen *make_screen (); | |||
| 212 | extern struct screen *make_minibuffer_screen (); | 233 | extern struct screen *make_minibuffer_screen (); |
| 213 | extern struct screen *make_screen_without_minibuffer (); | 234 | extern struct screen *make_screen_without_minibuffer (); |
| 214 | 235 | ||
| 236 | /* Nonzero means SCREEN_MESSAGE_BUF (selected_screen) is being used by | ||
| 237 | print. */ | ||
| 238 | extern int message_buf_print; | ||
| 239 | |||
| 215 | extern Lisp_Object Vscreen_list; | 240 | extern Lisp_Object Vscreen_list; |
| 216 | extern Lisp_Object Vdefault_screen_alist; | 241 | extern Lisp_Object Vdefault_screen_alist; |
| 217 | 242 | ||
| @@ -223,47 +248,65 @@ extern Lisp_Object Vterminal_screen; | |||
| 223 | 248 | ||
| 224 | #define SCREEN_PTR int | 249 | #define SCREEN_PTR int |
| 225 | 250 | ||
| 251 | extern struct screen the_only_screen; | ||
| 252 | |||
| 226 | extern int selected_screen; | 253 | extern int selected_screen; |
| 227 | #define last_nonminibuf_screen selected_screen | 254 | extern int last_nonminibuf_screen; |
| 255 | |||
| 256 | /* Nonzero means SCREEN_MESSAGE_BUF (selected_screen) is being used by | ||
| 257 | print. */ | ||
| 258 | extern int message_buf_print; | ||
| 228 | 259 | ||
| 229 | #define XSCREEN(s) selected_screen | 260 | #define XSCREEN(s) selected_screen |
| 230 | #define WINDOW_SCREEN(w) selected_screen | 261 | #define WINDOW_SCREEN(w) selected_screen |
| 231 | 262 | ||
| 232 | #define SCREENP(s) (XTYPE(s) == Lisp_Screen) | 263 | #define SCREENP(s) (XTYPE(s) == Lisp_Screen) |
| 233 | #define SCREEN_LIVE_P(s) 1 | 264 | #define SCREEN_LIVE_P(s) 1 |
| 234 | #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) | ||
| 235 | #define SCREEN_IS_TERMCAP(s) 1 | 265 | #define SCREEN_IS_TERMCAP(s) 1 |
| 236 | #define SCREEN_IS_X(s) 0 | 266 | #define SCREEN_IS_X(s) 0 |
| 237 | #define SCREEN_IS_MINIBUF_ONLY(s) 0 | 267 | #define SCREEN_MINIBUF_ONLY_P(s) 0 |
| 238 | #define SCREEN_HAS_MINIBUF(s) 1 | 268 | #define SCREEN_HAS_MINIBUF(s) 1 |
| 239 | #define SCREEN_CURRENT_GLYPHS(s) current_glyphs | 269 | #define SCREEN_CURRENT_GLYPHS(s) the_only_screen.current_glyphs |
| 240 | #define SCREEN_DESIRED_GLYPHS(s) desired_glyphs | 270 | #define SCREEN_DESIRED_GLYPHS(s) the_only_screen.desired_glyphs |
| 241 | #define SCREEN_TEMP_GLYPHS(s) temp_glyphs | 271 | #define SCREEN_TEMP_GLYPHS(s) the_only_screen.temp_glyphs |
| 242 | #define SCREEN_HEIGHT(s) screen_height | 272 | #define SCREEN_HEIGHT(s) the_only_screen.height |
| 243 | #define SCREEN_WIDTH(s) screen_width | 273 | #define SCREEN_WIDTH(s) the_only_screen.width |
| 244 | #define SCREEN_NEW_HEIGHT(s) delayed_screen_height | 274 | #define SCREEN_NEW_HEIGHT(s) the_only_screen.new_height |
| 245 | #define SCREEN_NEW_WIDTH(s) delayed_screen_width | 275 | #define SCREEN_NEW_WIDTH(s) the_only_screen.new_width |
| 246 | #define SCREEN_CURSOR_X(s) cursX | 276 | #define SCREEN_CURSOR_X(s) the_only_screen.cursor_x |
| 247 | #define SCREEN_CURSOR_Y(s) cursY | 277 | #define SCREEN_CURSOR_Y(s) the_only_screen.cursor_y |
| 248 | #define SCREEN_VISIBLE_P(s) 1 | 278 | #define SCREEN_VISIBLE_P(s) 1 |
| 279 | #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) | ||
| 249 | #define SCREEN_GARBAGED_P(s) screen_garbaged | 280 | #define SCREEN_GARBAGED_P(s) screen_garbaged |
| 250 | #define SCREEN_NO_SPLIT_P(s) 0 | 281 | #define SCREEN_NO_SPLIT_P(s) 0 |
| 251 | #define SCREEN_WANTS_MODELINE_P(s) 1 | 282 | #define SCREEN_WANTS_MODELINE_P(s) 1 |
| 252 | #define SCREEN_ICONIFIED_P(s) 0 | 283 | #define SCREEN_ICONIFIED_P(s) 0 |
| 253 | #define SCREEN_MINIBUF_WINDOW(s) minibuf_window | 284 | #define SCREEN_MINIBUF_WINDOW(s) minibuf_window |
| 254 | #define SCREEN_ROOT_WINDOW(s) root_window | 285 | #define SCREEN_ROOT_WINDOW(s) the_only_screen.root_window |
| 255 | #define SCREEN_SELECTED_WINDOW(s) selected_window | 286 | #define SCREEN_SELECTED_WINDOW(s) selected_window |
| 256 | #define SET_GLYPHS_SCREEN(glyphs,screen) | 287 | #define SET_GLYPHS_SCREEN(glyphs,screen) |
| 257 | #define SCREEN_INSERT_COST(screen) insert_line_cost | 288 | #define SCREEN_INSERT_COST(screen) the_only_screen.insert_line_cost |
| 258 | #define SCREEN_DELETE_COST(screen) delete_line_cost | 289 | #define SCREEN_DELETE_COST(screen) the_only_screen.delete_line_cost |
| 259 | #define SCREEN_INSERTN_COST(screen) insert_n_lines_cost | 290 | #define SCREEN_INSERTN_COST(screen) the_only_screen.insert_n_lines_cost |
| 260 | #define SCREEN_DELETEN_COST(screen) delete_n_lines_cost | 291 | #define SCREEN_DELETEN_COST(screen) the_only_screen.delete_n_lines_cost |
| 261 | #define SCREEN_MESSAGE_BUF(s) message_buf | 292 | #define SCREEN_MESSAGE_BUF(s) the_only_screen.message_buf |
| 262 | #define SCREEN_SCROLL_BOTTOM_VPOS(s) scroll_bottom_vpos | 293 | #define SCREEN_SCROLL_BOTTOM_VPOS(s) the_only_screen.scroll_bottom_vpos |
| 294 | #define SCREEN_FOCUS_SCREEN(s) 0 | ||
| 263 | 295 | ||
| 264 | #define CHECK_SCREEN(x, i) { ; } | 296 | #define CHECK_SCREEN(x, i) { ; } |
| 265 | 297 | #define CHECK_LIVE_SCREEN(x, y) { ; } | |
| 266 | extern int screen_width, screen_height; | 298 | |
| 267 | extern int cursX, cursY; | 299 | /* FOR_EACH_SCREEN (LIST_VAR, SCREEN_VAR) followed by a statement is a |
| 300 | `for' loop which iterates over the elements of Vscreen_list. The | ||
| 301 | loop will set SCREEN_VAR, a SCREEN_PTR, to each screen in | ||
| 302 | Vscreen_list in succession and execute the statement. LIST_VAR | ||
| 303 | should be a Lisp_Object; it is used to iterate through the | ||
| 304 | Vscreen_list. | ||
| 305 | |||
| 306 | If MULTI_SCREEN _is_ defined, then this loop expands to a real | ||
| 307 | `for' loop which traverses Vscreen_list using LIST_VAR and | ||
| 308 | SCREEN_VAR. */ | ||
| 309 | #define FOR_EACH_SCREEN(list_var, screen_var) \ | ||
| 310 | for (screen_var = (SCREEN_PTR) 1; screen_var; screen_var = (SCREEN_PTR) 0) | ||
| 268 | 311 | ||
| 269 | #endif /* not MULTI_SCREEN */ | 312 | #endif /* not MULTI_SCREEN */ |
diff --git a/src/keyboard.c b/src/keyboard.c index 97b98c98b98..cb2e56adf36 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -310,7 +310,7 @@ Lisp_Object Qevent_unmodified; | |||
| 310 | 310 | ||
| 311 | /* Symbols to use for non-text mouse positions. */ | 311 | /* Symbols to use for non-text mouse positions. */ |
| 312 | Lisp_Object Qmode_line; | 312 | Lisp_Object Qmode_line; |
| 313 | Lisp_Object Qvertical_split; | 313 | Lisp_Object Qvertical_line; |
| 314 | 314 | ||
| 315 | 315 | ||
| 316 | /* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt | 316 | /* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt |
| @@ -1625,7 +1625,8 @@ kbd_buffer_get_event () | |||
| 1625 | else if (do_mouse_tracking && mouse_moved) | 1625 | else if (do_mouse_tracking && mouse_moved) |
| 1626 | { | 1626 | { |
| 1627 | SCREEN_PTR screen; | 1627 | SCREEN_PTR screen; |
| 1628 | Lisp_Object x, y, time; | 1628 | Lisp_Object x, y; |
| 1629 | unsigned long time; | ||
| 1629 | 1630 | ||
| 1630 | (*mouse_position_hook) (&screen, &x, &y, &time); | 1631 | (*mouse_position_hook) (&screen, &x, &y, &time); |
| 1631 | XSET (Vlast_event_screen, Lisp_Screen, screen); | 1632 | XSET (Vlast_event_screen, Lisp_Screen, screen); |
| @@ -1779,7 +1780,7 @@ make_lispy_event (event) | |||
| 1779 | if (part == 1) | 1780 | if (part == 1) |
| 1780 | posn = Qmode_line; | 1781 | posn = Qmode_line; |
| 1781 | else if (part == 2) | 1782 | else if (part == 2) |
| 1782 | posn = Qvertical_split; | 1783 | posn = Qvertical_line; |
| 1783 | else | 1784 | else |
| 1784 | XSET (posn, Lisp_Int, | 1785 | XSET (posn, Lisp_Int, |
| 1785 | buffer_posn_from_coords (XWINDOW (window), | 1786 | buffer_posn_from_coords (XWINDOW (window), |
| @@ -1831,7 +1832,7 @@ static Lisp_Object | |||
| 1831 | make_lispy_movement (screen, x, y, time) | 1832 | make_lispy_movement (screen, x, y, time) |
| 1832 | SCREEN_PTR screen; | 1833 | SCREEN_PTR screen; |
| 1833 | Lisp_Object x, y; | 1834 | Lisp_Object x, y; |
| 1834 | Lisp_Object time; | 1835 | unsigned long time; |
| 1835 | { | 1836 | { |
| 1836 | Lisp_Object window; | 1837 | Lisp_Object window; |
| 1837 | int ix, iy; | 1838 | int ix, iy; |
| @@ -1852,7 +1853,7 @@ make_lispy_movement (screen, x, y, time) | |||
| 1852 | if (part == 1) | 1853 | if (part == 1) |
| 1853 | posn = Qmode_line; | 1854 | posn = Qmode_line; |
| 1854 | else if (part == 2) | 1855 | else if (part == 2) |
| 1855 | posn = Qvertical_split; | 1856 | posn = Qvertical_line; |
| 1856 | else | 1857 | else |
| 1857 | XSET (posn, Lisp_Int, buffer_posn_from_coords (XWINDOW (window), | 1858 | XSET (posn, Lisp_Int, buffer_posn_from_coords (XWINDOW (window), |
| 1858 | ix, iy)); | 1859 | ix, iy)); |
| @@ -1864,7 +1865,7 @@ make_lispy_movement (screen, x, y, time) | |||
| 1864 | Fcons (window, | 1865 | Fcons (window, |
| 1865 | Fcons (posn, | 1866 | Fcons (posn, |
| 1866 | Fcons (Fcons (x, y), | 1867 | Fcons (Fcons (x, y), |
| 1867 | Fcons (time, Qnil))))); | 1868 | Fcons (make_number (time), Qnil))))); |
| 1868 | } | 1869 | } |
| 1869 | 1870 | ||
| 1870 | 1871 | ||
| @@ -2638,6 +2639,7 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 2638 | 2639 | ||
| 2639 | Vquit_flag = Qnil; | 2640 | Vquit_flag = Qnil; |
| 2640 | 2641 | ||
| 2642 | #ifdef MULTI_SCREEN | ||
| 2641 | /* What buffer was this event typed/moused at? */ | 2643 | /* What buffer was this event typed/moused at? */ |
| 2642 | if (XTYPE (key) == Lisp_Int || XTYPE (key) == Lisp_Symbol) | 2644 | if (XTYPE (key) == Lisp_Int || XTYPE (key) == Lisp_Symbol) |
| 2643 | buf = (XBUFFER | 2645 | buf = (XBUFFER |
| @@ -2674,6 +2676,7 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 2674 | 2676 | ||
| 2675 | goto restart; | 2677 | goto restart; |
| 2676 | } | 2678 | } |
| 2679 | #endif | ||
| 2677 | } | 2680 | } |
| 2678 | 2681 | ||
| 2679 | first_binding = (follow_key (key, | 2682 | first_binding = (follow_key (key, |
| @@ -3512,8 +3515,8 @@ syms_of_keyboard () | |||
| 3512 | 3515 | ||
| 3513 | Qmode_line = intern ("mode-line"); | 3516 | Qmode_line = intern ("mode-line"); |
| 3514 | staticpro (&Qmode_line); | 3517 | staticpro (&Qmode_line); |
| 3515 | Qvertical_split = intern ("vertical-split"); | 3518 | Qvertical_line = intern ("vertical-line"); |
| 3516 | staticpro (&Qvertical_split); | 3519 | staticpro (&Qvertical_line); |
| 3517 | 3520 | ||
| 3518 | Qevent_kind = intern ("event-type"); | 3521 | Qevent_kind = intern ("event-type"); |
| 3519 | staticpro (&Qevent_kind); | 3522 | staticpro (&Qevent_kind); |
diff --git a/src/keyboard.h b/src/keyboard.h index a1b00ba94cf..d1cb78d7827 100644 --- a/src/keyboard.h +++ b/src/keyboard.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* Declarations useful when processing input. | 1 | /* Declarations useful when processing input. |
| 2 | Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | 6 | GNU Emacs is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 1, or (at your option) | 8 | the Free Software Foundation; either version 2, or (at your option) |
| 9 | any later version. | 9 | any later version. |
| 10 | 10 | ||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | 11 | GNU Emacs is distributed in the hope that it will be useful, |
| @@ -64,5 +64,5 @@ extern Lisp_Object Qscrollbar_click; | |||
| 64 | (Fget ((event_head), Qevent_kind)) | 64 | (Fget ((event_head), Qevent_kind)) |
| 65 | 65 | ||
| 66 | /* Symbols to use for non-text mouse positions. */ | 66 | /* Symbols to use for non-text mouse positions. */ |
| 67 | extern Lisp_Object Qmode_line, Qvertical_split; | 67 | extern Lisp_Object Qmode_line, Qvertical_line; |
| 68 | 68 | ||
diff --git a/src/lisp.h b/src/lisp.h index 86885456602..d981fd74bc5 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -97,30 +97,33 @@ enum Lisp_Type | |||
| 97 | Lisp_Internal_Stream, | 97 | Lisp_Internal_Stream, |
| 98 | 98 | ||
| 99 | /* Used in a symbol value cell when the symbol's value is per-buffer. | 99 | /* Used in a symbol value cell when the symbol's value is per-buffer. |
| 100 | The actual contents are a cons cell which starts a list like this: | 100 | The actual contents are a cons cell which starts a list like this: |
| 101 | (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE)). | 101 | (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE). |
| 102 | 102 | ||
| 103 | BUFFER is the last buffer for which this symbol's value was | 103 | BUFFER is the last buffer for which this symbol's value was |
| 104 | made up to date. | 104 | made up to date. |
| 105 | 105 | ||
| 106 | CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's | 106 | CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's |
| 107 | b_local_var_alist, that being the element whose car is this variable. | 107 | local_var_alist, that being the element whose car is this |
| 108 | Or it can be a pointer to the (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), if BUFFER | 108 | variable. Or it can be a pointer to the |
| 109 | does not have an element in its alist for this variable | 109 | (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), |
| 110 | (that is, if BUFFER sees the default value of this variable). | 110 | if BUFFER does not have an element in its alist for this |
| 111 | 111 | variable (that is, if BUFFER sees the default value of this | |
| 112 | If we want to examine or set the value and BUFFER is current, | 112 | variable). |
| 113 | we just examine or set REALVALUE. | 113 | |
| 114 | If BUFFER is not current, we store the current REALVALUE value into | 114 | If we want to examine or set the value and BUFFER is current, |
| 115 | CURRENT-ALIST-ELEMENT, then find the appropriate alist element for | 115 | we just examine or set REALVALUE. If BUFFER is not current, we |
| 116 | the buffer now current and set up CURRENT-ALIST-ELEMENT. | 116 | store the current REALVALUE value into CURRENT-ALIST-ELEMENT, |
| 117 | Then we set REALVALUE out of that element, and store into BUFFER. | 117 | then find the appropriate alist element for the buffer now |
| 118 | 118 | current and set up CURRENT-ALIST-ELEMENT. Then we set | |
| 119 | If we are setting the variable and the current buffer does not have | 119 | REALVALUE out of that element, and store into BUFFER. |
| 120 | an alist entry for this variable, an alist entry is created. | 120 | |
| 121 | 121 | If we are setting the variable and the current buffer does not | |
| 122 | Note that REALVALUE can be a forwarding pointer. | 122 | have an alist entry for this variable, an alist entry is |
| 123 | Each time it is examined or set, forwarding must be done. */ | 123 | created. |
| 124 | |||
| 125 | Note that REALVALUE can be a forwarding pointer. Each time it | ||
| 126 | is examined or set, forwarding must be done. */ | ||
| 124 | Lisp_Buffer_Local_Value, | 127 | Lisp_Buffer_Local_Value, |
| 125 | 128 | ||
| 126 | /* Like Lisp_Buffer_Local_Value with one difference: | 129 | /* Like Lisp_Buffer_Local_Value with one difference: |
diff --git a/src/lread.c b/src/lread.c index 1f81d76b69c..630a39a4fb0 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -188,6 +188,7 @@ DEFUN ("read-event", Fread_event, Sread_event, 0, 0, 0, | |||
| 188 | val = read_char (0); | 188 | val = read_char (0); |
| 189 | return val; | 189 | return val; |
| 190 | } | 190 | } |
| 191 | #endif | ||
| 191 | 192 | ||
| 192 | DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 0, 0, | 193 | DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 0, 0, |
| 193 | "Read a character from the command input (keyboard or macro).\n\ | 194 | "Read a character from the command input (keyboard or macro).\n\ |
| @@ -206,7 +207,6 @@ It is returned as a number. Non character events are ignored.") | |||
| 206 | 207 | ||
| 207 | return val; | 208 | return val; |
| 208 | } | 209 | } |
| 209 | #endif /* HAVE_X_WINDOWS */ | ||
| 210 | 210 | ||
| 211 | DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, | 211 | DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, |
| 212 | "Don't use this yourself.") | 212 | "Don't use this yourself.") |
| @@ -501,7 +501,7 @@ readevalloop (readcharfun, stream, evalfun, printflag) | |||
| 501 | 501 | ||
| 502 | #ifndef standalone | 502 | #ifndef standalone |
| 503 | 503 | ||
| 504 | DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 1, "", | 504 | DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 2, "", |
| 505 | "Execute the current buffer as Lisp code.\n\ | 505 | "Execute the current buffer as Lisp code.\n\ |
| 506 | Programs can pass two arguments, BUFFER and PRINTFLAG.\n\ | 506 | Programs can pass two arguments, BUFFER and PRINTFLAG.\n\ |
| 507 | BUFFER is the buffer to evaluate (nil means use current buffer).\n\ | 507 | BUFFER is the buffer to evaluate (nil means use current buffer).\n\ |
diff --git a/src/minibuf.c b/src/minibuf.c index e024e5ecd11..9f96f15d5df 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -348,7 +348,7 @@ If non-nil second arg INITIAL-INPUT is a string to insert before reading.") | |||
| 348 | return Fread_from_minibuffer (prompt, initial_input, Qnil, Qnil, Qnil); | 348 | return Fread_from_minibuffer (prompt, initial_input, Qnil, Qnil, Qnil); |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 2, 1, 0, | 351 | DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 2, 2, 0, |
| 352 | "Args PROMPT and INIT, strings. Read a string from the terminal, not allowing blanks.\n\ | 352 | "Args PROMPT and INIT, strings. Read a string from the terminal, not allowing blanks.\n\ |
| 353 | Prompt with PROMPT, and provide INIT as an initial value of the input string.") | 353 | Prompt with PROMPT, and provide INIT as an initial value of the input string.") |
| 354 | (prompt, init) | 354 | (prompt, init) |
diff --git a/src/print.c b/src/print.c index 2cd2b9c781e..534d5d67b22 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -159,7 +159,7 @@ glyph_to_str_cpy (glyphs, str) | |||
| 159 | 159 | ||
| 160 | #define PRINTCHAR(ch) printchar (ch, printcharfun) | 160 | #define PRINTCHAR(ch) printchar (ch, printcharfun) |
| 161 | 161 | ||
| 162 | /* Index of first unused element of message_buf */ | 162 | /* Index of first unused element of SCREEN_MESSAGE_BUF(selected_screen). */ |
| 163 | static int printbufidx; | 163 | static int printbufidx; |
| 164 | 164 | ||
| 165 | static void | 165 | static void |
diff --git a/src/scroll.c b/src/scroll.c index 64dfd9aef25..ed45318a26b 100644 --- a/src/scroll.c +++ b/src/scroll.c | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* Calculate what line insertion or deletion to do, and do it, | 1 | /* Calculate what line insertion or deletion to do, and do it, |
| 2 | Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 1986, 1990, 1992 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | 6 | GNU Emacs is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 1, or (at your option) | 8 | the Free Software Foundation; either version 2, or (at your option) |
| 9 | any later version. | 9 | any later version. |
| 10 | 10 | ||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | 11 | GNU Emacs is distributed in the hope that it will be useful, |
| @@ -54,15 +54,6 @@ struct matrix_elt | |||
| 54 | char deletecount; | 54 | char deletecount; |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | /* See do_line_insertion_deletion_costs for info on these arrays. */ | ||
| 58 | |||
| 59 | #ifndef MULTI_SCREEN | ||
| 60 | static int *insert_line_cost; | ||
| 61 | static int *delete_line_cost; | ||
| 62 | static int *insert_n_lines_cost; | ||
| 63 | static int *delete_n_lines_cost; | ||
| 64 | #endif | ||
| 65 | |||
| 66 | 57 | ||
| 67 | /* Determine, in matrix[i,j], the cost of updating the first j old lines | 58 | /* Determine, in matrix[i,j], the cost of updating the first j old lines |
| 68 | into the first i new lines. | 59 | into the first i new lines. |
diff --git a/src/term.c b/src/term.c index e9f7ddbcd18..3663c44ff91 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -43,11 +43,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 43 | /* Terminal charateristics that higher levels want to look at. | 43 | /* Terminal charateristics that higher levels want to look at. |
| 44 | These are all extern'd in termchar.h */ | 44 | These are all extern'd in termchar.h */ |
| 45 | 45 | ||
| 46 | #ifndef MULTI_SCREEN | ||
| 47 | int screen_width; /* Number of usable columns */ | ||
| 48 | int screen_height; /* Number of lines */ | ||
| 49 | #endif | ||
| 50 | |||
| 51 | int must_write_spaces; /* Nonzero means spaces in the text | 46 | int must_write_spaces; /* Nonzero means spaces in the text |
| 52 | must actually be output; can't just skip | 47 | must actually be output; can't just skip |
| 53 | over some columns to leave them blank. */ | 48 | over some columns to leave them blank. */ |
| @@ -103,7 +98,7 @@ int (*read_socket_hook) (); | |||
| 103 | void (*mouse_position_hook) ( /* SCREEN_PTR *s, | 98 | void (*mouse_position_hook) ( /* SCREEN_PTR *s, |
| 104 | Lisp_Object *x, | 99 | Lisp_Object *x, |
| 105 | Lisp_Object *y, | 100 | Lisp_Object *y, |
| 106 | Lisp_Object *time */ ); | 101 | unsigned long *time */ ); |
| 107 | 102 | ||
| 108 | /* When reading from a minibuffer in a different screen, Emacs wants | 103 | /* When reading from a minibuffer in a different screen, Emacs wants |
| 109 | to shift the highlight from the selected screen to the minibuffer's | 104 | to shift the highlight from the selected screen to the minibuffer's |
diff --git a/src/termchar.h b/src/termchar.h index d82ccb0bad9..7a93d762bb4 100644 --- a/src/termchar.h +++ b/src/termchar.h | |||
| @@ -19,8 +19,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | extern int baud_rate; /* Output speed in baud */ | 21 | extern int baud_rate; /* Output speed in baud */ |
| 22 | extern int screen_width; /* Number of usable columns */ | ||
| 23 | extern int screen_height; /* Number of lines */ | ||
| 24 | extern int must_write_spaces; /* Nonzero means spaces in the text | 22 | extern int must_write_spaces; /* Nonzero means spaces in the text |
| 25 | must actually be output; can't just skip | 23 | must actually be output; can't just skip |
| 26 | over some columns to leave them blank. */ | 24 | over some columns to leave them blank. */ |
diff --git a/src/termhooks.h b/src/termhooks.h index b9363eb16d7..5b5cac7315e 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -50,7 +50,7 @@ extern int (*read_socket_hook) (); | |||
| 50 | extern void (*mouse_position_hook) ( /* SCREEN_PTR *s, | 50 | extern void (*mouse_position_hook) ( /* SCREEN_PTR *s, |
| 51 | Lisp_Object *x, | 51 | Lisp_Object *x, |
| 52 | Lisp_Object *y, | 52 | Lisp_Object *y, |
| 53 | Lisp_Object *time */ ); | 53 | unsigned long *time */ ); |
| 54 | 54 | ||
| 55 | /* The window system handling code should set this if the mouse has | 55 | /* The window system handling code should set this if the mouse has |
| 56 | moved since the last call to the mouse_position_hook. Calling that | 56 | moved since the last call to the mouse_position_hook. Calling that |
| @@ -135,8 +135,20 @@ struct input_event { | |||
| 135 | 135 | ||
| 136 | Lisp_Object code; | 136 | Lisp_Object code; |
| 137 | Lisp_Object part; | 137 | Lisp_Object part; |
| 138 | |||
| 139 | /* This is obviously wrong, but I'm not sure what else I should do. | ||
| 140 | Obviously, this should be a SCREEN_PTR. But that would require that | ||
| 141 | every file which #includes this one should also #include "screen.h", | ||
| 142 | which would mean that files like cm.c and other innocents would be | ||
| 143 | dragged into the set of screen.h users. Maybe the definition of this | ||
| 144 | structure should be elsewhere? In its own file? */ | ||
| 145 | #ifdef MULTI_SCREEN | ||
| 138 | struct screen *screen; | 146 | struct screen *screen; |
| 147 | #else | ||
| 148 | int screen; | ||
| 149 | #endif | ||
| 139 | int modifiers; /* See enum below for interpretation. */ | 150 | int modifiers; /* See enum below for interpretation. */ |
| 151 | |||
| 140 | Lisp_Object x, y; | 152 | Lisp_Object x, y; |
| 141 | unsigned long timestamp; | 153 | unsigned long timestamp; |
| 142 | }; | 154 | }; |
diff --git a/src/window.c b/src/window.c index ddb2661c71b..b1876a219bb 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -47,14 +47,6 @@ static struct window *decode_window(); | |||
| 47 | 47 | ||
| 48 | Lisp_Object selected_window; | 48 | Lisp_Object selected_window; |
| 49 | 49 | ||
| 50 | #ifndef MULTI_SCREEN | ||
| 51 | |||
| 52 | /* The root window for the screen. | ||
| 53 | This is accessed via SCREEN_ROOT_WINDOW (selected_screen). */ | ||
| 54 | Lisp_Object root_window; | ||
| 55 | |||
| 56 | #endif | ||
| 57 | |||
| 58 | /* The minibuffer window of the selected screen. | 50 | /* The minibuffer window of the selected screen. |
| 59 | Note that you cannot test for minibufferness of an arbitrary window | 51 | Note that you cannot test for minibufferness of an arbitrary window |
| 60 | by comparing against this; but you can test for minibufferness of | 52 | by comparing against this; but you can test for minibufferness of |
| @@ -222,7 +214,7 @@ POS defaults to point; WINDOW, to the selected window.") | |||
| 222 | posval = *compute_motion (top, 0, 0, posint, height, 0, | 214 | posval = *compute_motion (top, 0, 0, posint, height, 0, |
| 223 | XFASTINT (w->width) - 1 | 215 | XFASTINT (w->width) - 1 |
| 224 | - (XFASTINT (w->width) + XFASTINT (w->left) | 216 | - (XFASTINT (w->width) + XFASTINT (w->left) |
| 225 | != XSCREEN (w->screen)->width), | 217 | != SCREEN_WIDTH (XSCREEN (w->screen))), |
| 226 | XINT (w->hscroll), 0); | 218 | XINT (w->hscroll), 0); |
| 227 | 219 | ||
| 228 | return posval.vpos < height ? Qt : Qnil; | 220 | return posval.vpos < height ? Qt : Qnil; |
| @@ -363,9 +355,9 @@ measured in characters from the upper-left corner of the screen.\n\ | |||
| 363 | screen.\n\ | 355 | screen.\n\ |
| 364 | If COORDINATES are in the text portion of WINDOW,\n\ | 356 | If COORDINATES are in the text portion of WINDOW,\n\ |
| 365 | the coordinates relative to the window are returned.\n\ | 357 | the coordinates relative to the window are returned.\n\ |
| 366 | If they are in the mode line of WINDOW, 'mode-line is returned.\n\ | 358 | If they are in the mode line of WINDOW, `mode-line' is returned.\n\ |
| 367 | If they are on the border between WINDOW and its right sibling,\n\ | 359 | If they are on the border between WINDOW and its right sibling,\n\ |
| 368 | 'vertical-split is returned.") | 360 | `vertical-line' is returned.") |
| 369 | (coordinates, window) | 361 | (coordinates, window) |
| 370 | register Lisp_Object coordinates, window; | 362 | register Lisp_Object coordinates, window; |
| 371 | { | 363 | { |
| @@ -388,7 +380,7 @@ If they are on the border between WINDOW and its right sibling,\n\ | |||
| 388 | return Qmode_line; | 380 | return Qmode_line; |
| 389 | 381 | ||
| 390 | case 3: /* On right border of window. */ | 382 | case 3: /* On right border of window. */ |
| 391 | return Qvertical_split; | 383 | return Qvertical_line; |
| 392 | 384 | ||
| 393 | default: | 385 | default: |
| 394 | abort (); | 386 | abort (); |
| @@ -642,8 +634,8 @@ replace_window (old, replacement) | |||
| 642 | /* If OLD is its screen's root_window, then replacement is the new | 634 | /* If OLD is its screen's root_window, then replacement is the new |
| 643 | root_window for that screen. */ | 635 | root_window for that screen. */ |
| 644 | 636 | ||
| 645 | if (old == XSCREEN (o->screen)->root_window) | 637 | if (old == SCREEN_ROOT_WINDOW (XSCREEN (o->screen))) |
| 646 | XSCREEN (o->screen)->root_window = replacement; | 638 | SCREEN_ROOT_WINDOW (XSCREEN (o->screen)) = replacement; |
| 647 | 639 | ||
| 648 | p->left = o->left; | 640 | p->left = o->left; |
| 649 | p->top = o->top; | 641 | p->top = o->top; |
| @@ -1062,7 +1054,8 @@ window_loop (type, obj, mini, screens) | |||
| 1062 | 1054 | ||
| 1063 | case GET_LRU_WINDOW: | 1055 | case GET_LRU_WINDOW: |
| 1064 | /* t as arg means consider only full-width windows */ | 1056 | /* t as arg means consider only full-width windows */ |
| 1065 | if (!NILP (obj) && XFASTINT (XWINDOW (w)->width) != screen->width) | 1057 | if (!NILP (obj) && XFASTINT (XWINDOW (w)->width) |
| 1058 | != SCREEN_WIDTH (screen)) | ||
| 1066 | break; | 1059 | break; |
| 1067 | #if 0 | 1060 | #if 0 |
| 1068 | /* Ignore invisible and iconified screens. */ | 1061 | /* Ignore invisible and iconified screens. */ |
| @@ -2614,32 +2607,33 @@ init_window_once () | |||
| 2614 | #else /* not MULTI_SCREEN */ | 2607 | #else /* not MULTI_SCREEN */ |
| 2615 | extern Lisp_Object get_minibuffer (); | 2608 | extern Lisp_Object get_minibuffer (); |
| 2616 | 2609 | ||
| 2617 | root_window = make_window (); | 2610 | SCREEN_ROOT_WINDOW (selected_screen) = make_window (); |
| 2618 | minibuf_window = make_window (); | 2611 | minibuf_window = make_window (); |
| 2619 | 2612 | ||
| 2620 | XWINDOW (root_window)->next = minibuf_window; | 2613 | XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->next = minibuf_window; |
| 2621 | XWINDOW (minibuf_window)->prev = root_window; | 2614 | XWINDOW (minibuf_window)->prev = SCREEN_ROOT_WINDOW (selected_screen); |
| 2622 | 2615 | ||
| 2623 | /* These values 9 and 10 are arbitrary, | 2616 | /* These values 9 and 10 are arbitrary, |
| 2624 | just so that there is "something there." | 2617 | just so that there is "something there." |
| 2625 | Correct values are put in in init_xdisp */ | 2618 | Correct values are put in in init_xdisp */ |
| 2626 | 2619 | ||
| 2627 | XFASTINT (XWINDOW (root_window)->width) = 10; | 2620 | XFASTINT (XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->width) = 10; |
| 2628 | XFASTINT (XWINDOW (minibuf_window)->width) = 10; | 2621 | XFASTINT (XWINDOW (minibuf_window)->width) = 10; |
| 2629 | 2622 | ||
| 2630 | XFASTINT (XWINDOW (root_window)->height) = 9; | 2623 | XFASTINT (XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->height) = 9; |
| 2631 | XFASTINT (XWINDOW (minibuf_window)->top) = 9; | 2624 | XFASTINT (XWINDOW (minibuf_window)->top) = 9; |
| 2632 | XFASTINT (XWINDOW (minibuf_window)->height) = 1; | 2625 | XFASTINT (XWINDOW (minibuf_window)->height) = 1; |
| 2633 | 2626 | ||
| 2634 | /* Prevent error in Fset_window_buffer. */ | 2627 | /* Prevent error in Fset_window_buffer. */ |
| 2635 | XWINDOW (root_window)->buffer = Qt; | 2628 | XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->buffer = Qt; |
| 2636 | XWINDOW (minibuf_window)->buffer = Qt; | 2629 | XWINDOW (minibuf_window)->buffer = Qt; |
| 2637 | 2630 | ||
| 2638 | /* Now set them up for real. */ | 2631 | /* Now set them up for real. */ |
| 2639 | Fset_window_buffer (root_window, Fcurrent_buffer ()); | 2632 | Fset_window_buffer (SCREEN_ROOT_WINDOW (selected_screen), |
| 2633 | Fcurrent_buffer ()); | ||
| 2640 | Fset_window_buffer (minibuf_window, get_minibuffer (0)); | 2634 | Fset_window_buffer (minibuf_window, get_minibuffer (0)); |
| 2641 | 2635 | ||
| 2642 | selected_window = root_window; | 2636 | selected_window = SCREEN_ROOT_WINDOW (selected_screen); |
| 2643 | /* Make sure this window seems more recently used than | 2637 | /* Make sure this window seems more recently used than |
| 2644 | a newly-created, never-selected window. Increment | 2638 | a newly-created, never-selected window. Increment |
| 2645 | window_select_count so the first selection ever will get | 2639 | window_select_count so the first selection ever will get |
diff --git a/src/window.h b/src/window.h index eedaef3be16..62a6c5b0c2e 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* Window definitions for GNU Emacs. | 1 | /* Window definitions for GNU Emacs. |
| 2 | Copyright (C) 1985, 1986 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | 6 | GNU Emacs is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 1, or (at your option) | 8 | the Free Software Foundation; either version 2, or (at your option) |
| 9 | any later version. | 9 | any later version. |
| 10 | 10 | ||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | 11 | GNU Emacs is distributed in the hope that it will be useful, |
diff --git a/src/xdisp.c b/src/xdisp.c index 60bdafea9d8..2808c515d47 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -167,31 +167,7 @@ int clip_changed; | |||
| 167 | int windows_or_buffers_changed; | 167 | int windows_or_buffers_changed; |
| 168 | 168 | ||
| 169 | 169 | ||
| 170 | #ifndef MULTI_SCREEN | 170 | /* Nonzero if SCREEN_MESSAGE_BUF (selected_screen) is being used by print; |
| 171 | |||
| 172 | DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", | ||
| 173 | "Clear the screen and output again what is supposed to appear on it.") | ||
| 174 | () | ||
| 175 | { | ||
| 176 | if (screen_height == 0) abort (); /* Some bug zeros some core */ | ||
| 177 | clear_screen (); | ||
| 178 | fflush (stdout); | ||
| 179 | clear_screen_records (); | ||
| 180 | if (screen_height == 0) abort (); /* Some bug zeros some core */ | ||
| 181 | windows_or_buffers_changed++; | ||
| 182 | /* Mark all windows as INaccurate, | ||
| 183 | so that every window will have its redisplay done. */ | ||
| 184 | mark_window_display_accurate (XWINDOW (minibuf_window)->prev, 0); | ||
| 185 | if (screen_height == 0) abort (); /* Some bug zeros some core */ | ||
| 186 | return Qnil; | ||
| 187 | } | ||
| 188 | |||
| 189 | #endif /* not MULTI_SCREEN */ | ||
| 190 | |||
| 191 | /* Buffer used for messages formatted by `message'. */ | ||
| 192 | char *message_buf; | ||
| 193 | |||
| 194 | /* Nonzero if message_buf is being used by print; | ||
| 195 | zero if being used by message. */ | 171 | zero if being used by message. */ |
| 196 | int message_buf_print; | 172 | int message_buf_print; |
| 197 | 173 | ||
| @@ -310,7 +286,7 @@ echo_area_display () | |||
| 310 | 286 | ||
| 311 | /* If desired cursor location is on this line, put it at end of text */ | 287 | /* If desired cursor location is on this line, put it at end of text */ |
| 312 | if (SCREEN_CURSOR_Y (s) == vpos) | 288 | if (SCREEN_CURSOR_Y (s) == vpos) |
| 313 | SCREEN_CURSOR_X (s) = s->desired_glyphs->used[vpos]; | 289 | SCREEN_CURSOR_X (s) = SCREEN_DESIRED_GLYPHS (s)->used[vpos]; |
| 314 | 290 | ||
| 315 | /* Fill the rest of the minibuffer window with blank lines. */ | 291 | /* Fill the rest of the minibuffer window with blank lines. */ |
| 316 | { | 292 | { |
| @@ -1786,7 +1762,7 @@ display_mode_line (w) | |||
| 1786 | and the rest of this line is mode lines of the sibling windows). */ | 1762 | and the rest of this line is mode lines of the sibling windows). */ |
| 1787 | if (XFASTINT (w->width) == SCREEN_WIDTH (s) | 1763 | if (XFASTINT (w->width) == SCREEN_WIDTH (s) |
| 1788 | || XFASTINT (XWINDOW (w->parent)->width) == SCREEN_WIDTH (s)) | 1764 | || XFASTINT (XWINDOW (w->parent)->width) == SCREEN_WIDTH (s)) |
| 1789 | s->desired_glyphs->highlight[vpos] = mode_line_inverse_video; | 1765 | SCREEN_DESIRED_GLYPHS (s)->highlight[vpos] = mode_line_inverse_video; |
| 1790 | 1766 | ||
| 1791 | #ifdef HAVE_X_WINDOWS | 1767 | #ifdef HAVE_X_WINDOWS |
| 1792 | /* I'm trying this out because I saw Unimpress use it, but it's | 1768 | /* I'm trying this out because I saw Unimpress use it, but it's |
| @@ -2325,10 +2301,6 @@ If this is zero, point is always centered after it moves off screen."); | |||
| 2325 | DEFVAR_BOOL ("mode-line-inverse-video", &mode_line_inverse_video, | 2301 | DEFVAR_BOOL ("mode-line-inverse-video", &mode_line_inverse_video, |
| 2326 | "*Non-nil means use inverse video for the mode line."); | 2302 | "*Non-nil means use inverse video for the mode line."); |
| 2327 | mode_line_inverse_video = 1; | 2303 | mode_line_inverse_video = 1; |
| 2328 | |||
| 2329 | #ifndef MULTI_SCREEN | ||
| 2330 | defsubr (&Sredraw_display); | ||
| 2331 | #endif /* MULTI_SCREEN */ | ||
| 2332 | } | 2304 | } |
| 2333 | 2305 | ||
| 2334 | /* initialize the window system */ | 2306 | /* initialize the window system */ |
diff --git a/src/xselect.c.old b/src/xselect.c.old index dea8a1cfca9..8c818b90746 100644 --- a/src/xselect.c.old +++ b/src/xselect.c.old | |||
| @@ -193,7 +193,7 @@ use X selections.") | |||
| 193 | { | 193 | { |
| 194 | BLOCK_INPUT; | 194 | BLOCK_INPUT; |
| 195 | XStoreBytes (x_current_display, | 195 | XStoreBytes (x_current_display, |
| 196 | XSTRING (string)->data, | 196 | (char *) XSTRING (string)->data, |
| 197 | XSTRING (string)->size); | 197 | XSTRING (string)->size); |
| 198 | UNBLOCK_INPUT; | 198 | UNBLOCK_INPUT; |
| 199 | } | 199 | } |
diff --git a/src/xterm.c b/src/xterm.c index 194f8d6177a..43f59d03ad2 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1522,7 +1522,7 @@ construct_mouse_click (result, event, s, part, prefix) | |||
| 1522 | other kinds of events (focus changes and button clicks, for | 1522 | other kinds of events (focus changes and button clicks, for |
| 1523 | example), or by XQueryPointer calls; when one of these happens, we | 1523 | example), or by XQueryPointer calls; when one of these happens, we |
| 1524 | get another MotionNotify event the next time the mouse moves. This | 1524 | get another MotionNotify event the next time the mouse moves. This |
| 1525 | is at least as efficient than getting motion events when mouse | 1525 | is at least as efficient as getting motion events when mouse |
| 1526 | tracking is on, and I suspect only negligibly worse when tracking | 1526 | tracking is on, and I suspect only negligibly worse when tracking |
| 1527 | is off. | 1527 | is off. |
| 1528 | 1528 | ||
| @@ -1536,6 +1536,14 @@ construct_mouse_click (result, event, s, part, prefix) | |||
| 1536 | static SCREEN_PTR last_mouse_screen; | 1536 | static SCREEN_PTR last_mouse_screen; |
| 1537 | static XRectangle last_mouse_glyph; | 1537 | static XRectangle last_mouse_glyph; |
| 1538 | 1538 | ||
| 1539 | /* This is a hack. We would really prefer that XTmouse_position would | ||
| 1540 | return the time associated with the position it returns, but there | ||
| 1541 | doesn't seem to be any way to wrest the timestamp from the server | ||
| 1542 | along with the position query. So, we just keep track of the time | ||
| 1543 | of the last movement we received, and return that in hopes that | ||
| 1544 | it's somewhat accurate. */ | ||
| 1545 | static Time last_mouse_movement_time; | ||
| 1546 | |||
| 1539 | /* Function to report a mouse movement to the mainstream Emacs code. | 1547 | /* Function to report a mouse movement to the mainstream Emacs code. |
| 1540 | The input handler calls this. | 1548 | The input handler calls this. |
| 1541 | 1549 | ||
| @@ -1549,6 +1557,8 @@ note_mouse_position (screen, event) | |||
| 1549 | XMotionEvent *event; | 1557 | XMotionEvent *event; |
| 1550 | 1558 | ||
| 1551 | { | 1559 | { |
| 1560 | last_mouse_movement_time = event->time; | ||
| 1561 | |||
| 1552 | /* Has the mouse moved off the glyph it was on at the last sighting? */ | 1562 | /* Has the mouse moved off the glyph it was on at the last sighting? */ |
| 1553 | if (event->x < last_mouse_glyph.x | 1563 | if (event->x < last_mouse_glyph.x |
| 1554 | || event->x >= last_mouse_glyph.x + last_mouse_glyph.width | 1564 | || event->x >= last_mouse_glyph.x + last_mouse_glyph.width |
| @@ -1580,7 +1590,7 @@ static void | |||
| 1580 | XTmouse_position (s, x, y, time) | 1590 | XTmouse_position (s, x, y, time) |
| 1581 | SCREEN_PTR *s; | 1591 | SCREEN_PTR *s; |
| 1582 | Lisp_Object *x, *y; | 1592 | Lisp_Object *x, *y; |
| 1583 | Lisp_Object *time; | 1593 | unsigned long *time; |
| 1584 | { | 1594 | { |
| 1585 | int ix, iy, dummy; | 1595 | int ix, iy, dummy; |
| 1586 | Display *d = x_current_display; | 1596 | Display *d = x_current_display; |
| @@ -1635,8 +1645,11 @@ XTmouse_position (s, x, y, time) | |||
| 1635 | mouse_moved = 0; | 1645 | mouse_moved = 0; |
| 1636 | 1646 | ||
| 1637 | /* I don't know how to find the time for the last movement; it seems | 1647 | /* I don't know how to find the time for the last movement; it seems |
| 1638 | like XQueryPointer ought to return it, but it doesn't. */ | 1648 | like XQueryPointer ought to return it, but it doesn't. So, we'll |
| 1639 | *time = Qnil; | 1649 | return the time of the last MotionNotify event we received. Note |
| 1650 | that the use of motion hints means that this isn't guaranteed to | ||
| 1651 | be accurate at all. */ | ||
| 1652 | *time = last_mouse_movement_time; | ||
| 1640 | 1653 | ||
| 1641 | UNBLOCK_INPUT; | 1654 | UNBLOCK_INPUT; |
| 1642 | } | 1655 | } |