Mercurial > emacs
changeset 732:a8d94735277e
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Tue, 30 Jun 1992 13:54:21 +0000 |
parents | 5c6db33a9ef6 |
children | 62dd28940dc6 |
files | configure1.in lisp/=diary-lib.el lisp/=isearch-old.el lisp/abbrev.el lisp/calendar/calendar.el lisp/calendar/holidays.el lisp/completion.el lisp/emacs-lisp/autoload.el lisp/help.el lisp/indent.el lisp/info.el lisp/progmodes/compile.el lisp/replace.el lisp/textmodes/fill.el lisp/textmodes/paragraphs.el lisp/textmodes/texnfo-upd.el src/.gdbinit src/=Makefile.in src/=xselect.c.old src/callint.c src/dispextern.h src/dispnew.c src/emacs.c src/eval.c src/fileio.c src/frame.c src/frame.h src/keyboard.c src/keyboard.h src/lisp.h src/lread.c src/minibuf.c src/print.c src/scroll.c src/term.c src/termchar.h src/termhooks.h src/window.c src/window.h src/xdisp.c src/xterm.c |
diffstat | 41 files changed, 512 insertions(+), 400 deletions(-) [+] |
line wrap: on
line diff
--- a/configure1.in Tue Jun 30 13:49:39 1992 +0000 +++ b/configure1.in Tue Jun 30 13:54:21 1992 +0000 @@ -68,7 +68,7 @@ if [ ! -r ./src/lisp.h ]; then echo "${progname}: Can't find Emacs sources in \`./src'. -Run this config script in the top directory of the Emacs source tree." 1>&2 +Run this config script in the top directory of the Emacs source tree." >&2 exit 1 fi @@ -139,7 +139,11 @@ ;; *:${opt}*:${opt}*:* ) # Ambiguous prefix. echo "\`-${opt}' is an ambiguous switch; it could be any of the following:" - echo `echo ${options} | tr ':' '\012' | grep '^'${opt}` + # We can't just use tr to translate colons to newlines, since + # BSD sed and SYSV sed use different syntaxes for that. + spaced_options=`echo ${options} | tr ':' ' '` + echo `(for option in ${spaced_options}; do echo $option; done) \ + | grep "^${opt}"` echo ${short_usage} exit 1 ;; @@ -170,7 +174,7 @@ n | no ) val=no ;; * ) echo "The \`-${optvar}' option (\`-${opt}') is supposed to have a boolean - value - set it to either \`yes' or \`no'." 1>&2 + value - set it to either \`yes' or \`no'." >&2 exit 1 ;; esac @@ -208,7 +212,7 @@ if [ ! -r src/${machfile} ]; then echo "${progname}: Emacs has no configuration info for the machine called \`${machine}'. Look at etc/MACHINES for the names of machines -that Emacs has been ported to." 1>&2 +that Emacs has been ported to." >&2 exit 1 fi @@ -226,7 +230,7 @@ system a \`${machine}' machine might run. Try specifying the operating system explicitly by passing ${progname} an \`-opsystem=SYSTEM-NAME' flag. Look at etc/MACHINES for the -names of operating systems that Emacs has been ported to." 1>&2 +names of operating systems that Emacs has been ported to." >&2 exit 1 fi @@ -238,7 +242,7 @@ (This information comes from the file \`etc/MACHINES' - see that file for more detail.) -" 1>&2 +" >&2 sed < src/${machfile} -e '1,/NOTE-START/d' -e '/NOTE-END/,$d' | more echo exit 1 @@ -250,7 +254,7 @@ operating system for the machine \`${machine}' is \`${opsystem}', but there is no configuration file for \`${opsystem}', so Emacs's default info is screwed up. Try specifying the operating system -explicitly by passing ${progname} an \`-opsystem=SYSTEM-NAME' flag." 1>&2 +explicitly by passing ${progname} an \`-opsystem=SYSTEM-NAME' flag." >&2 exit 1 fi else @@ -258,7 +262,7 @@ if [ ! -r src/${opsysfile} ]; then echo "${progname}: Emacs has no configuration info for the operating system \`${opsystem}'. Look at etc/MACHINES for the names of operating -systems that Emacs has been ported to." 1>&2 +systems that Emacs has been ported to." >&2 exit 1 fi fi @@ -312,7 +316,9 @@ fi echo "Checking window system." -window_system="`echo ${window_system} | tr A-Z a-z`" +# Note that SYSV `tr' doesn't handle character ranges. +window_system="`echo ${window_system} \ + | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" case "${window_system}" in "none" | "x11" | "x10" ) ;; "x" ) window_system=x11 ;; @@ -324,7 +330,7 @@ fi ;; * ) - echo "The \`-window_system' option must be set to \`none' or \`X11'." 1>&2 + echo "The \`-window_system' option must be set to \`none' or \`X11'." >&2 exit 1 ;; esac @@ -463,6 +469,7 @@ sed_flags="-e 's:@machine@:${machfile}:'" sed_flags="${sed_flags} -e 's:@opsystem@:${opsysfile}:'" for flag in `echo ${config_h_opts} | tr ':' ' '`; do + # Note that SYSV `tr' doesn't handle character ranges. cflagname=`echo ${flag} \ | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` val=`eval echo '$'${flag}` @@ -562,28 +569,28 @@ else desc_highpri="none" fi -message="# Configured for machine \`${machine}' running \`${opsystem}'. -# The following values have been set in ./Makefile and ./build-install: -# Executables will be placed in -# ${bindir}. -# Emacs's lisp search path will be -# \`${lisppath}'. -# Emacs will look for its architecture-independent data in -# ${datadir}. -# Emacs will look for its utility programs and other architecture- -# dependent data in -# ${libdir}. -# Emacs will keep track of file-locking in -# ${lockdir}. -# The following values have been set in src/config.h: -# At how much higher than normal priority should Emacs run? ${desc_highpri} -# Should Emacs use the GNU version of malloc? ${gnu_malloc}${gnu_malloc_reason} -# Should Emacs use the relocating allocator for buffers? ${rel_alloc} -# Should Emacs support a floating point Elisp type? ${lisp_float_type} -# What window system should Emacs use? ${window_system} -# Should Emacs support mouse menus, which require X11? ${have_x_menu} -# What compiler should emacs be built with? ${cc} -# Should the compilation use \`-g' and/or \`-O'? ${c_switch_site- neither}" +message="Configured for machine \`${machine}' running \`${opsystem}'. +The following values have been set in ./Makefile and ./build-install: + \`make install' or \`build-install' will placed executables in + ${bindir}. + Emacs's lisp search path will be + \`${lisppath}'. + Emacs will look for its architecture-independent data in + ${datadir}. + Emacs will look for its utility programs and other architecture- + dependent data in + ${libdir}. + Emacs will keep track of file-locking in + ${lockdir}. +The following values have been set in src/config.h: + At how much higher than normal priority should Emacs run? ${desc_highpri} + Should Emacs use the GNU version of malloc? ${gnu_malloc}${gnu_malloc_reason} + Should Emacs use the relocating allocator for buffers? ${rel_alloc} + Should Emacs support a floating point Elisp type? ${lisp_float_type} + What window system should Emacs use? ${window_system} + Should Emacs support mouse menus, which require X11? ${have_x_menu} + What compiler should emacs be built with? ${cc} + Should the compilation use \`-g' and/or \`-O'? ${c_switch_site- neither}" # Document the damage we have done by writing config.status. @@ -593,7 +600,7 @@ # If you are thinking about editing it, you should seriously consider # running \`${progname}' instead. " >> config.status -echo "${message}" >> config.status +echo "${message}" | sed -e 's/^/# /' >> config.status echo "'./${progname}' ${arguments} "'$@' >> config.status # Remind people not to edit this. chmod -w config.status @@ -601,6 +608,6 @@ # Print the description. echo -echo "${message}" | sed -e 's/^# //' +echo "${message}" exit 0
--- a/lisp/=diary-lib.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/=diary-lib.el Tue Jun 30 13:54:21 1992 +0000 @@ -1,6 +1,5 @@ ;;; diary.el --- diary functions. - -;; Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc. +;; Copyright (C) 1989, 1990 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -29,6 +28,8 @@ ;; Urbana, Illinois 61801 (require 'calendar) + +;;;###autoload (defun diary (&optional arg) "Generate the diary window for ARG days starting with the current date. If no argument is provided, the number of days of diary entries is governed @@ -1254,8 +1255,8 @@ (defun diary-ordinal-suffix (n) "Ordinal suffix for N. (That is, `st', `nd', `rd', or `th', as appropriate.)" - (if (or (and (< 9 n) (< n 20)) - (memq (% n 10) '(4 5 6 7 8 9 0))) + (if (or (memq (% n 100) '(11 12 13)) + (< 3 (% n 10))) "th" (aref ["th" "st" "nd" "rd"] (% n 10)))) @@ -1374,8 +1375,8 @@ (t "th")))))) (defun diary-rosh-hodesh () - "Rosh Hodesh diary entry--entry applies if date is Rosh Hodesh or the -Saturday before." + "Rosh Hodesh diary entry--entry applies if date is Rosh Hodesh, the day +before, or the Saturday before." (let* ((d (calendar-absolute-from-gregorian date)) (h-date (calendar-hebrew-from-absolute d)) (h-month (extract-calendar-month h-date)) @@ -1415,9 +1416,18 @@ ((and (< h-day 30) (> h-day 22) (= 30 last-day)) (format "Mevarhim Rosh Hodesh %s (%s-%s)" (aref h-month-names h-month) - (aref calendar-day-name-array (- 29 h-day)) + (if (= h-day 29) + "tomorrow" + (aref calendar-day-name-array (- 29 h-day))) (aref calendar-day-name-array - (mod (- 30 h-day) 7))))))))) + (mod (- 30 h-day) 7))))) + (if (and (= h-day 29) (/= h-month 6)) + (format "Erev Rosh Hodesh %s" + (aref h-month-names + (if (= h-month + (hebrew-calendar-last-month-of-year + h-year)) + 0 h-month)))))))) (defun diary-parasha () "Parasha diary entry--entry applies if date is a Saturday." @@ -1606,39 +1616,6 @@ (aref hebrew-calendar-parashiot-names (aref p 1))) (aref hebrew-calendar-parashiot-names p))) -(defun hebrew-calendar-yahrzeit (death-date year) - "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR." - (let* ((death-day (extract-calendar-day death-date)) - (death-month (extract-calendar-month death-date)) - (death-year (extract-calendar-year death-date))) - (cond - ;; If it's Heshvan 30 it depends on the first anniversary; if - ;; that was not Heshvan 30, use the day before Kislev 1. - ((and (= death-month 8) - (= death-day 30) - (not (hebrew-calendar-long-heshvan-p (1+ death-year)))) - (1- (calendar-absolute-from-hebrew (list 9 1 year)))) - ;; If it's Kislev 30 it depends on the first anniversary; if - ;; that was not Kislev 30, use the day before Teveth 1. - ((and (= death-month 9) - (= death-day 30) - (hebrew-calendar-short-kislev-p (1+ death-year))) - (1- (calendar-absolute-from-hebrew (list 10 1 year)))) - ;; If it's Adar II, use the same day in last month of - ;; year (Adar or Adar II). - ((= death-month 13) - (calendar-absolute-from-hebrew - (list (last-month-of-hebrew-year year) death-day year))) - ;; If it's the 30th in Adar I and $year$ is not a leap year - ;; (so Adar has only 29 days), use the last day in Shevat. - ((and (= death-day 30) - (= death-month 12) - (not (hebrew-calendar-leap-year-p death-year))) - (calendar-absolute-from-hebrew (list 11 30 year))) - ;; In all other cases, use the normal anniversary of the date of death. - (t (calendar-absolute-from-hebrew - (list death-month death-day year)))))) - (defun list-islamic-diary-entries () "Add any Islamic date entries from the diary-file to diary-entries-list. Islamic date diary entries must be prefaced by an islamic-diary-entry-symbol
--- a/lisp/=isearch-old.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/=isearch-old.el Tue Jun 30 13:54:21 1992 +0000 @@ -18,59 +18,45 @@ ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;;###autoload (defvar search-last-string "" "\ Last string search for by a non-regexp search command. This does not include direct calls to the primitive search functions, and does not include searches that are aborted.") -;;;###autoload (defvar search-last-regexp "" "\ Last string searched for by a regexp search command. This does not include direct calls to the primitive search functions, and does not include searches that are aborted.") -;;;###autoload (defconst search-repeat-char ?\C-s "\ *Character to repeat incremental search forwards.") -;;;###autoload (defconst search-reverse-char ?\C-r "\ *Character to repeat incremental search backwards.") -;;;###autoload (defconst search-exit-char ?\C-m "\ *Character to exit incremental search.") -;;;###autoload (defconst search-delete-char ?\177 "\ *Character to delete from incremental search string.") -;;;###autoload (defconst search-quote-char ?\C-q "\ *Character to quote special characters for incremental search.") -;;;###autoload (defconst search-yank-word-char ?\C-w "\ *Character to pull next word from buffer into search string.") -;;;###autoload (defconst search-yank-line-char ?\C-y "\ *Character to pull rest of line from buffer into search string.") -;;;###autoload (defconst search-ring-advance-char ?\M-n "\ *Character to pull next (more recent) search string from the ring of same.") -;;;###autoload (defconst search-ring-retreat-char ?\M-p "\ *Character to pull previous (older) search string from the ring of same.") -;;;###autoload (defconst search-exit-option t "\ *Non-nil means random control characters terminate incremental search.") -;;;###autoload (defvar search-slow-window-lines 1 "\ *Number of lines in slow search display windows. These are the short windows used during incremental search on slow terminals. Negative means put the slow search window at the top (normally it's at bottom) and the value is minus the number of lines.") -;;;###autoload (defvar search-slow-speed 1200 "\ *Highest terminal speed at which to use \"slow\" style incremental search. This is the style where a one-line window is created to show the line @@ -104,7 +90,6 @@ thing searched for.") -;;;###autoload (defun isearch-forward () "Do incremental search forward. As you type characters, they add to the search string and are found. @@ -123,36 +108,29 @@ C-g when search is successful aborts and moves point to starting point." (interactive) (isearch t)) -;;;###autoload (define-key global-map "\C-s" 'isearch-forward) -;;;###autoload (defun isearch-forward-regexp () "Do incremental search forward for regular expression. Like ordinary incremental search except that your input is treated as a regexp. See \\[isearch-forward] for more info." (interactive) (isearch t t)) -;;;###autoload (define-key esc-map "\C-s" 'isearch-forward-regexp) -;;;###autoload (defun isearch-backward () "Do incremental search backward. See \\[isearch-forward] for more information." (interactive) (isearch nil)) -;;;###autoload (define-key global-map "\C-r" 'isearch-backward) -;;;###autoload (defun isearch-backward-regexp () "Do incremental search backward for regular expression. Like ordinary incremental search except that your input is treated as a regexp. See \\[isearch-forward] for more info." (interactive) (isearch nil t)) -;;;###autoload (define-key esc-map "\C-r" 'isearch-backward-regexp)
--- a/lisp/abbrev.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/abbrev.el Tue Jun 30 13:54:21 1992 +0000 @@ -19,7 +19,6 @@ ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;;###autoload (defconst only-global-abbrevs nil "\ *t means user plans to use global abbrevs only. Makes the commands to define mode-specific abbrevs define global ones instead.")
--- a/lisp/calendar/calendar.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/calendar/calendar.el Tue Jun 30 13:54:21 1992 +0000 @@ -1,6 +1,5 @@ ;;; calendar.el --- Calendar functions. - -;; Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc. +;;; Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -67,7 +66,7 @@ ;; Software--Practice and Experience, Volume 20, Number 9 (September, 1990), ;; pages 899-928. -(defconst calendar-version "Version 4.01, released August 20, 1991") +(defconst calendar-version "Version 4.02, released June 14, 1992") (defvar view-diary-entries-initially nil "*If T, the diary entries for the current date will be displayed on entry. @@ -102,6 +101,7 @@ on entry. The holidays are displayed in another window when the calendar is first displayed.") +;;;###autoload (defvar mark-holidays-in-calendar nil "*If t, dates of holidays will be marked in the calendar window. The marking symbol is specified by the variable `calendar-holiday-marker'.") @@ -109,18 +109,21 @@ (defvar calendar-holiday-marker "*" "*The symbol used to mark notable dates in the calendar.") +;;;###autoload (defvar all-hebrew-calendar-holidays nil "*If nil, the holidays from the Hebrew calendar that are shown will include only those days of such major interest as to appear on secular calendars. If t, the holidays shown in the calendar will include all special days that would be shown on a complete Hebrew calendar.") +;;;###autoload (defvar all-christian-calendar-holidays nil "*If nil, the holidays from the Christian calendar that are shown will include only those days of such major interest as to appear on secular calendars. If t, the holidays shown in the calendar will include all special days that would be shown on a complete Christian calendar.") +;;;###autoload (defvar all-islamic-calendar-holidays nil "*If nil, the holidays from the Islamic calendar that are shown will include only those days of such major interest as to appear on secular @@ -401,6 +404,7 @@ saving the buffer instead of deleting it, or changing the function used to do the printing.") +;;;###autoload (defvar list-diary-entries-hook nil "*List of functions to be called after the diary file is culled for relevant entries. It is to be used for diary entries that are not found in @@ -432,6 +436,7 @@ diary entries from various included files, each day's entries sorted into lexicographic order.") +;;;###autoload (defvar diary-display-hook 'simple-diary-display "*List of functions that handle the display of the diary. @@ -453,6 +458,7 @@ if that day is a holiday; if you want such days to be shown in the fancy diary buffer, set the variable `diary-list-include-blanks' to t.") +;;;###autoload (defvar nongregorian-diary-listing-hook nil "*List of functions to be called for the diary file and included files as they are processed for listing diary entries. You can use any or all of @@ -474,12 +480,14 @@ part of the mark-diary-entries-hook, you will probably also want to use the function `include-other-diary-files' as part of the list-diary-entries-hook.") +;;;###autoload (defvar nongregorian-diary-marking-hook nil "*List of functions to be called as the diary file and included files are processed for marking diary entries. You can use either or both of mark-hebrew-diary-entries and mark-islamic-diary-entries. The documentation for these functions describes the style of such diary entries.") +;;;###autoload (defvar diary-list-include-blanks nil "*If nil, do not include days with no diary entry in the list of diary entries. Such days will then not be shown in the the fancy diary buffer, @@ -693,7 +701,6 @@ `calendar-holiday-function-islamic', `calendar-holiday-function-julian', and `calendar-holiday-function-if', respectively.") - (defconst calendar-buffer "*Calendar*" "Name of the buffer used for the calendar.") @@ -726,6 +733,37 @@ (setq (, index) (1+ (, index)))) sum))) +;; The following macros are for speed; the code would be clearer if they +;; were functions, but they can be called thousands of times when +;; looking up holidays or processing the diary. Here, for example, are the +;; numbers of calls to calendar/diary/holiday functions in preparing the +;; fancy diary display, for a moderately complex diary file, with functions +;; used instead of macros. There were a total of 10000 such calls: +;; +;; 1934 extract-calendar-month +;; 1852 extract-calendar-year +;; 1819 extract-calendar-day +;; 845 calendar-leap-year-p +;; 837 calendar-day-number +;; 775 calendar-absolute-from-gregorian +;; 346 calendar-last-day-of-month +;; 286 hebrew-calendar-last-day-of-month +;; 188 hebrew-calendar-leap-year-p +;; 180 hebrew-calendar-elapsed-days +;; 163 hebrew-calendar-last-month-of-year +;; 66 calendar-date-compare +;; 65 hebrew-calendar-days-in-year +;; 60 calendar-absolute-from-julian +;; 50 calendar-absolute-from-hebrew +;; 43 calendar-date-equal +;; 38 calendar-gregorian-from-absolute +;; . +;; . +;; . +;; +;; The use of these seven macros eliminates the overhead of 92% of the function +;; calls; it's faster this way. + (defmacro extract-calendar-month (date) "Extract the month part of DATE which has the form (month day year)." (` (car (, date)))) @@ -738,6 +776,52 @@ "Extract the year part of DATE which has the form (month day year)." (` (car (cdr (cdr (, date)))))) +(defmacro calendar-leap-year-p (year) + "Returns t if YEAR is a Gregorian leap year." + (` (or + (and (= (% (, year) 4) 0) + (/= (% (, year) 100) 0)) + (= (% (, year) 400) 0)))) + +(defmacro calendar-last-day-of-month (month year) + "The last day in MONTH during YEAR." + (` (if (and + (, (macroexpand (` (calendar-leap-year-p (, year))))) + (= (, month) 2)) + 29 + (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- (, month)))))) + +(defmacro calendar-day-number (date) + "Return the day number within the year of the date DATE. +For example, (calendar-day-number '(1 1 1987)) returns the value 1, +while (calendar-day-number '(12 31 1980)) returns 366." +;; +;; An explanation of the calculation can be found in PascAlgorithms by +;; Edward and Ruth Reingold, Scott-Foresman/Little, Brown, 1988. +;; + (` (let* ((month (, (macroexpand (` (extract-calendar-month (, date)))))) + (day (, (macroexpand (` (extract-calendar-day (, date)))))) + (year (, (macroexpand (` (extract-calendar-year (, date)))))) + (day-of-year (+ day (* 31 (1- month))))) + (if (> month 2) + (progn + (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) + (if (, (macroexpand (` (calendar-leap-year-p year)))) + (setq day-of-year (1+ day-of-year))))) + day-of-year))) + +(defmacro calendar-absolute-from-gregorian (date) + "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. +The Gregorian date Sunday, December 31, 1 BC is imaginary." + (` (let ((month (, (macroexpand (` (extract-calendar-month (, date)))))) + (day (, (macroexpand (` (extract-calendar-day (, date)))))) + (year (, (macroexpand (` (extract-calendar-year (, date))))))) + (+ (, (macroexpand (` (calendar-day-number (, date)))));; Days this year + (* 365 (1- year));; + Days in prior years + (/ (1- year) 4);; + Julian leap years + (- (/ (1- year) 100));; - century years + (/ (1- year) 400)))));; + Gregorian leap years + ;;;###autoload (defun calendar (&optional arg) "Display a three-month calendar in another window. @@ -944,10 +1028,11 @@ characters on the line." (let* ((first-day-of-month (calendar-day-of-week (list month 1 year))) (first-saturday (- 7 first-day-of-month)) - (last (calendar-last-day-of-month month year))) + (last (calendar-last-day-of-month month year)) + (heading (format "%s %d" (calendar-month-name month) year))) (goto-char (point-min)) (calendar-insert-indented - (format " %s %d" (calendar-month-name month) year) indent t) + heading (+ indent (/ (- 20 (length heading)) 2)) t) (calendar-insert-indented " S M Tu W Th F S" indent t) (calendar-insert-indented "" indent);; Move to appropriate spot on line ;; Add blank days before the first of the month @@ -1902,32 +1987,6 @@ (+ (* 12 (- yr2 yr1)) (- mon2 mon1))) -(defun calendar-leap-year-p (year) - "Returns t if YEAR is a Gregorian leap year." - (or - (and (= (% year 4) 0) - (/= (% year 100) 0)) - (= (% year 400) 0))) - -(defun calendar-day-number (date) - "Return the day number within the year of the date DATE. -For example, (calendar-day-number '(1 1 1987)) returns the value 1, -while (calendar-day-number '(12 31 1980)) returns 366." -;; -;; An explanation of the calculation can be found in PascAlgorithms by -;; Edward and Ruth Reingold, Scott-Foresman/Little, Brown, 1988. -;; - (let* ((month (extract-calendar-month date)) - (day (extract-calendar-day date)) - (year (extract-calendar-year date)) - (day-of-year (+ day (* 31 (1- month))))) - (if (> month 2) - (progn - (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) - (if (calendar-leap-year-p year) - (setq day-of-year (1+ day-of-year))))) - day-of-year)) - (defun calendar-day-name (date) "Returns a string with the name of the day of the week of DATE." (aref calendar-day-name-array (calendar-day-of-week date))) @@ -1935,12 +1994,6 @@ (defconst calendar-day-name-array ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"]) -(defun calendar-last-day-of-month (month year) - "The last day in MONTH during YEAR." - (if (and (calendar-leap-year-p year) (= month 2)) - 29 - (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) - (defconst calendar-month-name-array ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"]) @@ -1965,18 +2018,6 @@ "Returns the day-of-the-week index of DATE, 0 for Sunday, 1 for Monday, etc." (% (calendar-absolute-from-gregorian date) 7)) -(defun calendar-absolute-from-gregorian (date) - "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. -The Gregorian date Sunday, December 31, 1 BC is imaginary." - (let ((month (extract-calendar-month date)) - (day (extract-calendar-day date)) - (year (extract-calendar-year date))) - (+ (calendar-day-number date);; Days this year - (* 365 (1- year));; + Days in prior years - (/ (1- year) 4);; + Julian leap years - (- (/ (1- year) 100));; - century years - (/ (1- year) 400))));; + Gregorian leap years - (defun calendar-unmark () "Delete the diary and holiday marks from the calendar." (interactive) @@ -2459,6 +2500,94 @@ calendar-hebrew-month-name-array-common-year))) (message "Hebrew date: %s" (calendar-date-string hebrew-date nil t)))) +(defun hebrew-calendar-yahrzeit (death-date year) + "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR." + (let* ((death-day (extract-calendar-day death-date)) + (death-month (extract-calendar-month death-date)) + (death-year (extract-calendar-year death-date))) + (cond + ;; If it's Heshvan 30 it depends on the first anniversary; if + ;; that was not Heshvan 30, use the day before Kislev 1. + ((and (= death-month 8) + (= death-day 30) + (not (hebrew-calendar-long-heshvan-p (1+ death-year)))) + (1- (calendar-absolute-from-hebrew (list 9 1 year)))) + ;; If it's Kislev 30 it depends on the first anniversary; if + ;; that was not Kislev 30, use the day before Teveth 1. + ((and (= death-month 9) + (= death-day 30) + (hebrew-calendar-short-kislev-p (1+ death-year))) + (1- (calendar-absolute-from-hebrew (list 10 1 year)))) + ;; If it's Adar II, use the same day in last month of + ;; year (Adar or Adar II). + ((= death-month 13) + (calendar-absolute-from-hebrew + (list (last-month-of-hebrew-year year) death-day year))) + ;; If it's the 30th in Adar I and $year$ is not a leap year + ;; (so Adar has only 29 days), use the last day in Shevat. + ((and (= death-day 30) + (= death-month 12) + (not (hebrew-calendar-leap-year-p death-year))) + (calendar-absolute-from-hebrew (list 11 30 year))) + ;; In all other cases, use the normal anniversary of the date of death. + (t (calendar-absolute-from-hebrew + (list death-month death-day year)))))) + +(defun list-yahrzeit-dates (death-date start-year end-year) + "List of Yahrzeit dates for *Gregorian* DEATH-DATE +from START-YEAR to END-YEAR. When called interactively +the date of death is taken from the cursor in the calendar window." + (interactive + (let* ((death-date (calendar-cursor-to-date)) + (death-year (extract-calendar-year death-date)) + (start-year (calendar-read + (format "Starting year of Yahrzeit table (>%d): " + death-year) + '(lambda (x) (> x death-year)) + (int-to-string (1+ death-year)))) + (end-year (calendar-read + (format "Ending year of Yahrzeit table (>=%d): " + start-year) + '(lambda (x) (>= x start-year))))) + (list death-date start-year end-year))) + (message "Computing yahrzeits...") + (let* ((yahrzeit-buffer "*Yahrzeits*") + (h-date (calendar-hebrew-from-absolute + (calendar-absolute-from-gregorian death-date))) + (h-month (extract-calendar-month h-date)) + (h-day (extract-calendar-day h-date)) + (h-year (extract-calendar-year h-date))) + (set-buffer (get-buffer-create yahrzeit-buffer)) + (setq buffer-read-only nil) + (setq mode-line-format + (format "------Yahrzeit dates for %s = %s%%-" + (calendar-date-string death-date) + (let ((calendar-month-name-array + (if (hebrew-calendar-leap-year-p h-year) + calendar-hebrew-month-name-array-leap-year + calendar-hebrew-month-name-array-common-year)) + (calendar-date-display-form + (if european-calendar-style + '(day " " monthname " " year) + '(monthname " " day ", " year)))) + (calendar-date-string h-date nil t)))) + (erase-buffer) + (goto-char (point-min)) + (calendar-for-loop i from start-year to end-year do + (insert + (calendar-date-string + (calendar-gregorian-from-absolute + (hebrew-calendar-yahrzeit + h-date + (extract-calendar-year + (calendar-hebrew-from-absolute + (calendar-absolute-from-gregorian (list 1 1 i))))))) "\n")) + (goto-char (point-min)) + (set-buffer-modified-p nil) + (setq buffer-read-only t) + (display-buffer yahrzeit-buffer) + (message "Computing yahrzeits...done"))) + (defun french-calendar-leap-year-p (year) "True if YEAR is a leap year on the French Revolutionary calendar. For Gregorian years 1793 to 1805, the years of actual operation of the
--- a/lisp/calendar/holidays.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/calendar/holidays.el Tue Jun 30 13:54:21 1992 +0000 @@ -1,6 +1,5 @@ ;;; holidays.el --- holiday functions for the calendar package - -;; Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc. +;;; Copyright (C) 1989, 1990 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -34,6 +33,8 @@ ;; pages 899-928. (require 'calendar) + +;;;###autoload (defun holidays () "Display the holidays for last month, this month, and next month. This function is suitable for execution in a .emacs file." @@ -62,7 +63,8 @@ "Find holidays for the date specified by the cursor in the calendar window." (interactive) (message "Checking holidays...") - (let* ((date (calendar-cursor-to-date)) + (let* ((date (or (calendar-cursor-to-date) + (error "Cursor is not on a date!"))) (date-string (calendar-date-string date)) (holiday-list (check-calendar-holidays date)) (holiday-string (mapconcat 'identity holiday-list "; "))
--- a/lisp/completion.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/completion.el Tue Jun 30 13:54:21 1992 +0000 @@ -2834,8 +2834,8 @@ (use-completion-before-separator) (self-insert-command arg) (and (> (current-column) fill-column) - auto-fill-hook - (funcall auto-fill-hook)) + auto-fill-function + (funcall auto-fill-function)) ) ;;;-----------------------------------------------
--- a/lisp/emacs-lisp/autoload.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/emacs-lisp/autoload.el Tue Jun 30 13:54:21 1992 +0000 @@ -107,7 +107,7 @@ ;; under a different path on another system, ;; `update-autoloads-here' won't be able to find the files to be ;; autoloaded. So, if FILE is in the same directory or a - ;; subdirectory of the current buffer's file, we'll make it + ;; subdirectory of the current buffer's directory, we'll make it ;; relative to the current buffer's directory. (setq file (expand-file-name file)) (if (and (< (length default-directory) (length file))
--- a/lisp/help.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/help.el Tue Jun 30 13:54:21 1992 +0000 @@ -18,7 +18,6 @@ ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;;###autoload (defvar help-map (make-sparse-keymap) "Keymap for characters following the Help key.") @@ -42,6 +41,8 @@ (define-key help-map "f" 'describe-function) (define-key help-map "i" 'info) +(define-key help-map "\C-f" 'Info-goto-emacs-command-node) +(define-key help-map "\C-k" 'Info-goto-emacs-key-command-node) (define-key help-map "l" 'view-lossage)
--- a/lisp/indent.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/indent.el Tue Jun 30 13:54:21 1992 +0000 @@ -19,7 +19,6 @@ ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;;###autoload (defvar indent-line-function 'indent-to-left-margin "\ Function to indent current line.");Now in loaddefs.el
--- a/lisp/info.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/info.el Tue Jun 30 13:54:21 1992 +0000 @@ -978,8 +978,6 @@ (if (> num-matches 2) "ies" "y") (if (> num-matches 2) "them" "it")))))) (error "Couldn't find documentation for %s." command)))) -;;;###autoload -(define-key help-map "\C-f" 'Info-goto-emacs-command-node) ;;;###autoload (defun Info-goto-emacs-key-command-node (key) @@ -995,8 +993,6 @@ (read-command "Find documentation for command: "))) (t (Info-goto-emacs-command-node command))))) -;;;###autoload -(define-key help-map "\C-k" 'Info-goto-emacs-key-command-node) (provide 'info)
--- a/lisp/progmodes/compile.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/progmodes/compile.el Tue Jun 30 13:54:21 1992 +0000 @@ -272,6 +272,7 @@ (set-buffer outbuf) (compilation-mode) (buffer-disable-undo (current-buffer)) + (setq buffer-read-only t) (set (make-local-variable 'compilation-parse-errors-function) parser) (set (make-local-variable 'compilation-error-message) error-message) (set (make-local-variable 'compilation-error-regexp-alist) regexp-alist) @@ -343,6 +344,7 @@ ;; Write something in the compilation buffer ;; and hack its mode line. (set-buffer buffer) + (setq buffer-read-only nil) (setq omax (point-max) opoint (point)) (goto-char omax) @@ -360,7 +362,8 @@ ;; will stay around until M-x list-processes. (delete-process proc)) ;; Force mode line redisplay soon. - (set-buffer-modified-p (buffer-modified-p))) + (set-buffer-modified-p (buffer-modified-p)) + (setq buffer-read-only t)) (if (and opoint (< opoint omax)) (goto-char opoint)) (set-buffer obuf)
--- a/lisp/replace.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/replace.el Tue Jun 30 13:54:21 1992 +0000 @@ -1,12 +1,12 @@ ;;; replace.el --- replace commands for Emacs. -;; Copyright (C) 1985-1991 Free Software Foundation, Inc. +;; Copyright (C) 1985, 86, 87, 88, 89, 90, 91, 92 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 1, or (at your option) +;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -19,11 +19,9 @@ ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;;###autoload (defconst case-replace t "\ *Non-nil means query-replace should preserve case in replacements.") -;;;###autoload (defun query-replace (from-string to-string &optional arg) "Replace some occurrences of FROM-STRING with TO-STRING. As each match is found, the user must type a character saying @@ -36,10 +34,8 @@ (interactive "sQuery replace: \nsQuery replace %s with: \nP") (perform-replace from-string to-string t nil arg) (message "Done")) -;;;###autoload (define-key esc-map "%" 'query-replace) -;;;###autoload (defun query-replace-regexp (regexp to-string &optional arg) "Replace some things after point matching REGEXP with TO-STRING. As each match is found, the user must type a character saying @@ -55,7 +51,6 @@ (perform-replace regexp to-string t t arg) (message "Done")) -;;;###autoload (defun map-query-replace-regexp (regexp to-strings &optional arg) "Replace some matches for REGEXP with various strings, in rotation. The second argument TO-STRINGS contains the replacement strings, separated @@ -84,7 +79,6 @@ (perform-replace regexp replacements t t nil arg)) (message "Done")) -;;;###autoload (defun replace-string (from-string to-string &optional delimited) "Replace occurrences of FROM-STRING with TO-STRING. Preserve case in each match if `case-replace' and `case-fold-search' @@ -101,7 +95,6 @@ (perform-replace from-string to-string nil nil delimited) (message "Done")) -;;;###autoload (defun replace-regexp (regexp to-string &optional delimited) "Replace things after point matching REGEXP with TO-STRING. Preserve case in each match if case-replace and case-fold-search @@ -348,7 +341,6 @@ ^ to move point back to previous match." "Help message while in query-replace") -;;;###autoload (defun perform-replace (from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count) @@ -364,6 +356,7 @@ (literal (not regexp-flag)) (search-function (if regexp-flag 're-search-forward 'search-forward)) (search-string from-string) + (real-match-data nil) ; the match data for the current match (next-replacement nil) (replacement-index 0) (keep-going t) @@ -400,6 +393,10 @@ (forward-char 1) (funcall search-function search-string nil t)) t)) + + ;; Save the data associated with the real match. + (setq real-match-data (match-data)) + ;; Before we make the replacement, decide whether the search string ;; can match again just after this match. (if regexp-flag @@ -414,15 +411,13 @@ (setq replacement-index (% (1+ replacement-index) (length replacements))))) (if (not query-flag) (progn + (store-match-data real-match-data) (replace-match next-replacement nocasify literal) (setq replace-count (1+ replace-count))) (undo-boundary) (let (done replaced) (while (not done) - ;; Preserve the match data. Process filters and sentinels - ;; could run inside read-char.. - (let ((data (match-data)) - (help-form + (let ((help-form '(concat "Query replacing " (if regexp-flag "regexp " "") from-string " with " next-replacement ".\n\n" @@ -432,8 +427,9 @@ (message "Query replacing %s with %s: " from-string next-replacement) (setq char (read-event)) (if (and (numberp char) (= char ??)) - (setq unread-command-char help-char char help-char))) - (store-match-data data)) + (setq unread-command-char help-char char help-char)))) + ;; Restore the match data while we process the command. + (store-match-data real-match-data) (cond ((or (= char ?\e) (= char ?q)) (setq keep-going nil)
--- a/lisp/textmodes/fill.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/textmodes/fill.el Tue Jun 30 13:54:21 1992 +0000 @@ -321,4 +321,4 @@ (fill-region-as-paragraph start (point) justifyp) (or had-newline (delete-char -1)))))))) -;;; fill.el ends here \ No newline at end of file +;;; fill.el ends here
--- a/lisp/textmodes/paragraphs.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/textmodes/paragraphs.el Tue Jun 30 13:54:21 1992 +0000 @@ -19,25 +19,20 @@ ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;;###autoload (defconst paragraph-start "^[ \t\n\f]" "\ *Regexp for beginning of a line that starts OR separates paragraphs.") -;;;###autoload (defconst paragraph-separate "^[ \t\f]*$" "\ *Regexp for beginning of a line that separates paragraphs. If you change this, you may have to change paragraph-start also.") -;;;###autoload (defconst sentence-end (purecopy "[.?!][]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*") "\ *Regexp describing the end of a sentence. All paragraph boundaries also end sentences, regardless.") -;;;###autoload (defconst page-delimiter "^\014" "\ *Regexp describing line-beginnings that separate pages.") -;;;###autoload (defvar paragraph-ignore-fill-prefix nil "\ Non-nil means the paragraph commands are not affected by `fill-prefix'. This is desirable in modes where blank lines are the paragraph delimiters.")
--- a/lisp/textmodes/texnfo-upd.el Tue Jun 30 13:49:39 1992 +0000 +++ b/lisp/textmodes/texnfo-upd.el Tue Jun 30 13:54:21 1992 +0000 @@ -2,13 +2,13 @@ ;;;; Version 2.00 14 Dec 1990 -;;;; Copyright 1989, 1990 Free Software Foundation +;;;; Copyright 1989, 1990, 1992 Free Software Foundation ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 1, or (at your option) +;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -1031,13 +1031,13 @@ (interactive "P") (if (not region-p) - (let ((auto-fill-hook nil)) ; update a single node + (let ((auto-fill-function nil)) ; update a single node (if (not (re-search-backward "^@node" (point-min) t)) (error "Node line not found before this position.")) (texinfo-update-the-node) (message "Done...updated the node. You may save the buffer.")) ;; else - (let ((auto-fill-hook nil) + (let ((auto-fill-function nil) (beginning (region-beginning)) (end (region-end))) (if (= end beginning) @@ -1245,14 +1245,14 @@ (interactive "P") (if (not region-p) - (let ((auto-fill-hook nil)) ; update a single node + (let ((auto-fill-function nil)) ; update a single node (if (not (re-search-backward "^@node" (point-min) t)) (error "Node line not found before this position.")) (texinfo-sequentially-update-the-node) (message "Done...sequentially updated the node . You may save the buffer.")) ;; else - (let ((auto-fill-hook nil) + (let ((auto-fill-function nil) (beginning (region-beginning)) (end (region-end))) (if (= end beginning)
--- a/src/.gdbinit Tue Jun 30 13:49:39 1992 +0000 +++ b/src/.gdbinit Tue Jun 30 13:54:21 1992 +0000 @@ -119,6 +119,12 @@ set print pretty on +unset environment TERMCAP +unset environment TERM +set environment DISPLAY :0.0 +show environment DISPLAY +set args -q + # Don't let abort actually run, as it will make # stdio stop working and therefore the `pr' command below as well. break abort @@ -128,8 +134,3 @@ # instead... break _XPrintDefaultError -unset environment TERMCAP -unset environment TERM -set environment DISPLAY :0.0 -show environment DISPLAY -set args -q
--- a/src/=Makefile.in Tue Jun 30 13:49:39 1992 +0000 +++ b/src/=Makefile.in Tue Jun 30 13:54:21 1992 +0000 @@ -2,7 +2,7 @@ # BSD doesn't have it as a default. CC =gcc -CPP = $(CC) -E +CPP = $(CC) -E -Is -Im #Note: an alternative is CPP = /lib/cpp # Just to avoid uncertainty. @@ -19,7 +19,7 @@ -rm -f paths.h config.h machine.h system.h emacs-* temacs xemacs xmakefile core *~ \#* *.o clean: - -rm -f temacs xemacs xmakefile core \#* *.o + -rm -f temacs xemacs xmakefile* core \#* *.o xemacs: xmakefile doxemacs @@ -34,10 +34,16 @@ # If you have a problem with cc -E here, changing # the definition of CPP above may fix it. xmakefile: ymakefile config.h - -rm -f xmakefile junk.c + -rm -f xmakefile xmakefile.new junk.c junk.cpp cp ymakefile junk.c - $(CPP) junk.c | sed -e 's/^#.*//' -e 's/^[ \f\t][ \f\t]*$$//' -e 's/^ / /' | \ - sed -n -e '/^..*$$/p' > xmakefile + $(CPP) junk.c > junk.cpp + < junk.cpp \ + sed -e 's/^#.*//' \ + -e 's/^[ \f\t][ \f\t]*$$//' \ + -e 's/^ / /' \ + | sed -n -e '/^..*$$/p' \ + > xmakefile.new + mv -f xmakefile.new xmakefile rm -f junk.c tags TAGS:
--- a/src/=xselect.c.old Tue Jun 30 13:49:39 1992 +0000 +++ b/src/=xselect.c.old Tue Jun 30 13:54:21 1992 +0000 @@ -193,7 +193,7 @@ { BLOCK_INPUT; XStoreBytes (x_current_display, - XSTRING (string)->data, + (char *) XSTRING (string)->data, XSTRING (string)->size); UNBLOCK_INPUT; }
--- a/src/callint.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/callint.c Tue Jun 30 13:54:21 1992 +0000 @@ -174,7 +174,7 @@ int arg_from_tty = 0; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - /* Save this now, since use ofminibuffer will clobber it. */ + /* Save this now, since use of minibuffer will clobber it. */ prefix_arg = Vcurrent_prefix_arg; retry: @@ -233,7 +233,7 @@ { /* Make a copy of string so that if a GC relocates specs, `string' will still be valid. */ - string = (char *) alloca (XSTRING (specs)->size + 1); + string = (unsigned char *) alloca (XSTRING (specs)->size + 1); bcopy (XSTRING (specs)->data, string, XSTRING (specs)->size + 1); } else if (string == 0) @@ -388,6 +388,7 @@ (XTYPE (function) == Lisp_Symbol ? (char *) XSYMBOL (function)->name->data : "Command")); + varies[i] = -1; break; case 'm': /* Value of mark. Does not do I/O. */
--- a/src/dispextern.h Tue Jun 30 13:49:39 1992 +0000 +++ b/src/dispextern.h Tue Jun 30 13:54:21 1992 +0000 @@ -1,11 +1,11 @@ /* Interface definitions for display code. - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -93,10 +93,3 @@ * SCREEN_CURRENT_GLYPHS(s)->enable[(n)]) extern void get_display_line (); - -/* Buffer used by `message' for formatting a message. */ -extern char *message_buf; -extern int message_buf_size; - -/* Nonzero means message_buf is being used by print. */ -extern int message_buf_print;
--- a/src/dispnew.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/dispnew.c Tue Jun 30 13:54:21 1992 +0000 @@ -106,25 +106,17 @@ SCREEN_PTR selected_screen; +/* A screen which is not just a minibuffer, or 0 if there are no such + screens. This is usually the most recent such screen that was + selected. In a single-screen version, this variable always remains 0. */ +SCREEN_PTR last_nonminibuf_screen; + /* In a single-screen version, the information that would otherwise - exist inside a `struct screen' lives in the following variables instead. */ + exist inside screen objects lives in the following structure instead. */ #ifndef MULTI_SCREEN - -/* Desired terminal cursor position (to show position of point), - origin zero */ - -int cursX, cursY; - -/* Description of current screen contents */ - -struct screen_glyphs *current_glyphs; - -/* Description of desired screen contents */ - -struct screen_glyphs *desired_glyphs; - -#endif /* not MULTI_SCREEN */ +struct screen the_only_screen; +#endif /* This is a vector, made larger whenever it isn't large enough, which is used inside `update_screen' to hold the old contents @@ -142,8 +134,6 @@ int in_display; /* 1 if in redisplay: can't handle SIGWINCH now. */ int delayed_size_change; /* 1 means SIGWINCH happened when not safe. */ -int delayed_screen_height; /* Remembered new screen height. */ -int delayed_screen_width; /* Remembered new screen width. */ #ifdef MULTI_SCREEN @@ -834,8 +824,8 @@ struct window *w; { register int vpos; - register SCREEN_PTR screen = XSCREEN (w->screen); - register struct screen_glyphs *desired_glyphs = screen->desired_glyphs; + register struct screen_glyphs *desired_glyphs = + SCREEN_DESIRED_GLYPHS (XSCREEN (w->screen)); register int start = XFASTINT (w->left); register int bot = XFASTINT (w->top) + XFASTINT (w->height); @@ -1049,8 +1039,10 @@ #endif /* HAVE_X_WINDOWS */ } +#ifdef HAVE_X_WINDOWS if (SCREEN_IS_X (s)) downto += LINE_HEIGHT(s, i); +#endif } pause = (i < SCREEN_HEIGHT (s) - 1) ? i : 0; @@ -1603,11 +1595,10 @@ { Lisp_Object tail; + SCREEN_PTR s; - for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) + FOR_EACH_SCREEN (tail, s) { - SCREEN_PTR s = XSCREEN (XCONS (tail)->car); - if (SCREEN_IS_TERMCAP (s)) { ++in_display; @@ -1632,12 +1623,12 @@ while (delayed_size_change) { Lisp_Object tail; + SCREEN_PTR s; delayed_size_change = 0; - for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) + FOR_EACH_SCREEN (tail, s) { - SCREEN_PTR s = XSCREEN (XCONS (tail)->car); int height = SCREEN_NEW_HEIGHT (s); int width = SCREEN_NEW_WIDTH (s);
--- a/src/emacs.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/emacs.c Tue Jun 30 13:54:21 1992 +0000 @@ -63,6 +63,9 @@ /* Command line args from shell, as list of strings */ Lisp_Object Vcommand_line_args; +/* Hook run by `kill-emacs' before it does really anything. */ +Lisp_Object Vkill_emacs_hook; + /* Set nonzero after Emacs has started up the first time. Prevents reinitialization of the Lisp world and keymaps on subsequent starts. */ @@ -761,4 +764,9 @@ DEFVAR_BOOL ("noninteractive", &noninteractive1, "Non-nil means Emacs is running without interactive terminal."); + + Vkill_emacs_hook = Qnil; + + DEFVAR_LISP ("kill-emacs-hook", &Vkill_emacs_hook, + "Hook to be run whenever kill-emacs is called."); }
--- a/src/eval.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/eval.c Tue Jun 30 13:54:21 1992 +0000 @@ -1094,7 +1094,9 @@ if (gc_in_progress || waiting_for_input) abort (); +#ifdef HAVE_X_WINDOWS TOTALLY_UNBLOCK_INPUT; +#endif conditions = Fget (sig, Qerror_conditions);
--- a/src/fileio.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/fileio.c Tue Jun 30 13:54:21 1992 +0000 @@ -621,7 +621,7 @@ #ifdef VMS || nm[1] == ':' #endif /* VMS */ - || nm[1] == 0)/* ~/filename */ + || nm[1] == 0)/* ~ by itself */ { if (!(newdir = (unsigned char *) egetenv ("HOME"))) newdir = (unsigned char *) ""; @@ -642,15 +642,18 @@ o [p - nm] = 0; pw = (struct passwd *) getpwnam (o + 1); - if (!pw) - error ("\"%s\" isn't a registered user", o + 1); - + if (pw) + { + newdir = (unsigned char *) pw -> pw_dir; #ifdef VMS - nm = p + 1; /* skip the terminator */ + nm = p + 1; /* skip the terminator */ #else - nm = p; + nm = p; #endif /* VMS */ - newdir = (unsigned char *) pw -> pw_dir; + } + + /* If we don't find a user of that name, leave the name + unchanged; don't move nm forward to p. */ } if (nm[0] != '/' @@ -794,7 +797,8 @@ return make_string (target, o - target); } #if 0 -DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, +/* Changed this DEFUN to a DEAFUN, so as not to confuse `make-docfile'. +DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, "Convert FILENAME to absolute, and canonicalize it.\n\ Second arg DEFAULT is directory to start with if FILENAME is relative\n\ (does not start with slash); if DEFAULT is nil or missing,\n\ @@ -1589,38 +1593,38 @@ unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.\n\ A number as third arg means request confirmation if NEWNAME already exists.\n\ This happens for interactive use with M-x.") - (filename, newname, ok_if_already_exists) - Lisp_Object filename, newname, ok_if_already_exists; + (filename, linkname, ok_if_already_exists) + Lisp_Object filename, linkname, ok_if_already_exists; { #ifdef NO_ARG_ARRAY Lisp_Object args[2]; #endif struct gcpro gcpro1, gcpro2; - GCPRO2 (filename, newname); + GCPRO2 (filename, linkname); CHECK_STRING (filename, 0); - CHECK_STRING (newname, 1); + CHECK_STRING (linkname, 1); #if 0 /* This made it impossible to make a link to a relative name. */ filename = Fexpand_file_name (filename, Qnil); #endif - newname = Fexpand_file_name (newname, Qnil); + linkname = Fexpand_file_name (linkname, Qnil); if (NILP (ok_if_already_exists) || XTYPE (ok_if_already_exists) == Lisp_Int) - barf_or_query_if_file_exists (newname, "make it a link", + barf_or_query_if_file_exists (linkname, "make it a link", XTYPE (ok_if_already_exists) == Lisp_Int); - if (0 > symlink (XSTRING (filename)->data, XSTRING (newname)->data)) + if (0 > symlink (XSTRING (filename)->data, XSTRING (linkname)->data)) { /* If we didn't complain already, silently delete existing file. */ if (errno == EEXIST) { unlink (XSTRING (filename)->data); - if (0 <= symlink (XSTRING (filename)->data, XSTRING (newname)->data)) + if (0 <= symlink (XSTRING (filename)->data, XSTRING (linkname)->data)) return Qnil; } #ifdef NO_ARG_ARRAY args[0] = filename; - args[1] = newname; + args[1] = linkname; report_file_error ("Making symbolic link", Flist (2, args)); #else report_file_error ("Making symbolic link", Flist (2, &filename));
--- a/src/frame.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/frame.c Tue Jun 30 13:54:21 1992 +0000 @@ -20,6 +20,9 @@ #include <stdio.h> #include "config.h" + +#ifdef MULTI_SCREEN + #include "lisp.h" #include "screen.h" #include "window.h" @@ -34,11 +37,6 @@ Lisp_Object Vdefault_screen_alist; Lisp_Object Qminibuffer; -/* A screen which is not just a minibuffer, or 0 if there are no - such screens. This is usually the most recent such screen that - was selected. */ -struct screen *last_nonminibuf_screen; - extern Lisp_Object Vminibuffer_list; extern Lisp_Object get_minibuffer (); @@ -1220,3 +1218,5 @@ defsubr (&Srubber_band_rectangle); #endif /* HAVE_X11 */ } + +#endif
--- a/src/frame.h Tue Jun 30 13:49:39 1992 +0000 +++ b/src/frame.h Tue Jun 30 13:54:21 1992 +0000 @@ -1,11 +1,11 @@ /* Define screen-object for GNU Emacs. - Copyright (C) 1988 Free Software Foundation, Inc. + Copyright (C) 1988, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -18,7 +18,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef MULTI_SCREEN +/* The structure representing a screen. + + We declare this even if MULTI_SCREEN is not defined, because when + we lack multi-screen support, we use one instance of this structure + to represent the one screen we support. This is cleaner than + having miscellaneous random variables scattered about. */ enum output_method { output_termcap, output_x_window }; @@ -34,15 +39,13 @@ /* glyphs we'd like to appear on the screen */ struct screen_glyphs *desired_glyphs; + /* See do_line_insertion_deletion_costs for info on these arrays. */ /* Cost of inserting 1 line on this screen */ int *insert_line_cost; - /* Cost of deleting 1 line on this screen */ int *delete_line_cost; - /* Cost of inserting n lines on this screen */ int *insert_n_lines_cost; - /* Cost of deleting n lines on this screen */ int *delete_n_lines_cost; @@ -148,6 +151,8 @@ int scroll_bottom_vpos; }; +#ifdef MULTI_SCREEN + typedef struct screen *SCREEN_PTR; #define XSCREEN(p) ((struct screen *) XPNTR (p)) @@ -157,7 +162,6 @@ #define SCREENP(s) (XTYPE(s) == Lisp_Screen) #define SCREEN_LIVE_P(s) ((s)->display.nothing != 0) -#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) #define SCREEN_IS_TERMCAP(s) ((s)->output_method == output_termcap) #define SCREEN_IS_X(s) ((s)->output_method == output_x_window) #define SCREEN_MINIBUF_ONLY_P(s) \ @@ -173,6 +177,7 @@ #define SCREEN_CURSOR_X(s) (s)->cursor_x #define SCREEN_CURSOR_Y(s) (s)->cursor_y #define SCREEN_VISIBLE_P(s) (s)->visible +#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) #define SCREEN_GARBAGED_P(s) (s)->garbaged #define SCREEN_NO_SPLIT_P(s) (s)->no_split #define SCREEN_WANTS_MODELINE_P(s) (s)->wants_modeline @@ -202,6 +207,22 @@ x = wrong_type_argument (Qlive_screen_p, (x)); \ } +/* FOR_EACH_SCREEN (LIST_VAR, SCREEN_VAR) followed by a statement is a + `for' loop which iterates over the elements of Vscreen_list. The + loop will set SCREEN_VAR, a SCREEN_PTR, to each screen in + Vscreen_list in succession and execute the statement. LIST_VAR + should be a Lisp_Object; it is used to iterate through the + Vscreen_list. + + If MULTI_SCREEN isn't defined, then this loop expands to something which + executes the statement once. */ +#define FOR_EACH_SCREEN(list_var, screen_var) \ + for ((list_var) = Vscreen_list; \ + (CONSP (list_var) \ + && (screen_var = XSCREEN (XCONS (list_var)->car), 1)); \ + list_var = XCONS (list_var)->cdr) + + extern Lisp_Object Qscreenp, Qlive_screen_p; extern struct screen *selected_screen; @@ -212,6 +233,10 @@ extern struct screen *make_minibuffer_screen (); extern struct screen *make_screen_without_minibuffer (); +/* Nonzero means SCREEN_MESSAGE_BUF (selected_screen) is being used by + print. */ +extern int message_buf_print; + extern Lisp_Object Vscreen_list; extern Lisp_Object Vdefault_screen_alist; @@ -223,47 +248,65 @@ #define SCREEN_PTR int +extern struct screen the_only_screen; + extern int selected_screen; -#define last_nonminibuf_screen selected_screen +extern int last_nonminibuf_screen; + +/* Nonzero means SCREEN_MESSAGE_BUF (selected_screen) is being used by + print. */ +extern int message_buf_print; #define XSCREEN(s) selected_screen #define WINDOW_SCREEN(w) selected_screen #define SCREENP(s) (XTYPE(s) == Lisp_Screen) #define SCREEN_LIVE_P(s) 1 -#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) #define SCREEN_IS_TERMCAP(s) 1 #define SCREEN_IS_X(s) 0 -#define SCREEN_IS_MINIBUF_ONLY(s) 0 +#define SCREEN_MINIBUF_ONLY_P(s) 0 #define SCREEN_HAS_MINIBUF(s) 1 -#define SCREEN_CURRENT_GLYPHS(s) current_glyphs -#define SCREEN_DESIRED_GLYPHS(s) desired_glyphs -#define SCREEN_TEMP_GLYPHS(s) temp_glyphs -#define SCREEN_HEIGHT(s) screen_height -#define SCREEN_WIDTH(s) screen_width -#define SCREEN_NEW_HEIGHT(s) delayed_screen_height -#define SCREEN_NEW_WIDTH(s) delayed_screen_width -#define SCREEN_CURSOR_X(s) cursX -#define SCREEN_CURSOR_Y(s) cursY +#define SCREEN_CURRENT_GLYPHS(s) the_only_screen.current_glyphs +#define SCREEN_DESIRED_GLYPHS(s) the_only_screen.desired_glyphs +#define SCREEN_TEMP_GLYPHS(s) the_only_screen.temp_glyphs +#define SCREEN_HEIGHT(s) the_only_screen.height +#define SCREEN_WIDTH(s) the_only_screen.width +#define SCREEN_NEW_HEIGHT(s) the_only_screen.new_height +#define SCREEN_NEW_WIDTH(s) the_only_screen.new_width +#define SCREEN_CURSOR_X(s) the_only_screen.cursor_x +#define SCREEN_CURSOR_Y(s) the_only_screen.cursor_y #define SCREEN_VISIBLE_P(s) 1 +#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) #define SCREEN_GARBAGED_P(s) screen_garbaged #define SCREEN_NO_SPLIT_P(s) 0 #define SCREEN_WANTS_MODELINE_P(s) 1 #define SCREEN_ICONIFIED_P(s) 0 #define SCREEN_MINIBUF_WINDOW(s) minibuf_window -#define SCREEN_ROOT_WINDOW(s) root_window +#define SCREEN_ROOT_WINDOW(s) the_only_screen.root_window #define SCREEN_SELECTED_WINDOW(s) selected_window #define SET_GLYPHS_SCREEN(glyphs,screen) -#define SCREEN_INSERT_COST(screen) insert_line_cost -#define SCREEN_DELETE_COST(screen) delete_line_cost -#define SCREEN_INSERTN_COST(screen) insert_n_lines_cost -#define SCREEN_DELETEN_COST(screen) delete_n_lines_cost -#define SCREEN_MESSAGE_BUF(s) message_buf -#define SCREEN_SCROLL_BOTTOM_VPOS(s) scroll_bottom_vpos +#define SCREEN_INSERT_COST(screen) the_only_screen.insert_line_cost +#define SCREEN_DELETE_COST(screen) the_only_screen.delete_line_cost +#define SCREEN_INSERTN_COST(screen) the_only_screen.insert_n_lines_cost +#define SCREEN_DELETEN_COST(screen) the_only_screen.delete_n_lines_cost +#define SCREEN_MESSAGE_BUF(s) the_only_screen.message_buf +#define SCREEN_SCROLL_BOTTOM_VPOS(s) the_only_screen.scroll_bottom_vpos +#define SCREEN_FOCUS_SCREEN(s) 0 #define CHECK_SCREEN(x, i) { ; } +#define CHECK_LIVE_SCREEN(x, y) { ; } -extern int screen_width, screen_height; -extern int cursX, cursY; +/* FOR_EACH_SCREEN (LIST_VAR, SCREEN_VAR) followed by a statement is a + `for' loop which iterates over the elements of Vscreen_list. The + loop will set SCREEN_VAR, a SCREEN_PTR, to each screen in + Vscreen_list in succession and execute the statement. LIST_VAR + should be a Lisp_Object; it is used to iterate through the + Vscreen_list. + + If MULTI_SCREEN _is_ defined, then this loop expands to a real + `for' loop which traverses Vscreen_list using LIST_VAR and + SCREEN_VAR. */ +#define FOR_EACH_SCREEN(list_var, screen_var) \ + for (screen_var = (SCREEN_PTR) 1; screen_var; screen_var = (SCREEN_PTR) 0) #endif /* not MULTI_SCREEN */
--- a/src/keyboard.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/keyboard.c Tue Jun 30 13:54:21 1992 +0000 @@ -310,7 +310,7 @@ /* Symbols to use for non-text mouse positions. */ Lisp_Object Qmode_line; -Lisp_Object Qvertical_split; +Lisp_Object Qvertical_line; /* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt @@ -1625,7 +1625,8 @@ else if (do_mouse_tracking && mouse_moved) { SCREEN_PTR screen; - Lisp_Object x, y, time; + Lisp_Object x, y; + unsigned long time; (*mouse_position_hook) (&screen, &x, &y, &time); XSET (Vlast_event_screen, Lisp_Screen, screen); @@ -1779,7 +1780,7 @@ if (part == 1) posn = Qmode_line; else if (part == 2) - posn = Qvertical_split; + posn = Qvertical_line; else XSET (posn, Lisp_Int, buffer_posn_from_coords (XWINDOW (window), @@ -1831,7 +1832,7 @@ make_lispy_movement (screen, x, y, time) SCREEN_PTR screen; Lisp_Object x, y; - Lisp_Object time; + unsigned long time; { Lisp_Object window; int ix, iy; @@ -1852,7 +1853,7 @@ if (part == 1) posn = Qmode_line; else if (part == 2) - posn = Qvertical_split; + posn = Qvertical_line; else XSET (posn, Lisp_Int, buffer_posn_from_coords (XWINDOW (window), ix, iy)); @@ -1864,7 +1865,7 @@ Fcons (window, Fcons (posn, Fcons (Fcons (x, y), - Fcons (time, Qnil))))); + Fcons (make_number (time), Qnil))))); } @@ -2638,6 +2639,7 @@ Vquit_flag = Qnil; +#ifdef MULTI_SCREEN /* What buffer was this event typed/moused at? */ if (XTYPE (key) == Lisp_Int || XTYPE (key) == Lisp_Symbol) buf = (XBUFFER @@ -2674,6 +2676,7 @@ goto restart; } +#endif } first_binding = (follow_key (key, @@ -3512,8 +3515,8 @@ Qmode_line = intern ("mode-line"); staticpro (&Qmode_line); - Qvertical_split = intern ("vertical-split"); - staticpro (&Qvertical_split); + Qvertical_line = intern ("vertical-line"); + staticpro (&Qvertical_line); Qevent_kind = intern ("event-type"); staticpro (&Qevent_kind);
--- a/src/keyboard.h Tue Jun 30 13:49:39 1992 +0000 +++ b/src/keyboard.h Tue Jun 30 13:54:21 1992 +0000 @@ -1,11 +1,11 @@ /* Declarations useful when processing input. - Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -64,5 +64,5 @@ (Fget ((event_head), Qevent_kind)) /* Symbols to use for non-text mouse positions. */ -extern Lisp_Object Qmode_line, Qvertical_split; +extern Lisp_Object Qmode_line, Qvertical_line;
--- a/src/lisp.h Tue Jun 30 13:49:39 1992 +0000 +++ b/src/lisp.h Tue Jun 30 13:54:21 1992 +0000 @@ -97,30 +97,33 @@ Lisp_Internal_Stream, /* Used in a symbol value cell when the symbol's value is per-buffer. - The actual contents are a cons cell which starts a list like this: - (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE)). + The actual contents are a cons cell which starts a list like this: + (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE). - BUFFER is the last buffer for which this symbol's value was - made up to date. + BUFFER is the last buffer for which this symbol's value was + made up to date. - CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's - b_local_var_alist, that being the element whose car is this variable. - Or it can be a pointer to the (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), if BUFFER - does not have an element in its alist for this variable - (that is, if BUFFER sees the default value of this variable). + CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's + local_var_alist, that being the element whose car is this + variable. Or it can be a pointer to the + (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), + if BUFFER does not have an element in its alist for this + variable (that is, if BUFFER sees the default value of this + variable). - If we want to examine or set the value and BUFFER is current, - we just examine or set REALVALUE. - If BUFFER is not current, we store the current REALVALUE value into - CURRENT-ALIST-ELEMENT, then find the appropriate alist element for - the buffer now current and set up CURRENT-ALIST-ELEMENT. - Then we set REALVALUE out of that element, and store into BUFFER. + If we want to examine or set the value and BUFFER is current, + we just examine or set REALVALUE. If BUFFER is not current, we + store the current REALVALUE value into CURRENT-ALIST-ELEMENT, + then find the appropriate alist element for the buffer now + current and set up CURRENT-ALIST-ELEMENT. Then we set + REALVALUE out of that element, and store into BUFFER. - If we are setting the variable and the current buffer does not have - an alist entry for this variable, an alist entry is created. + If we are setting the variable and the current buffer does not + have an alist entry for this variable, an alist entry is + created. - Note that REALVALUE can be a forwarding pointer. - Each time it is examined or set, forwarding must be done. */ + Note that REALVALUE can be a forwarding pointer. Each time it + is examined or set, forwarding must be done. */ Lisp_Buffer_Local_Value, /* Like Lisp_Buffer_Local_Value with one difference:
--- a/src/lread.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/lread.c Tue Jun 30 13:54:21 1992 +0000 @@ -188,6 +188,7 @@ val = read_char (0); return val; } +#endif DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 0, 0, "Read a character from the command input (keyboard or macro).\n\ @@ -206,7 +207,6 @@ return val; } -#endif /* HAVE_X_WINDOWS */ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, "Don't use this yourself.") @@ -501,7 +501,7 @@ #ifndef standalone -DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 1, "", +DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 2, "", "Execute the current buffer as Lisp code.\n\ Programs can pass two arguments, BUFFER and PRINTFLAG.\n\ BUFFER is the buffer to evaluate (nil means use current buffer).\n\
--- a/src/minibuf.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/minibuf.c Tue Jun 30 13:54:21 1992 +0000 @@ -348,7 +348,7 @@ return Fread_from_minibuffer (prompt, initial_input, Qnil, Qnil, Qnil); } -DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 2, 1, 0, +DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 2, 2, 0, "Args PROMPT and INIT, strings. Read a string from the terminal, not allowing blanks.\n\ Prompt with PROMPT, and provide INIT as an initial value of the input string.") (prompt, init)
--- a/src/print.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/print.c Tue Jun 30 13:54:21 1992 +0000 @@ -159,7 +159,7 @@ #define PRINTCHAR(ch) printchar (ch, printcharfun) -/* Index of first unused element of message_buf */ +/* Index of first unused element of SCREEN_MESSAGE_BUF(selected_screen). */ static int printbufidx; static void
--- a/src/scroll.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/scroll.c Tue Jun 30 13:54:21 1992 +0000 @@ -1,11 +1,11 @@ /* Calculate what line insertion or deletion to do, and do it, - Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1990, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -54,15 +54,6 @@ char deletecount; }; -/* See do_line_insertion_deletion_costs for info on these arrays. */ - -#ifndef MULTI_SCREEN -static int *insert_line_cost; -static int *delete_line_cost; -static int *insert_n_lines_cost; -static int *delete_n_lines_cost; -#endif - /* Determine, in matrix[i,j], the cost of updating the first j old lines into the first i new lines.
--- a/src/term.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/term.c Tue Jun 30 13:54:21 1992 +0000 @@ -43,11 +43,6 @@ /* Terminal charateristics that higher levels want to look at. These are all extern'd in termchar.h */ -#ifndef MULTI_SCREEN -int screen_width; /* Number of usable columns */ -int screen_height; /* Number of lines */ -#endif - int must_write_spaces; /* Nonzero means spaces in the text must actually be output; can't just skip over some columns to leave them blank. */ @@ -103,7 +98,7 @@ void (*mouse_position_hook) ( /* SCREEN_PTR *s, Lisp_Object *x, Lisp_Object *y, - Lisp_Object *time */ ); + unsigned long *time */ ); /* When reading from a minibuffer in a different screen, Emacs wants to shift the highlight from the selected screen to the minibuffer's
--- a/src/termchar.h Tue Jun 30 13:49:39 1992 +0000 +++ b/src/termchar.h Tue Jun 30 13:54:21 1992 +0000 @@ -19,8 +19,6 @@ extern int baud_rate; /* Output speed in baud */ -extern int screen_width; /* Number of usable columns */ -extern int screen_height; /* Number of lines */ extern int must_write_spaces; /* Nonzero means spaces in the text must actually be output; can't just skip over some columns to leave them blank. */
--- a/src/termhooks.h Tue Jun 30 13:49:39 1992 +0000 +++ b/src/termhooks.h Tue Jun 30 13:54:21 1992 +0000 @@ -50,7 +50,7 @@ extern void (*mouse_position_hook) ( /* SCREEN_PTR *s, Lisp_Object *x, Lisp_Object *y, - Lisp_Object *time */ ); + unsigned long *time */ ); /* The window system handling code should set this if the mouse has moved since the last call to the mouse_position_hook. Calling that @@ -135,8 +135,20 @@ Lisp_Object code; Lisp_Object part; + +/* This is obviously wrong, but I'm not sure what else I should do. + Obviously, this should be a SCREEN_PTR. But that would require that + every file which #includes this one should also #include "screen.h", + which would mean that files like cm.c and other innocents would be + dragged into the set of screen.h users. Maybe the definition of this + structure should be elsewhere? In its own file? */ +#ifdef MULTI_SCREEN struct screen *screen; +#else + int screen; +#endif int modifiers; /* See enum below for interpretation. */ + Lisp_Object x, y; unsigned long timestamp; };
--- a/src/window.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/window.c Tue Jun 30 13:54:21 1992 +0000 @@ -47,14 +47,6 @@ Lisp_Object selected_window; -#ifndef MULTI_SCREEN - -/* The root window for the screen. - This is accessed via SCREEN_ROOT_WINDOW (selected_screen). */ -Lisp_Object root_window; - -#endif - /* The minibuffer window of the selected screen. Note that you cannot test for minibufferness of an arbitrary window by comparing against this; but you can test for minibufferness of @@ -222,7 +214,7 @@ posval = *compute_motion (top, 0, 0, posint, height, 0, XFASTINT (w->width) - 1 - (XFASTINT (w->width) + XFASTINT (w->left) - != XSCREEN (w->screen)->width), + != SCREEN_WIDTH (XSCREEN (w->screen))), XINT (w->hscroll), 0); return posval.vpos < height ? Qt : Qnil; @@ -363,9 +355,9 @@ screen.\n\ If COORDINATES are in the text portion of WINDOW,\n\ the coordinates relative to the window are returned.\n\ -If they are in the mode line of WINDOW, 'mode-line is returned.\n\ +If they are in the mode line of WINDOW, `mode-line' is returned.\n\ If they are on the border between WINDOW and its right sibling,\n\ - 'vertical-split is returned.") + `vertical-line' is returned.") (coordinates, window) register Lisp_Object coordinates, window; { @@ -388,7 +380,7 @@ return Qmode_line; case 3: /* On right border of window. */ - return Qvertical_split; + return Qvertical_line; default: abort (); @@ -642,8 +634,8 @@ /* If OLD is its screen's root_window, then replacement is the new root_window for that screen. */ - if (old == XSCREEN (o->screen)->root_window) - XSCREEN (o->screen)->root_window = replacement; + if (old == SCREEN_ROOT_WINDOW (XSCREEN (o->screen))) + SCREEN_ROOT_WINDOW (XSCREEN (o->screen)) = replacement; p->left = o->left; p->top = o->top; @@ -1062,7 +1054,8 @@ case GET_LRU_WINDOW: /* t as arg means consider only full-width windows */ - if (!NILP (obj) && XFASTINT (XWINDOW (w)->width) != screen->width) + if (!NILP (obj) && XFASTINT (XWINDOW (w)->width) + != SCREEN_WIDTH (screen)) break; #if 0 /* Ignore invisible and iconified screens. */ @@ -2614,32 +2607,33 @@ #else /* not MULTI_SCREEN */ extern Lisp_Object get_minibuffer (); - root_window = make_window (); + SCREEN_ROOT_WINDOW (selected_screen) = make_window (); minibuf_window = make_window (); - XWINDOW (root_window)->next = minibuf_window; - XWINDOW (minibuf_window)->prev = root_window; + XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->next = minibuf_window; + XWINDOW (minibuf_window)->prev = SCREEN_ROOT_WINDOW (selected_screen); /* These values 9 and 10 are arbitrary, just so that there is "something there." Correct values are put in in init_xdisp */ - XFASTINT (XWINDOW (root_window)->width) = 10; + XFASTINT (XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->width) = 10; XFASTINT (XWINDOW (minibuf_window)->width) = 10; - XFASTINT (XWINDOW (root_window)->height) = 9; + XFASTINT (XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->height) = 9; XFASTINT (XWINDOW (minibuf_window)->top) = 9; XFASTINT (XWINDOW (minibuf_window)->height) = 1; /* Prevent error in Fset_window_buffer. */ - XWINDOW (root_window)->buffer = Qt; + XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->buffer = Qt; XWINDOW (minibuf_window)->buffer = Qt; /* Now set them up for real. */ - Fset_window_buffer (root_window, Fcurrent_buffer ()); + Fset_window_buffer (SCREEN_ROOT_WINDOW (selected_screen), + Fcurrent_buffer ()); Fset_window_buffer (minibuf_window, get_minibuffer (0)); - selected_window = root_window; + selected_window = SCREEN_ROOT_WINDOW (selected_screen); /* Make sure this window seems more recently used than a newly-created, never-selected window. Increment window_select_count so the first selection ever will get
--- a/src/window.h Tue Jun 30 13:49:39 1992 +0000 +++ b/src/window.h Tue Jun 30 13:54:21 1992 +0000 @@ -1,11 +1,11 @@ /* Window definitions for GNU Emacs. - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful,
--- a/src/xdisp.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/xdisp.c Tue Jun 30 13:54:21 1992 +0000 @@ -167,31 +167,7 @@ int windows_or_buffers_changed; -#ifndef MULTI_SCREEN - -DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", - "Clear the screen and output again what is supposed to appear on it.") - () -{ - if (screen_height == 0) abort (); /* Some bug zeros some core */ - clear_screen (); - fflush (stdout); - clear_screen_records (); - if (screen_height == 0) abort (); /* Some bug zeros some core */ - windows_or_buffers_changed++; - /* Mark all windows as INaccurate, - so that every window will have its redisplay done. */ - mark_window_display_accurate (XWINDOW (minibuf_window)->prev, 0); - if (screen_height == 0) abort (); /* Some bug zeros some core */ - return Qnil; -} - -#endif /* not MULTI_SCREEN */ - -/* Buffer used for messages formatted by `message'. */ -char *message_buf; - -/* Nonzero if message_buf is being used by print; +/* Nonzero if SCREEN_MESSAGE_BUF (selected_screen) is being used by print; zero if being used by message. */ int message_buf_print; @@ -310,7 +286,7 @@ /* If desired cursor location is on this line, put it at end of text */ if (SCREEN_CURSOR_Y (s) == vpos) - SCREEN_CURSOR_X (s) = s->desired_glyphs->used[vpos]; + SCREEN_CURSOR_X (s) = SCREEN_DESIRED_GLYPHS (s)->used[vpos]; /* Fill the rest of the minibuffer window with blank lines. */ { @@ -1786,7 +1762,7 @@ and the rest of this line is mode lines of the sibling windows). */ if (XFASTINT (w->width) == SCREEN_WIDTH (s) || XFASTINT (XWINDOW (w->parent)->width) == SCREEN_WIDTH (s)) - s->desired_glyphs->highlight[vpos] = mode_line_inverse_video; + SCREEN_DESIRED_GLYPHS (s)->highlight[vpos] = mode_line_inverse_video; #ifdef HAVE_X_WINDOWS /* I'm trying this out because I saw Unimpress use it, but it's @@ -2325,10 +2301,6 @@ DEFVAR_BOOL ("mode-line-inverse-video", &mode_line_inverse_video, "*Non-nil means use inverse video for the mode line."); mode_line_inverse_video = 1; - -#ifndef MULTI_SCREEN - defsubr (&Sredraw_display); -#endif /* MULTI_SCREEN */ } /* initialize the window system */
--- a/src/xterm.c Tue Jun 30 13:49:39 1992 +0000 +++ b/src/xterm.c Tue Jun 30 13:54:21 1992 +0000 @@ -1522,7 +1522,7 @@ other kinds of events (focus changes and button clicks, for example), or by XQueryPointer calls; when one of these happens, we get another MotionNotify event the next time the mouse moves. This - is at least as efficient than getting motion events when mouse + is at least as efficient as getting motion events when mouse tracking is on, and I suspect only negligibly worse when tracking is off. @@ -1536,6 +1536,14 @@ static SCREEN_PTR last_mouse_screen; static XRectangle last_mouse_glyph; +/* This is a hack. We would really prefer that XTmouse_position would + return the time associated with the position it returns, but there + doesn't seem to be any way to wrest the timestamp from the server + along with the position query. So, we just keep track of the time + of the last movement we received, and return that in hopes that + it's somewhat accurate. */ +static Time last_mouse_movement_time; + /* Function to report a mouse movement to the mainstream Emacs code. The input handler calls this. @@ -1549,6 +1557,8 @@ XMotionEvent *event; { + last_mouse_movement_time = event->time; + /* Has the mouse moved off the glyph it was on at the last sighting? */ if (event->x < last_mouse_glyph.x || event->x >= last_mouse_glyph.x + last_mouse_glyph.width @@ -1580,7 +1590,7 @@ XTmouse_position (s, x, y, time) SCREEN_PTR *s; Lisp_Object *x, *y; - Lisp_Object *time; + unsigned long *time; { int ix, iy, dummy; Display *d = x_current_display; @@ -1635,8 +1645,11 @@ mouse_moved = 0; /* I don't know how to find the time for the last movement; it seems - like XQueryPointer ought to return it, but it doesn't. */ - *time = Qnil; + like XQueryPointer ought to return it, but it doesn't. So, we'll + return the time of the last MotionNotify event we received. Note + that the use of motion hints means that this isn't guaranteed to + be accurate at all. */ + *time = last_mouse_movement_time; UNBLOCK_INPUT; }