diff options
| author | Karoly Lorentey | 2004-04-28 14:10:58 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-04-28 14:10:58 +0000 |
| commit | 9a3ab26af39540424723a27ab3a7f3cd204660c8 (patch) | |
| tree | 9b6ffcbabad04dabde455962297ea3247586dcfb | |
| parent | 6c8caecfb9c96879b8ea6f1e08314408be40a832 (diff) | |
| parent | 66dc9a0f2f01edcef8f8ad0d891905409120c081 (diff) | |
| download | emacs-9a3ab26af39540424723a27ab3a7f3cd204660c8.tar.gz emacs-9a3ab26af39540424723a27ab3a7f3cd204660c8.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-256
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-257
{arch}/=cvs-sync-make-log: Use new features of tla-changelogs-to-log
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-154
| -rw-r--r-- | etc/NEWS | 11 | ||||
| -rw-r--r-- | lisp/ChangeLog | 148 | ||||
| -rw-r--r-- | lisp/arc-mode.el | 8 | ||||
| -rw-r--r-- | lisp/calendar/timeclock.el | 12 | ||||
| -rw-r--r-- | lisp/emacs-lisp/autoload.el | 12 | ||||
| -rw-r--r-- | lisp/eshell/em-alias.el | 3 | ||||
| -rw-r--r-- | lisp/eshell/em-dirs.el | 3 | ||||
| -rw-r--r-- | lisp/eshell/em-hist.el | 1 | ||||
| -rw-r--r-- | lisp/eshell/em-unix.el | 3 | ||||
| -rw-r--r-- | lisp/info.el | 16 | ||||
| -rw-r--r-- | lisp/net/browse-url.el | 12 | ||||
| -rw-r--r-- | lisp/pcomplete.el | 6 | ||||
| -rw-r--r-- | lisp/subr.el | 36 | ||||
| -rw-r--r-- | lisp/thumbs.el | 57 | ||||
| -rw-r--r-- | lisp/type-break.el | 372 | ||||
| -rw-r--r-- | lisp/wid-edit.el | 3 | ||||
| -rw-r--r-- | lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | lispref/files.texi | 10 | ||||
| -rw-r--r-- | man/ChangeLog | 9 | ||||
| -rw-r--r-- | man/autotype.texi | 8 | ||||
| -rw-r--r-- | man/dired-x.texi | 10 | ||||
| -rw-r--r-- | man/faq.texi | 2 | ||||
| -rw-r--r-- | man/viper.texi | 6 | ||||
| -rw-r--r-- | man/widget.texi | 1 | ||||
| -rw-r--r-- | src/ChangeLog | 20 | ||||
| -rw-r--r-- | src/editfns.c | 4 | ||||
| -rw-r--r-- | src/fileio.c | 56 | ||||
| -rw-r--r-- | src/msdos.c | 21 | ||||
| -rw-r--r-- | src/xdisp.c | 16 |
29 files changed, 684 insertions, 186 deletions
| @@ -1741,6 +1741,9 @@ to view diffs or log entries directly from vc-annotate-mode: | |||
| 1741 | 1741 | ||
| 1742 | * New modes and packages in Emacs 21.4 | 1742 | * New modes and packages in Emacs 21.4 |
| 1743 | 1743 | ||
| 1744 | ** The wdired.el package allows you to use normal editing commands on dired | ||
| 1745 | buffers to change filenames, permissions, etc... | ||
| 1746 | |||
| 1744 | ** The new python.el package is used to edit Python and Jython programs. | 1747 | ** The new python.el package is used to edit Python and Jython programs. |
| 1745 | 1748 | ||
| 1746 | ** The URL package (which had been part of W3) is now part of Emacs. | 1749 | ** The URL package (which had been part of W3) is now part of Emacs. |
| @@ -1976,6 +1979,11 @@ arg is non-nil. | |||
| 1976 | 1979 | ||
| 1977 | ** The function `eql' is now available without requiring the CL package. | 1980 | ** The function `eql' is now available without requiring the CL package. |
| 1978 | 1981 | ||
| 1982 | +++ | ||
| 1983 | ** The new primitive `set-file-times' sets a file's access and | ||
| 1984 | modification times. Magic file name handlers can handle this | ||
| 1985 | operation. | ||
| 1986 | |||
| 1979 | ** The display space :width and :align-to text properties are now | 1987 | ** The display space :width and :align-to text properties are now |
| 1980 | supported on text terminals. | 1988 | supported on text terminals. |
| 1981 | 1989 | ||
| @@ -3408,6 +3416,9 @@ using the text properties (esp. the face) of the prompt string. | |||
| 3408 | ** New function x-send-client-message sends a client message when | 3416 | ** New function x-send-client-message sends a client message when |
| 3409 | running under X. | 3417 | running under X. |
| 3410 | 3418 | ||
| 3419 | ** Arguments for remove-overlays are now optional, so that you can remove | ||
| 3420 | all overlays in the buffer by just calling (remove-overlay). | ||
| 3421 | |||
| 3411 | ** New packages: | 3422 | ** New packages: |
| 3412 | 3423 | ||
| 3413 | *** The new package gdb-ui.el provides an enhanced graphical interface to | 3424 | *** The new package gdb-ui.el provides an enhanced graphical interface to |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a3b646bc72..9922778a5c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,91 @@ | |||
| 1 | 2004-04-28 Juanma Barranquero <lektu@terra.es> | ||
| 2 | |||
| 3 | Use `time-less-p' from calendar/time-date.el instead of defining | ||
| 4 | custom versions of it. | ||
| 5 | |||
| 6 | * pcomplete.el (pcomplete-time-less-p): Remove. | ||
| 7 | |||
| 8 | * thumbs.el (time-less-p): Remove. | ||
| 9 | |||
| 10 | * calendar/timeclock.el (timeclock-time-less-p): Remove. | ||
| 11 | (timeclock-generate-report): Use `time-less-p'. | ||
| 12 | |||
| 13 | * emacs-lisp/autoload.el (autoload-before-p): Remove. | ||
| 14 | (update-file-autoloads, update-directory-autoloads): Use `time-less-p'. | ||
| 15 | |||
| 16 | 2004-04-28 Masatake YAMATO <jet@gyve.org> | ||
| 17 | |||
| 18 | * subr.el (remove-overlays): Make arguments optional. | ||
| 19 | |||
| 20 | * wid-edit.el (widget-specify-button): Put evaporate to the | ||
| 21 | overlay for sample. | ||
| 22 | (widget-specify-sample): Put evaporate to the overlay for sample. | ||
| 23 | (widget-specify-doc): Put evaporate to the overlay for documentation. | ||
| 24 | |||
| 25 | 2004-04-27 Jesper Harder <harder@ifa.au.dk> | ||
| 26 | |||
| 27 | * info.el (info-apropos): Make it an index node. Align node names | ||
| 28 | like makeinfo. | ||
| 29 | |||
| 30 | 2004-04-27 Eli Zaretskii <eliz@gnu.org> | ||
| 31 | |||
| 32 | * net/browse-url.el (browse-url-netscape-sentinel) | ||
| 33 | (browse-url-mozilla-sentinel, browse-url-galeon-sentinel) | ||
| 34 | (browse-url-epiphany-sentinel, browse-url-mosaic): | ||
| 35 | Use browse-url-*-program instead of a literal program name. | ||
| 36 | |||
| 37 | 2004-04-27 Kevin Ryde <user42@zip.com.au> | ||
| 38 | |||
| 39 | * eshell/em-alias.el: | ||
| 40 | * eshell/em-dirs.el: | ||
| 41 | * eshell/em-hist.el: | ||
| 42 | * eshell/em-unix.el: Add "(require 'eshell)", to get necessary | ||
| 43 | features when M-x customize-group loads modules before the main | ||
| 44 | eshell.el. | ||
| 45 | |||
| 46 | 2004-04-27 Matthew Mundell <matt@mundell.ukfsn.org> | ||
| 47 | |||
| 48 | * subr.el (momentary-string-display): Support EXIT-CHAR that is | ||
| 49 | either a character representation of an event or an event | ||
| 50 | description list. | ||
| 51 | |||
| 52 | * type-break.el: Capitalise Emacs and Lisp. | ||
| 53 | (type-break-good-break-interval, type-break-demo-boring-stats) | ||
| 54 | (type-break-terse-messages, type-break-file-name): New defcustoms. | ||
| 55 | (type-break-post-command-hook) | ||
| 56 | (type-break-warning-countdown-string): Quote variable names in doc. | ||
| 57 | (type-break-interval-start, type-break-auto-save-file-name): New vars. | ||
| 58 | (type-break-mode): Document type-break-good-break-interval and the | ||
| 59 | "session" file. Schedule break according to the session file. | ||
| 60 | Kill session file buffer on exit. Organise for save-some-buffers | ||
| 61 | to always save the session file. | ||
| 62 | (type-break-mode-line-message-mode, type-break-query-mode): | ||
| 63 | Uppercase arguments. | ||
| 64 | (type-break-file-time, type-break-file-keystroke-count, timep) | ||
| 65 | (type-break-choose-file, type-break-get-previous-time) | ||
| 66 | (type-break-get-previous-count): New defuns. | ||
| 67 | (type-break): Avoid break querying after a completed break in the | ||
| 68 | case where the query was initiated during user invocation of the | ||
| 69 | break. Optional terse messages. | ||
| 70 | Use type-break-good-break-interval if type-break-good-rest-interval is | ||
| 71 | nil. File the break time. | ||
| 72 | (type-break-schedule): New optional args for overriding the use of | ||
| 73 | the current time. | ||
| 74 | (type-break-cancel-time-warning-schedule): Avoid leftover warnings | ||
| 75 | after a break. | ||
| 76 | (type-break-check): File the keystroke count. | ||
| 77 | (type-break-do-query): Prevent a second query when the break is | ||
| 78 | interrupted. Optional terse message. | ||
| 79 | (type-break-keystroke-reset): Record the start of a typing interval. | ||
| 80 | (type-break-demo-boring): Optional terse messages. Display word | ||
| 81 | per minute and keystroke counts according to | ||
| 82 | type-break-demo-boring-stats. | ||
| 83 | |||
| 84 | 2004-04-27 Daniel M Coffman <coffmand@us.ibm.com> (tiny change) | ||
| 85 | |||
| 86 | * arc-mode.el (archive-maybe-copy): If ARCHIVE includes leading | ||
| 87 | directories, make sure they exist under archive-tmpdir. | ||
| 88 | |||
| 1 | 2004-04-27 Juri Linkov <juri@jurta.org> | 89 | 2004-04-27 Juri Linkov <juri@jurta.org> |
| 2 | 90 | ||
| 3 | * help.el (view-emacs-news): With argument, display info for the | 91 | * help.el (view-emacs-news): With argument, display info for the |
| @@ -77,9 +165,7 @@ | |||
| 77 | 165 | ||
| 78 | 2004-04-26 Eli Zaretskii <eliz@gnu.org> | 166 | 2004-04-26 Eli Zaretskii <eliz@gnu.org> |
| 79 | 167 | ||
| 80 | * progmodes/gud.el (gud-pdb-command-name): Change default to | 168 | * progmodes/gud.el (gud-pdb-command-name): Change default to "pydb". |
| 81 | "pydb". | ||
| 82 | |||
| 83 | 169 | ||
| 84 | 2004-04-25 Luc Teirlinck <teirllm@auburn.edu> | 170 | 2004-04-25 Luc Teirlinck <teirllm@auburn.edu> |
| 85 | 171 | ||
| @@ -106,8 +192,8 @@ | |||
| 106 | Delete functions. | 192 | Delete functions. |
| 107 | (compilation-get-file-structure): New function inherits | 193 | (compilation-get-file-structure): New function inherits |
| 108 | functionality of the two preceding ones. | 194 | functionality of the two preceding ones. |
| 109 | (compilation-internal-error-properties, compilation-fake-loc): Use | 195 | (compilation-internal-error-properties, compilation-fake-loc): |
| 110 | it so that different paths to the same file share the same | 196 | Use it so that different paths to the same file share the same |
| 111 | markers. Also optimize finding adjacent marker slightly. | 197 | markers. Also optimize finding adjacent marker slightly. |
| 112 | 198 | ||
| 113 | 2004-04-25 Kim F. Storm <storm@cua.dk> | 199 | 2004-04-25 Kim F. Storm <storm@cua.dk> |
| @@ -140,6 +226,37 @@ | |||
| 140 | (rmail-start-mail): Support rmail-mail-new-frame even on | 226 | (rmail-start-mail): Support rmail-mail-new-frame even on |
| 141 | terminals that can display only one frame at a time. | 227 | terminals that can display only one frame at a time. |
| 142 | 228 | ||
| 229 | 2004-04-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 230 | |||
| 231 | * emacs-lisp/checkdoc.el (checkdoc-output-error-regex-alist): New var. | ||
| 232 | (checkdoc-output-font-lock-keywords): Remove error regexp. | ||
| 233 | (checkdoc-output-mode-map): Remove. | ||
| 234 | (checkdoc-output-mode): Derive from compilation-mode. | ||
| 235 | (checkdoc-find-error-mouse, checkdoc-find-error): Remove. | ||
| 236 | |||
| 237 | * dired.el (dired-mode-map): Add a menu entry for wdired. | ||
| 238 | |||
| 239 | * emacs-lisp/rx.el (rx-syntax): Move sregex style syntax to code. | ||
| 240 | (rx-bracket, rx-check-any, rx-any): Clean up name space. | ||
| 241 | |||
| 242 | * wdired.el: (wdired-mode-map): Move init into declaration. | ||
| 243 | Fix `return' binding. | ||
| 244 | (wdired-change-to-wdired-mode, wdired-change-to-dired-mode): | ||
| 245 | Use force-mode-line-update. | ||
| 246 | (wdired-get-filename): Use `unless'. | ||
| 247 | (wdired-preprocess-files): Don't assume names have no \n and use / for | ||
| 248 | dir separator. | ||
| 249 | (wdired-normalize-filename): Use replace-regexp-in-string. | ||
| 250 | (wdired-load-hooks): Remove. | ||
| 251 | (wdired-mode-hooks): Rename to wdired-mode-hook. | ||
| 252 | |||
| 253 | * info-look.el: Add support for cfengine-mode. | ||
| 254 | (info-lookup-setup-mode): Use dolist. | ||
| 255 | |||
| 256 | 2004-04-23 Juan Le,As(Bn Lahoz Garc,Am(Ba <juan-leon.lahoz@tecsidel.es> | ||
| 257 | |||
| 258 | * wdired.el: New file. | ||
| 259 | |||
| 143 | 2004-04-23 Juanma Barranquero <lektu@terra.es> | 260 | 2004-04-23 Juanma Barranquero <lektu@terra.es> |
| 144 | 261 | ||
| 145 | * ielm.el (inferior-emacs-lisp-mode): Fix docstring. | 262 | * ielm.el (inferior-emacs-lisp-mode): Fix docstring. |
| @@ -155,9 +272,22 @@ | |||
| 155 | 272 | ||
| 156 | * vc.el (vc-print-log): Likewise. | 273 | * vc.el (vc-print-log): Likewise. |
| 157 | 274 | ||
| 275 | 2004-04-20 Dave Love <fx@gnu.org> | ||
| 276 | |||
| 277 | * emacs-lisp/rx.el: Doc fixes. | ||
| 278 | (rx-constituents): Add/extend many forms. | ||
| 279 | (rx-check): Check form is a list. | ||
| 280 | (bracket): Defvar. | ||
| 281 | (rx-check-any, rx-any, rx-check-not): Modify. | ||
| 282 | (rx-not): Simplify. | ||
| 283 | (rx-trans-forms, rx-=, rx->=, rx-**, rx-not-char, rx-not-syntax): New. | ||
| 284 | (rx-kleene): Use rx-trans-forms. | ||
| 285 | (rx-quote-for-set): Delete. | ||
| 286 | (rx): Allow multiple args. | ||
| 287 | |||
| 158 | 2004-04-23 Kenichi Handa <handa@m17n.org> | 288 | 2004-04-23 Kenichi Handa <handa@m17n.org> |
| 159 | 289 | ||
| 160 | * international/mule-util.el (char-displayable-p): Simplified by | 290 | * international/mule-util.el (char-displayable-p): Simplify by |
| 161 | using internal-char-font. | 291 | using internal-char-font. |
| 162 | 292 | ||
| 163 | 2004-04-23 Juanma Barranquero <lektu@terra.es> | 293 | 2004-04-23 Juanma Barranquero <lektu@terra.es> |
| @@ -290,9 +420,9 @@ | |||
| 290 | 420 | ||
| 291 | 2003-04-21 Paul Pogonyshev <pogonyshev@gmx.net> | 421 | 2003-04-21 Paul Pogonyshev <pogonyshev@gmx.net> |
| 292 | 422 | ||
| 293 | * dabbrev.el (dabbrev--substitute-expansion): Fix a bug which lost | 423 | * dabbrev.el (dabbrev--substitute-expansion): Don't lose |
| 294 | the case of letters in case-insensitive expansions on certain | 424 | the case of letters in case-insensitive expansions when the |
| 295 | abbreviations. | 425 | abbrev is preceded by characters with letter syntax. |
| 296 | 426 | ||
| 297 | 2004-04-21 Richard M. Stallman <rms@gnu.org> | 427 | 2004-04-21 Richard M. Stallman <rms@gnu.org> |
| 298 | 428 | ||
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 7ac7a402c3a..2cb20b4545d 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el | |||
| @@ -815,6 +815,14 @@ using `make-temp-file', and the generated name is returned." | |||
| 815 | (or (and archive-subfile-mode (aref archive-subfile-mode 0)) | 815 | (or (and archive-subfile-mode (aref archive-subfile-mode 0)) |
| 816 | archive))) | 816 | archive))) |
| 817 | (make-directory archive-tmpdir t) | 817 | (make-directory archive-tmpdir t) |
| 818 | ;; If ARCHIVE includes leading directories, make sure they | ||
| 819 | ;; exist under archive-tmpdir. | ||
| 820 | (let ((arch-dir (file-name-directory archive))) | ||
| 821 | (if arch-dir | ||
| 822 | (make-directory (concat | ||
| 823 | (file-name-as-directory archive-tmpdir) | ||
| 824 | arch-dir) | ||
| 825 | t))) | ||
| 818 | (setq archive-local-name | 826 | (setq archive-local-name |
| 819 | (archive-unique-fname archive-name archive-tmpdir)) | 827 | (archive-unique-fname archive-name archive-tmpdir)) |
| 820 | (save-restriction | 828 | (save-restriction |
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 0507ddab64a..709ea25fbcb 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el | |||
| @@ -1129,12 +1129,6 @@ discrepancy, today's discrepancy, and the time worked today." | |||
| 1129 | 1129 | ||
| 1130 | ;;; A reporting function that uses timeclock-log-data | 1130 | ;;; A reporting function that uses timeclock-log-data |
| 1131 | 1131 | ||
| 1132 | (defun timeclock-time-less-p (t1 t2) | ||
| 1133 | "Say whether time T1 is less than time T2." | ||
| 1134 | (or (< (car t1) (car t2)) | ||
| 1135 | (and (= (car t1) (car t2)) | ||
| 1136 | (< (nth 1 t1) (nth 1 t2))))) | ||
| 1137 | |||
| 1138 | (defun timeclock-day-base (&optional time) | 1132 | (defun timeclock-day-base (&optional time) |
| 1139 | "Given a time within a day, return 0:0:0 within that day. | 1133 | "Given a time within a day, return 0:0:0 within that day. |
| 1140 | If optional argument TIME is non-nil, use that instead of the current time." | 1134 | If optional argument TIME is non-nil, use that instead of the current time." |
| @@ -1190,12 +1184,12 @@ HTML-P is non-nil, HTML markup is added." | |||
| 1190 | (* 2 7 24 60 60)))) | 1184 | (* 2 7 24 60 60)))) |
| 1191 | two-week-len today-len) | 1185 | two-week-len today-len) |
| 1192 | (while proj-data | 1186 | (while proj-data |
| 1193 | (if (not (timeclock-time-less-p | 1187 | (if (not (time-less-p |
| 1194 | (timeclock-entry-begin (car proj-data)) today)) | 1188 | (timeclock-entry-begin (car proj-data)) today)) |
| 1195 | (setq today-len (timeclock-entry-list-length proj-data) | 1189 | (setq today-len (timeclock-entry-list-length proj-data) |
| 1196 | proj-data nil) | 1190 | proj-data nil) |
| 1197 | (if (and (null two-week-len) | 1191 | (if (and (null two-week-len) |
| 1198 | (not (timeclock-time-less-p | 1192 | (not (time-less-p |
| 1199 | (timeclock-entry-begin (car proj-data)) | 1193 | (timeclock-entry-begin (car proj-data)) |
| 1200 | two-weeks-ago))) | 1194 | two-weeks-ago))) |
| 1201 | (setq two-week-len (timeclock-entry-list-length proj-data))) | 1195 | (setq two-week-len (timeclock-entry-list-length proj-data))) |
| @@ -1260,7 +1254,7 @@ HTML-P is non-nil, HTML markup is added." | |||
| 1260 | (while day-list | 1254 | (while day-list |
| 1261 | (let ((i 0) (l 5)) | 1255 | (let ((i 0) (l 5)) |
| 1262 | (while (< i l) | 1256 | (while (< i l) |
| 1263 | (unless (timeclock-time-less-p | 1257 | (unless (time-less-p |
| 1264 | (timeclock-day-begin (car day-list)) | 1258 | (timeclock-day-begin (car day-list)) |
| 1265 | (aref lengths i)) | 1259 | (aref lengths i)) |
| 1266 | (let ((base (timeclock-time-to-seconds | 1260 | (let ((base (timeclock-time-to-seconds |
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 43da3d09827..21843c9601d 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;; autoload.el --- maintain autoloads in loaddefs.el | 1 | ;; autoload.el --- maintain autoloads in loaddefs.el |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2003 | 3 | ;; Copyright (C) 1991,92,93,94,95,96,97, 2001,02,03,04 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Roland McGrath <roland@gnu.org> | 6 | ;; Author: Roland McGrath <roland@gnu.org> |
| @@ -407,7 +407,7 @@ Return FILE if there was no autoload cookie in it." | |||
| 407 | (if (and (or (null existing-buffer) | 407 | (if (and (or (null existing-buffer) |
| 408 | (not (buffer-modified-p existing-buffer))) | 408 | (not (buffer-modified-p existing-buffer))) |
| 409 | (listp last-time) (= (length last-time) 2) | 409 | (listp last-time) (= (length last-time) 2) |
| 410 | (not (autoload-before-p last-time file-time))) | 410 | (not (time-less-p last-time file-time))) |
| 411 | (progn | 411 | (progn |
| 412 | (if (interactive-p) | 412 | (if (interactive-p) |
| 413 | (message "\ | 413 | (message "\ |
| @@ -468,11 +468,6 @@ Autoload section for %s is up to date." | |||
| 468 | 468 | ||
| 469 | (if no-autoloads file)))) | 469 | (if no-autoloads file)))) |
| 470 | 470 | ||
| 471 | (defun autoload-before-p (time1 time2) | ||
| 472 | (or (< (car time1) (car time2)) | ||
| 473 | (and (= (car time1) (car time2)) | ||
| 474 | (< (nth 1 time1) (nth 1 time2))))) | ||
| 475 | |||
| 476 | (defun autoload-remove-section (begin) | 471 | (defun autoload-remove-section (begin) |
| 477 | (goto-char begin) | 472 | (goto-char begin) |
| 478 | (search-forward generate-autoload-section-trailer) | 473 | (search-forward generate-autoload-section-trailer) |
| @@ -527,8 +522,7 @@ directory or directories specified." | |||
| 527 | (dolist (file file) | 522 | (dolist (file file) |
| 528 | (let ((file-time (nth 5 (file-attributes file)))) | 523 | (let ((file-time (nth 5 (file-attributes file)))) |
| 529 | (when (and file-time | 524 | (when (and file-time |
| 530 | (not (autoload-before-p last-time | 525 | (not (time-less-p last-time file-time))) |
| 531 | file-time))) | ||
| 532 | ;; file unchanged | 526 | ;; file unchanged |
| 533 | (push file no-autoloads) | 527 | (push file no-autoloads) |
| 534 | (setq files (delete file files))))))) | 528 | (setq files (delete file files))))))) |
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index 0312f9d7ada..02af7531b3f 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; em-alias.el --- creation and management of command aliases | 1 | ;;; em-alias.el --- creation and management of command aliases |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999, 2000 Free Software Foundation | 3 | ;; Copyright (C) 1999, 2000, 2004 Free Software Foundation |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@gnu.org> | 5 | ;; Author: John Wiegley <johnw@gnu.org> |
| 6 | 6 | ||
| @@ -24,6 +24,7 @@ | |||
| 24 | (provide 'em-alias) | 24 | (provide 'em-alias) |
| 25 | 25 | ||
| 26 | (eval-when-compile (require 'esh-maint)) | 26 | (eval-when-compile (require 'esh-maint)) |
| 27 | (require 'eshell) | ||
| 27 | 28 | ||
| 28 | (defgroup eshell-alias nil | 29 | (defgroup eshell-alias nil |
| 29 | "Command aliases allow for easy definition of alternate commands." | 30 | "Command aliases allow for easy definition of alternate commands." |
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 73837c324a5..7b74069454b 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; em-dirs.el --- directory navigation commands | 1 | ;;; em-dirs.el --- directory navigation commands |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999, 2000 Free Software Foundation | 3 | ;; Copyright (C) 1999, 2000, 2004 Free Software Foundation |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@gnu.org> | 5 | ;; Author: John Wiegley <johnw@gnu.org> |
| 6 | 6 | ||
| @@ -24,6 +24,7 @@ | |||
| 24 | (provide 'em-dirs) | 24 | (provide 'em-dirs) |
| 25 | 25 | ||
| 26 | (eval-when-compile (require 'esh-maint)) | 26 | (eval-when-compile (require 'esh-maint)) |
| 27 | (require 'eshell) | ||
| 27 | 28 | ||
| 28 | (defgroup eshell-dirs nil | 29 | (defgroup eshell-dirs nil |
| 29 | "Directory navigation involves changing directories, examining the | 30 | "Directory navigation involves changing directories, examining the |
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index b38c7a519ec..f4bfea798e0 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | (provide 'em-hist) | 24 | (provide 'em-hist) |
| 25 | 25 | ||
| 26 | (eval-when-compile (require 'esh-maint)) | 26 | (eval-when-compile (require 'esh-maint)) |
| 27 | (require 'eshell) | ||
| 27 | 28 | ||
| 28 | (defgroup eshell-hist nil | 29 | (defgroup eshell-hist nil |
| 29 | "This module provides command history management." | 30 | "This module provides command history management." |
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 8446eb1aa9d..43d3c9c4e5e 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; em-unix.el --- UNIX command aliases | 1 | ;;; em-unix.el --- UNIX command aliases |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation | 3 | ;; Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@gnu.org> | 5 | ;; Author: John Wiegley <johnw@gnu.org> |
| 6 | 6 | ||
| @@ -24,6 +24,7 @@ | |||
| 24 | (provide 'em-unix) | 24 | (provide 'em-unix) |
| 25 | 25 | ||
| 26 | (eval-when-compile (require 'esh-maint)) | 26 | (eval-when-compile (require 'esh-maint)) |
| 27 | (require 'eshell) | ||
| 27 | 28 | ||
| 28 | (defgroup eshell-unix nil | 29 | (defgroup eshell-unix nil |
| 29 | "This module defines many of the more common UNIX utilities as | 30 | "This module defines many of the more common UNIX utilities as |
diff --git a/lisp/info.el b/lisp/info.el index a57078d5e2d..085be1ae897 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -2493,14 +2493,18 @@ Build a menu of the possible matches." | |||
| 2493 | (message "No matches found") | 2493 | (message "No matches found") |
| 2494 | (with-current-buffer (get-buffer-create " *info-apropos*") | 2494 | (with-current-buffer (get-buffer-create " *info-apropos*") |
| 2495 | (erase-buffer) | 2495 | (erase-buffer) |
| 2496 | (insert "\n\nFile: apropos, Node: Top, Up: (dir)\n") | 2496 | (insert "\n\nFile: apropos, Node: Index, Up: (dir)\n") |
| 2497 | (insert "* Menu: \nNodes whose indices contain \"" string "\"\n\n") | 2497 | (insert "* Menu: \nNodes whose indices contain \"" string "\"\n\n") |
| 2498 | (dolist (entry matches) | 2498 | (dolist (entry matches) |
| 2499 | (insert "* " (nth 1 entry) " [" (nth 0 entry) | 2499 | (insert |
| 2500 | "]: (" (nth 0 entry) ")" (nth 2 entry) "." | 2500 | (format "* %-38s (%s)%s.%s\n" |
| 2501 | (if (nth 3 entry) (concat " (line " (nth 3 entry) ")") "") | 2501 | (concat (nth 1 entry) " [" (nth 0 entry) "]:") |
| 2502 | "\n"))) | 2502 | (nth 0 entry) |
| 2503 | (Info-find-node "apropos" "top") | 2503 | (nth 2 entry) |
| 2504 | (if (nth 3 entry) | ||
| 2505 | (concat " (line " (nth 3 entry) ")") | ||
| 2506 | ""))))) | ||
| 2507 | (Info-find-node "apropos" "Index") | ||
| 2504 | (setq Info-complete-cache nil))))) | 2508 | (setq Info-complete-cache nil))))) |
| 2505 | 2509 | ||
| 2506 | (defun Info-undefined () | 2510 | (defun Info-undefined () |
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index a70e08028d2..8000e49c6d8 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -847,7 +847,7 @@ used instead of `browse-url-new-window-flag'." | |||
| 847 | (or (eq (process-exit-status process) 0) | 847 | (or (eq (process-exit-status process) 0) |
| 848 | (let* ((process-environment (browse-url-process-environment))) | 848 | (let* ((process-environment (browse-url-process-environment))) |
| 849 | ;; Netscape not running - start it | 849 | ;; Netscape not running - start it |
| 850 | (message "Starting Netscape...") | 850 | (message "Starting %s..." browse-url-netscape-program) |
| 851 | (apply 'start-process (concat "netscape" url) nil | 851 | (apply 'start-process (concat "netscape" url) nil |
| 852 | browse-url-netscape-program | 852 | browse-url-netscape-program |
| 853 | (append browse-url-netscape-startup-arguments (list url)))))) | 853 | (append browse-url-netscape-startup-arguments (list url)))))) |
| @@ -918,7 +918,7 @@ used instead of `browse-url-new-window-flag'." | |||
| 918 | (or (eq (process-exit-status process) 0) | 918 | (or (eq (process-exit-status process) 0) |
| 919 | (let* ((process-environment (browse-url-process-environment))) | 919 | (let* ((process-environment (browse-url-process-environment))) |
| 920 | ;; Mozilla is not running - start it | 920 | ;; Mozilla is not running - start it |
| 921 | (message "Starting Mozilla...") | 921 | (message "Starting %s..." browse-url-mozilla-program) |
| 922 | (apply 'start-process (concat "mozilla " url) nil | 922 | (apply 'start-process (concat "mozilla " url) nil |
| 923 | browse-url-mozilla-program | 923 | browse-url-mozilla-program |
| 924 | (append browse-url-mozilla-startup-arguments (list url)))))) | 924 | (append browse-url-mozilla-startup-arguments (list url)))))) |
| @@ -968,7 +968,7 @@ used instead of `browse-url-new-window-flag'." | |||
| 968 | (or (eq (process-exit-status process) 0) | 968 | (or (eq (process-exit-status process) 0) |
| 969 | (let* ((process-environment (browse-url-process-environment))) | 969 | (let* ((process-environment (browse-url-process-environment))) |
| 970 | ;; Galeon is not running - start it | 970 | ;; Galeon is not running - start it |
| 971 | (message "Starting Galeon...") | 971 | (message "Starting %s..." browse-url-galeon-program) |
| 972 | (apply 'start-process (concat "galeon " url) nil | 972 | (apply 'start-process (concat "galeon " url) nil |
| 973 | browse-url-galeon-program | 973 | browse-url-galeon-program |
| 974 | (append browse-url-galeon-startup-arguments (list url)))))) | 974 | (append browse-url-galeon-startup-arguments (list url)))))) |
| @@ -1017,7 +1017,7 @@ used instead of `browse-url-new-window-flag'." | |||
| 1017 | (or (eq (process-exit-status process) 0) | 1017 | (or (eq (process-exit-status process) 0) |
| 1018 | (let* ((process-environment (browse-url-process-environment))) | 1018 | (let* ((process-environment (browse-url-process-environment))) |
| 1019 | ;; Epiphany is not running - start it | 1019 | ;; Epiphany is not running - start it |
| 1020 | (message "Starting Epiphany...") | 1020 | (message "Starting %s..." browse-url-epiphany-program) |
| 1021 | (apply 'start-process (concat "epiphany " url) nil | 1021 | (apply 'start-process (concat "epiphany " url) nil |
| 1022 | browse-url-epiphany-program | 1022 | browse-url-epiphany-program |
| 1023 | (append browse-url-epiphany-startup-arguments (list url)))))) | 1023 | (append browse-url-epiphany-startup-arguments (list url)))))) |
| @@ -1098,10 +1098,10 @@ used instead of `browse-url-new-window-flag'." | |||
| 1098 | (message "Signalling Mosaic...done") | 1098 | (message "Signalling Mosaic...done") |
| 1099 | ) | 1099 | ) |
| 1100 | ;; Mosaic not running - start it | 1100 | ;; Mosaic not running - start it |
| 1101 | (message "Starting Mosaic...") | 1101 | (message "Starting %s..." browse-url-mosaic-program) |
| 1102 | (apply 'start-process "xmosaic" nil browse-url-mosaic-program | 1102 | (apply 'start-process "xmosaic" nil browse-url-mosaic-program |
| 1103 | (append browse-url-mosaic-arguments (list url))) | 1103 | (append browse-url-mosaic-arguments (list url))) |
| 1104 | (message "Starting Mosaic...done")))) | 1104 | (message "Starting %s...done" browse-url-mosaic-program)))) |
| 1105 | 1105 | ||
| 1106 | ;; --- Grail --- | 1106 | ;; --- Grail --- |
| 1107 | 1107 | ||
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 42f4c23add1..1260867f7c6 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el | |||
| @@ -1147,12 +1147,6 @@ If specific documentation can't be given, be generic." | |||
| 1147 | 1147 | ||
| 1148 | ;; general utilities | 1148 | ;; general utilities |
| 1149 | 1149 | ||
| 1150 | (defsubst pcomplete-time-less-p (t1 t2) | ||
| 1151 | "Say whether time T1 is less than time T2." | ||
| 1152 | (or (< (car t1) (car t2)) | ||
| 1153 | (and (= (car t1) (car t2)) | ||
| 1154 | (< (nth 1 t1) (nth 1 t2))))) | ||
| 1155 | |||
| 1156 | (defun pcomplete-pare-list (l r &optional pred) | 1150 | (defun pcomplete-pare-list (l r &optional pred) |
| 1157 | "Destructively remove from list L all elements matching any in list R. | 1151 | "Destructively remove from list L all elements matching any in list R. |
| 1158 | Test is done using `equal'. | 1152 | Test is done using `equal'. |
diff --git a/lisp/subr.el b/lisp/subr.el index 57f725fb44c..a9acc15606d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1457,9 +1457,11 @@ menu bar menus and the frame title." | |||
| 1457 | 1457 | ||
| 1458 | (defun momentary-string-display (string pos &optional exit-char message) | 1458 | (defun momentary-string-display (string pos &optional exit-char message) |
| 1459 | "Momentarily display STRING in the buffer at POS. | 1459 | "Momentarily display STRING in the buffer at POS. |
| 1460 | Display remains until next character is typed. | 1460 | Display remains until next event is input. |
| 1461 | If the char is EXIT-CHAR (optional third arg, default is SPC) it is swallowed; | 1461 | Optional third arg EXIT-CHAR can be a character, event or event |
| 1462 | otherwise it is then available as input (as a command if nothing else). | 1462 | description list. EXIT-CHAR defaults to SPC. If the input is |
| 1463 | EXIT-CHAR it is swallowed; otherwise it is then available as | ||
| 1464 | input (as a command if nothing else). | ||
| 1463 | Display MESSAGE (optional fourth arg) in the echo area. | 1465 | Display MESSAGE (optional fourth arg) in the echo area. |
| 1464 | If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." | 1466 | If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." |
| 1465 | (or exit-char (setq exit-char ?\ )) | 1467 | (or exit-char (setq exit-char ?\ )) |
| @@ -1489,9 +1491,23 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." | |||
| 1489 | (recenter 0)))) | 1491 | (recenter 0)))) |
| 1490 | (message (or message "Type %s to continue editing.") | 1492 | (message (or message "Type %s to continue editing.") |
| 1491 | (single-key-description exit-char)) | 1493 | (single-key-description exit-char)) |
| 1492 | (let ((char (read-event))) | 1494 | (let (char) |
| 1493 | (or (eq char exit-char) | 1495 | (if (integerp exit-char) |
| 1494 | (setq unread-command-events (list char))))) | 1496 | (condition-case nil |
| 1497 | (progn | ||
| 1498 | (setq char (read-char)) | ||
| 1499 | (or (eq char exit-char) | ||
| 1500 | (setq unread-command-events (list char)))) | ||
| 1501 | (error | ||
| 1502 | ;; `exit-char' is a character, hence it differs | ||
| 1503 | ;; from char, which is an event. | ||
| 1504 | (setq unread-command-events (list char)))) | ||
| 1505 | ;; `exit-char' can be an event, or an event description | ||
| 1506 | ;; list. | ||
| 1507 | (setq char (read-event)) | ||
| 1508 | (or (eq char exit-char) | ||
| 1509 | (eq char (event-convert-list exit-char)) | ||
| 1510 | (setq unread-command-events (list char)))))) | ||
| 1495 | (if insert-end | 1511 | (if insert-end |
| 1496 | (save-excursion | 1512 | (save-excursion |
| 1497 | (delete-region pos insert-end))) | 1513 | (delete-region pos insert-end))) |
| @@ -1512,9 +1528,13 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." | |||
| 1512 | (overlay-put o1 (pop props) (pop props))) | 1528 | (overlay-put o1 (pop props) (pop props))) |
| 1513 | o1)) | 1529 | o1)) |
| 1514 | 1530 | ||
| 1515 | (defun remove-overlays (beg end name val) | 1531 | (defun remove-overlays (&optional beg end name val) |
| 1516 | "Clear BEG and END of overlays whose property NAME has value VAL. | 1532 | "Clear BEG and END of overlays whose property NAME has value VAL. |
| 1517 | Overlays might be moved and or split." | 1533 | Overlays might be moved and or split. |
| 1534 | If BEG is nil, `(point-min)' is used. If END is nil, `(point-max)' | ||
| 1535 | is used." | ||
| 1536 | (unless beg (setq beg (point-min))) | ||
| 1537 | (unless end (setq end (point-max))) | ||
| 1518 | (if (< end beg) | 1538 | (if (< end beg) |
| 1519 | (setq beg (prog1 end (setq end beg)))) | 1539 | (setq beg (prog1 end (setq end beg)))) |
| 1520 | (save-excursion | 1540 | (save-excursion |
diff --git a/lisp/thumbs.el b/lisp/thumbs.el index cc692c1f975..8bba647a2ad 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; thumbs.el --- Thumbnails previewer for images files | 1 | ;;; thumbs.el --- Thumbnails previewer for images files |
| 2 | ;;; | 2 | ;;; |
| 3 | ;; Author: Jean-Philippe Theberge <jphiltheberge@videotron.ca> | 3 | ;; Author: Jean-Philippe Theberge <jphiltheberge@videotron.ca> |
| 4 | ;; | 4 | ;; |
| 5 | ;; Thanks: Alex Schroeder <alex@gnu.org> for maintaining the package at some time | 5 | ;; Thanks: Alex Schroeder <alex@gnu.org> for maintaining the package at some time |
| 6 | ;; The peoples at #emacs@freenode.net for numerous help | 6 | ;; The peoples at #emacs@freenode.net for numerous help |
| 7 | ;; RMS for emacs and the GNU project. | 7 | ;; RMS for emacs and the GNU project. |
| @@ -52,7 +52,7 @@ | |||
| 52 | ;; for that image. C-h m will give you a list of available keybinding. | 52 | ;; for that image. C-h m will give you a list of available keybinding. |
| 53 | 53 | ||
| 54 | ;;; History: | 54 | ;;; History: |
| 55 | ;; | 55 | ;; |
| 56 | 56 | ||
| 57 | ;;; Code: | 57 | ;;; Code: |
| 58 | 58 | ||
| @@ -62,9 +62,9 @@ | |||
| 62 | 62 | ||
| 63 | (when (not (display-images-p)) | 63 | (when (not (display-images-p)) |
| 64 | (error "Your Emacs version (%S) doesn't support in-line images, | 64 | (error "Your Emacs version (%S) doesn't support in-line images, |
| 65 | was not compiled with image support or is run in console mode. | 65 | was not compiled with image support or is run in console mode. |
| 66 | Upgrade to Emacs 21.1 or newer, compile it with image support | 66 | Upgrade to Emacs 21.1 or newer, compile it with image support |
| 67 | or use a window-system" | 67 | or use a window-system" |
| 68 | emacs-version)) | 68 | emacs-version)) |
| 69 | 69 | ||
| 70 | ;; CUSTOMIZATIONS | 70 | ;; CUSTOMIZATIONS |
| @@ -148,26 +148,26 @@ see some of your images." | |||
| 148 | :group 'thumbs) | 148 | :group 'thumbs) |
| 149 | 149 | ||
| 150 | ;; Initialize some variable, for later use. | 150 | ;; Initialize some variable, for later use. |
| 151 | (defvar thumbs-temp-file | 151 | (defvar thumbs-temp-file |
| 152 | (concat thumbs-temp-dir thumbs-temp-prefix) | 152 | (concat thumbs-temp-dir thumbs-temp-prefix) |
| 153 | "Temporary filesname for images.") | 153 | "Temporary filesname for images.") |
| 154 | 154 | ||
| 155 | (defvar thumbs-current-tmp-filename | 155 | (defvar thumbs-current-tmp-filename |
| 156 | nil | 156 | nil |
| 157 | "Temporary filename of current image.") | 157 | "Temporary filename of current image.") |
| 158 | (defvar thumbs-current-image-filename | 158 | (defvar thumbs-current-image-filename |
| 159 | nil | 159 | nil |
| 160 | "Filename of current image.") | 160 | "Filename of current image.") |
| 161 | (defvar thumbs-current-image-size | 161 | (defvar thumbs-current-image-size |
| 162 | nil | 162 | nil |
| 163 | "Size of current image.") | 163 | "Size of current image.") |
| 164 | (defvar thumbs-image-num | 164 | (defvar thumbs-image-num |
| 165 | nil | 165 | nil |
| 166 | "Number of current image.") | 166 | "Number of current image.") |
| 167 | (defvar thumbs-current-dir | 167 | (defvar thumbs-current-dir |
| 168 | nil | 168 | nil |
| 169 | "Current directory.") | 169 | "Current directory.") |
| 170 | (defvar thumbs-markedL | 170 | (defvar thumbs-markedL |
| 171 | nil | 171 | nil |
| 172 | "List of marked files.") | 172 | "List of marked files.") |
| 173 | 173 | ||
| @@ -187,14 +187,7 @@ see some of your images." | |||
| 187 | "Execute FORMS; if anz error occurs, return nil. | 187 | "Execute FORMS; if anz error occurs, return nil. |
| 188 | Otherwise, return result of last FORM." | 188 | Otherwise, return result of last FORM." |
| 189 | (let ((err (thumbs-gensym))) | 189 | (let ((err (thumbs-gensym))) |
| 190 | (list 'condition-case err (cons 'progn body) '(error nil))))) | 190 | (list 'condition-case err (cons 'progn body) '(error nil))))) |
| 191 | |||
| 192 | (when (not (fboundp 'time-less-p)) | ||
| 193 | (defun time-less-p (t1 t2) | ||
| 194 | "Say whether time T1 is less than time T2." | ||
| 195 | (or (< (car t1) (car t2)) | ||
| 196 | (and (= (car t1) (car t2)) | ||
| 197 | (< (nth 1 t1) (nth 1 t2)))))) | ||
| 198 | 191 | ||
| 199 | (when (not (fboundp 'caddar)) | 192 | (when (not (fboundp 'caddar)) |
| 200 | (defun caddar (x) | 193 | (defun caddar (x) |
| @@ -208,7 +201,7 @@ Otherwise, return result of last FORM." | |||
| 208 | The name is made by appending a number to PREFIX, default \"Thumbs\"." | 201 | The name is made by appending a number to PREFIX, default \"Thumbs\"." |
| 209 | (let ((prefix (if (stringp arg) arg "Thumbs")) | 202 | (let ((prefix (if (stringp arg) arg "Thumbs")) |
| 210 | (num (if (integerp arg) arg | 203 | (num (if (integerp arg) arg |
| 211 | (prog1 | 204 | (prog1 |
| 212 | thumbs-gensym-counter | 205 | thumbs-gensym-counter |
| 213 | (setq thumbs-gensym-counter (1+ thumbs-gensym-counter)))))) | 206 | (setq thumbs-gensym-counter (1+ thumbs-gensym-counter)))))) |
| 214 | (make-symbol (format "%s%d" prefix num)))) | 207 | (make-symbol (format "%s%d" prefix num)))) |
| @@ -274,7 +267,7 @@ ACTION-PREFIX is the symbol to place before the ACTION command | |||
| 274 | thumbs-image-resizing-step) | 267 | thumbs-image-resizing-step) |
| 275 | (thumbs-increment-image-size-element (cdr s) | 268 | (thumbs-increment-image-size-element (cdr s) |
| 276 | thumbs-image-resizing-step))) | 269 | thumbs-image-resizing-step))) |
| 277 | 270 | ||
| 278 | (defun thumbs-decrement-image-size (s) | 271 | (defun thumbs-decrement-image-size (s) |
| 279 | "Decrement S (a cons of width x heigh)." | 272 | "Decrement S (a cons of width x heigh)." |
| 280 | (cons | 273 | (cons |
| @@ -289,7 +282,7 @@ if INCREMENT is set, make the image bigger, else smaller. | |||
| 289 | Or, alternatively, a SIZE may be specified." | 282 | Or, alternatively, a SIZE may be specified." |
| 290 | (interactive) | 283 | (interactive) |
| 291 | ;; cleaning of old temp file | 284 | ;; cleaning of old temp file |
| 292 | (ignore-errors | 285 | (ignore-errors |
| 293 | (apply 'delete-file | 286 | (apply 'delete-file |
| 294 | (directory-files | 287 | (directory-files |
| 295 | thumbs-temp-dir t | 288 | thumbs-temp-dir t |
| @@ -315,7 +308,7 @@ Or, alternatively, a SIZE may be specified." | |||
| 315 | "Resize Image interactively to specified WIDTH and HEIGHT." | 308 | "Resize Image interactively to specified WIDTH and HEIGHT." |
| 316 | (interactive "nWidth: \nnHeight: ") | 309 | (interactive "nWidth: \nnHeight: ") |
| 317 | (thumbs-resize-image nil (cons width height))) | 310 | (thumbs-resize-image nil (cons width height))) |
| 318 | 311 | ||
| 319 | (defun thumbs-resize-image-size-down () | 312 | (defun thumbs-resize-image-size-down () |
| 320 | "Resize image (smaller)." | 313 | "Resize image (smaller)." |
| 321 | (interactive) | 314 | (interactive) |
| @@ -356,7 +349,7 @@ Return the resulting (new) string. -- (defun borowed to Dave Love)" | |||
| 356 | (not (equal (thumbs-file-size tn) thumbs-geometry))) | 349 | (not (equal (thumbs-file-size tn) thumbs-geometry))) |
| 357 | (thumbs-call-convert fn tn "sample" thumbs-geometry)) | 350 | (thumbs-call-convert fn tn "sample" thumbs-geometry)) |
| 358 | tn)) | 351 | tn)) |
| 359 | 352 | ||
| 360 | (defun thumbs-image-type (img) | 353 | (defun thumbs-image-type (img) |
| 361 | "Return image type from filename IMG." | 354 | "Return image type from filename IMG." |
| 362 | (cond ((string-match ".*\\.jpe?g\\'" img) 'jpeg) | 355 | (cond ((string-match ".*\\.jpe?g\\'" img) 'jpeg) |
| @@ -372,7 +365,7 @@ Return the resulting (new) string. -- (defun borowed to Dave Love)" | |||
| 372 | (concat (number-to-string (round (car i))) | 365 | (concat (number-to-string (round (car i))) |
| 373 | "x" | 366 | "x" |
| 374 | (number-to-string (round (cdr i)))))) | 367 | (number-to-string (round (cdr i)))))) |
| 375 | 368 | ||
| 376 | ;;;###autoload | 369 | ;;;###autoload |
| 377 | (defun thumbs-find-thumb (img) | 370 | (defun thumbs-find-thumb (img) |
| 378 | "Display the thumbnail for IMG." | 371 | "Display the thumbnail for IMG." |
| @@ -453,7 +446,7 @@ and SAME-WINDOW to show thumbs in the same window." | |||
| 453 | (defalias 'thumbs 'thumbs-show-all-from-dir) | 446 | (defalias 'thumbs 'thumbs-show-all-from-dir) |
| 454 | 447 | ||
| 455 | (defun thumbs-find-image (img L &optional num otherwin) | 448 | (defun thumbs-find-image (img L &optional num otherwin) |
| 456 | (funcall | 449 | (funcall |
| 457 | (if otherwin 'switch-to-buffer-other-window 'switch-to-buffer) | 450 | (if otherwin 'switch-to-buffer-other-window 'switch-to-buffer) |
| 458 | (concat "*Image: " (file-name-nondirectory img) " - " | 451 | (concat "*Image: " (file-name-nondirectory img) " - " |
| 459 | (number-to-string (or num 0)) "*")) | 452 | (number-to-string (or num 0)) "*")) |
| @@ -494,7 +487,7 @@ Open another window." | |||
| 494 | (shell-quote-argument (expand-file-name img)) | 487 | (shell-quote-argument (expand-file-name img)) |
| 495 | thumbs-setroot-command nil t)) | 488 | thumbs-setroot-command nil t)) |
| 496 | (run-hooks 'thumbs-after-setroot-hook)) | 489 | (run-hooks 'thumbs-after-setroot-hook)) |
| 497 | 490 | ||
| 498 | (defun thumbs-set-image-at-point-to-root-window () | 491 | (defun thumbs-set-image-at-point-to-root-window () |
| 499 | "Set the image at point as the desktop wallpaper." | 492 | "Set the image at point as the desktop wallpaper." |
| 500 | (interactive) | 493 | (interactive) |
| @@ -569,7 +562,7 @@ Open another window." | |||
| 569 | (delete-region (point-min)(point-max)) | 562 | (delete-region (point-min)(point-max)) |
| 570 | (thumbs-do-thumbs-insertion (reverse (mapcar 'cdr thumbs-fileL))) | 563 | (thumbs-do-thumbs-insertion (reverse (mapcar 'cdr thumbs-fileL))) |
| 571 | (goto-char (1+ p)))) | 564 | (goto-char (1+ p)))) |
| 572 | 565 | ||
| 573 | (defun thumbs-mark () | 566 | (defun thumbs-mark () |
| 574 | "Mark the image at point." | 567 | "Mark the image at point." |
| 575 | (interactive) | 568 | (interactive) |
| @@ -578,7 +571,7 @@ Open another window." | |||
| 578 | (delete-char 1) | 571 | (delete-char 1) |
| 579 | (thumbs-insert-thumb (cdr (assoc (point) thumbs-fileL)) t)) | 572 | (thumbs-insert-thumb (cdr (assoc (point) thumbs-fileL)) t)) |
| 580 | (when (eolp)(forward-char))) | 573 | (when (eolp)(forward-char))) |
| 581 | 574 | ||
| 582 | ;; Image modification routines | 575 | ;; Image modification routines |
| 583 | 576 | ||
| 584 | (defun thumbs-modify-image (action &optional arg) | 577 | (defun thumbs-modify-image (action &optional arg) |
diff --git a/lisp/type-break.el b/lisp/type-break.el index 26ac7f87ecb..253e1406f06 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el | |||
| @@ -30,10 +30,10 @@ | |||
| 30 | ;; The docstring for the function `type-break-mode' summarizes most of the | 30 | ;; The docstring for the function `type-break-mode' summarizes most of the |
| 31 | ;; details of the interface. | 31 | ;; details of the interface. |
| 32 | 32 | ||
| 33 | ;; This package relies on the assumption that you live entirely in emacs, | 33 | ;; This package relies on the assumption that you live entirely in Emacs, |
| 34 | ;; as the author does. If that's not the case for you (e.g. you often | 34 | ;; as the author does. If that's not the case for you (e.g. you often |
| 35 | ;; suspend emacs or work in other windows) then this won't help very much; | 35 | ;; suspend Emacs or work in other windows) then this won't help very much; |
| 36 | ;; it will depend on just how often you switch back to emacs. At the very | 36 | ;; it will depend on just how often you switch back to Emacs. At the very |
| 37 | ;; least, you will want to turn off the keystroke thresholds and rest | 37 | ;; least, you will want to turn off the keystroke thresholds and rest |
| 38 | ;; interval tracking. | 38 | ;; interval tracking. |
| 39 | 39 | ||
| @@ -95,7 +95,7 @@ use either \\[customize] or the function `type-break-mode'." | |||
| 95 | (defcustom type-break-good-rest-interval (/ type-break-interval 6) | 95 | (defcustom type-break-good-rest-interval (/ type-break-interval 6) |
| 96 | "*Number of seconds of idle time considered to be an adequate typing rest. | 96 | "*Number of seconds of idle time considered to be an adequate typing rest. |
| 97 | 97 | ||
| 98 | When this variable is non-nil, emacs checks the idle time between | 98 | When this variable is non-nil, Emacs checks the idle time between |
| 99 | keystrokes. If this idle time is long enough to be considered a \"good\" | 99 | keystrokes. If this idle time is long enough to be considered a \"good\" |
| 100 | rest from typing, then the next typing break is simply rescheduled for later. | 100 | rest from typing, then the next typing break is simply rescheduled for later. |
| 101 | 101 | ||
| @@ -105,6 +105,17 @@ asked whether or not really to interrupt the break." | |||
| 105 | :group 'type-break) | 105 | :group 'type-break) |
| 106 | 106 | ||
| 107 | ;;;###autoload | 107 | ;;;###autoload |
| 108 | (defcustom type-break-good-break-interval nil | ||
| 109 | "*Number of seconds considered to be an adequate explicit typing rest. | ||
| 110 | |||
| 111 | When this variable is non-nil, its value is considered to be a \"good\" | ||
| 112 | length (in seconds) for a break initiated by the command `type-break', | ||
| 113 | overriding `type-break-good-rest-interval'. This provides querying of | ||
| 114 | break interruptions when `type-break-good-rest-interval' is nil." | ||
| 115 | :type 'integer | ||
| 116 | :group 'type-break) | ||
| 117 | |||
| 118 | ;;;###autoload | ||
| 108 | (defcustom type-break-keystroke-threshold | 119 | (defcustom type-break-keystroke-threshold |
| 109 | ;; Assuming typing speed is 35wpm (on the average, do you really | 120 | ;; Assuming typing speed is 35wpm (on the average, do you really |
| 110 | ;; type more than that in a minute? I spend a lot of time reading mail | 121 | ;; type more than that in a minute? I spend a lot of time reading mail |
| @@ -200,15 +211,30 @@ Format specifiers are as used by `format-time-string'." | |||
| 200 | '(type-break-demo-boring type-break-demo-life type-break-demo-hanoi) | 211 | '(type-break-demo-boring type-break-demo-life type-break-demo-hanoi) |
| 201 | "*List of functions to consider running as demos during typing breaks. | 212 | "*List of functions to consider running as demos during typing breaks. |
| 202 | When a typing break begins, one of these functions is selected randomly | 213 | When a typing break begins, one of these functions is selected randomly |
| 203 | to have emacs do something interesting. | 214 | to have Emacs do something interesting. |
| 204 | 215 | ||
| 205 | Any function in this list should start a demo which ceases as soon as a | 216 | Any function in this list should start a demo which ceases as soon as a |
| 206 | key is pressed." | 217 | key is pressed." |
| 207 | :type '(repeat function) | 218 | :type '(repeat function) |
| 208 | :group 'type-break) | 219 | :group 'type-break) |
| 209 | 220 | ||
| 221 | (defcustom type-break-demo-boring-stats nil | ||
| 222 | "*Show word per minute and keystroke figures in the Boring demo." | ||
| 223 | :type 'boolean | ||
| 224 | :group 'type-break) | ||
| 225 | |||
| 226 | (defcustom type-break-terse-messages nil | ||
| 227 | "*Use slightly terser messages." | ||
| 228 | :type 'boolean | ||
| 229 | :group 'type-break) | ||
| 230 | |||
| 231 | (defcustom type-break-file-name (convert-standard-filename "~/.type-break") | ||
| 232 | "*Name of file used to save state across sessions." | ||
| 233 | :type 'file | ||
| 234 | :group 'type-break) | ||
| 235 | |||
| 210 | (defvar type-break-post-command-hook '(type-break-check) | 236 | (defvar type-break-post-command-hook '(type-break-check) |
| 211 | "Hook run indirectly by post-command-hook for typing break functions. | 237 | "Hook run indirectly by `post-command-hook' for typing break functions. |
| 212 | This is not really intended to be set by the user, but it's probably | 238 | This is not really intended to be set by the user, but it's probably |
| 213 | harmless to do so. Mainly it is used by various parts of the typing break | 239 | harmless to do so. Mainly it is used by various parts of the typing break |
| 214 | program to delay actions until after the user has completed some command. | 240 | program to delay actions until after the user has completed some command. |
| @@ -257,7 +283,7 @@ See also `type-break-mode-line-format' and its members." | |||
| 257 | 283 | ||
| 258 | This variable, in conjunction with `type-break-warning-countdown-string-type' | 284 | This variable, in conjunction with `type-break-warning-countdown-string-type' |
| 259 | \(which indicates whether this value is a number of keystrokes or seconds) | 285 | \(which indicates whether this value is a number of keystrokes or seconds) |
| 260 | is installed in mode-line-format to notify of imminent typing breaks.") | 286 | is installed in `mode-line-format' to notify of imminent typing breaks.") |
| 261 | 287 | ||
| 262 | (defvar type-break-warning-countdown-string-type nil | 288 | (defvar type-break-warning-countdown-string-type nil |
| 263 | "Indicates the unit type of `type-break-warning-countdown-string'. | 289 | "Indicates the unit type of `type-break-warning-countdown-string'. |
| @@ -275,6 +301,8 @@ It will be either \"seconds\" or \"keystrokes\".") | |||
| 275 | (defvar type-break-current-keystroke-warning-interval nil) | 301 | (defvar type-break-current-keystroke-warning-interval nil) |
| 276 | (defvar type-break-time-warning-count 0) | 302 | (defvar type-break-time-warning-count 0) |
| 277 | (defvar type-break-keystroke-warning-count 0) | 303 | (defvar type-break-keystroke-warning-count 0) |
| 304 | (defvar type-break-interval-start nil) | ||
| 305 | |||
| 278 | 306 | ||
| 279 | ;;;###autoload | 307 | ;;;###autoload |
| 280 | (defun type-break-mode (&optional prefix) | 308 | (defun type-break-mode (&optional prefix) |
| @@ -284,7 +312,7 @@ This is a minor mode, but it is global to all buffers by default. | |||
| 284 | When this mode is enabled, the user is encouraged to take typing breaks at | 312 | When this mode is enabled, the user is encouraged to take typing breaks at |
| 285 | appropriate intervals; either after a specified amount of time or when the | 313 | appropriate intervals; either after a specified amount of time or when the |
| 286 | user has exceeded a keystroke threshold. When the time arrives, the user | 314 | user has exceeded a keystroke threshold. When the time arrives, the user |
| 287 | is asked to take a break. If the user refuses at that time, emacs will ask | 315 | is asked to take a break. If the user refuses at that time, Emacs will ask |
| 288 | again in a short period of time. The idea is to give the user enough time | 316 | again in a short period of time. The idea is to give the user enough time |
| 289 | to find a good breaking point in his or her work, but be sufficiently | 317 | to find a good breaking point in his or her work, but be sufficiently |
| 290 | annoying to discourage putting typing breaks off indefinitely. | 318 | annoying to discourage putting typing breaks off indefinitely. |
| @@ -309,9 +337,18 @@ affect the time schedule; it simply provides a default for the | |||
| 309 | If set, the variable `type-break-good-rest-interval' specifies the minimum | 337 | If set, the variable `type-break-good-rest-interval' specifies the minimum |
| 310 | amount of time which is considered a reasonable typing break. Whenever | 338 | amount of time which is considered a reasonable typing break. Whenever |
| 311 | that time has elapsed, typing breaks are automatically rescheduled for | 339 | that time has elapsed, typing breaks are automatically rescheduled for |
| 312 | later even if emacs didn't prompt you to take one first. Also, if a break | 340 | later even if Emacs didn't prompt you to take one first. Also, if a break |
| 313 | is ended before this much time has elapsed, the user will be asked whether | 341 | is ended before this much time has elapsed, the user will be asked whether |
| 314 | or not to continue. | 342 | or not to continue. A nil value for this variable prevents automatic |
| 343 | break rescheduling, making `type-break-interval' an upper bound on the time | ||
| 344 | between breaks. In this case breaks will be prompted for as usual before | ||
| 345 | the upper bound if the keystroke threshold is reached. | ||
| 346 | |||
| 347 | If `type-break-good-rest-interval' is nil and | ||
| 348 | `type-break-good-break-interval' is set, then confirmation is required to | ||
| 349 | interrupt a break before `type-break-good-break-interval' seconds | ||
| 350 | have passed. This provides for an upper bound on the time between breaks | ||
| 351 | together with confirmation of interruptions to these breaks. | ||
| 315 | 352 | ||
| 316 | The variable `type-break-keystroke-threshold' is used to determine the | 353 | The variable `type-break-keystroke-threshold' is used to determine the |
| 317 | thresholds at which typing breaks should be considered. You can use | 354 | thresholds at which typing breaks should be considered. You can use |
| @@ -335,7 +372,12 @@ a typing break occur. They include: | |||
| 335 | `type-break-query-function' | 372 | `type-break-query-function' |
| 336 | `type-break-query-interval' | 373 | `type-break-query-interval' |
| 337 | 374 | ||
| 338 | Finally, the command `type-break-statistics' prints interesting things." | 375 | The command `type-break-statistics' prints interesting things. |
| 376 | |||
| 377 | Finally, a file (named `type-break-file-name') is used to store information | ||
| 378 | across Emacs sessions. This provides recovery of the break status between | ||
| 379 | sessions and after a crash. Manual changes to the file may result in | ||
| 380 | problems." | ||
| 339 | (interactive "P") | 381 | (interactive "P") |
| 340 | (type-break-check-post-command-hook) | 382 | (type-break-check-post-command-hook) |
| 341 | 383 | ||
| @@ -356,13 +398,52 @@ Finally, the command `type-break-statistics' prints interesting things." | |||
| 356 | minor-mode-alist))) | 398 | minor-mode-alist))) |
| 357 | (type-break-keystroke-reset) | 399 | (type-break-keystroke-reset) |
| 358 | (type-break-mode-line-countdown-or-break nil) | 400 | (type-break-mode-line-countdown-or-break nil) |
| 359 | (type-break-schedule) | 401 | |
| 402 | (if (boundp 'save-some-buffers-always) | ||
| 403 | (add-to-list 'save-some-buffers-always | ||
| 404 | (expand-file-name type-break-file-name))) | ||
| 405 | |||
| 406 | (setq type-break-time-last-break (type-break-get-previous-time)) | ||
| 407 | |||
| 408 | ;; schedule according to break time from session file | ||
| 409 | (type-break-schedule | ||
| 410 | (let (diff) | ||
| 411 | (if (and type-break-time-last-break | ||
| 412 | (< (setq diff (type-break-time-difference | ||
| 413 | type-break-time-last-break | ||
| 414 | (current-time))) | ||
| 415 | type-break-interval)) | ||
| 416 | ;; use the file's value | ||
| 417 | (progn | ||
| 418 | (setq type-break-keystroke-count | ||
| 419 | (type-break-get-previous-count)) | ||
| 420 | ;; file the time, in case it was read from the auto-save file | ||
| 421 | (type-break-file-time type-break-interval-start) | ||
| 422 | (setq type-break-interval-start type-break-time-last-break) | ||
| 423 | (- type-break-interval diff)) | ||
| 424 | ;; schedule from now | ||
| 425 | (setq type-break-interval-start (current-time)) | ||
| 426 | (type-break-file-time type-break-interval-start) | ||
| 427 | type-break-interval)) | ||
| 428 | type-break-interval-start | ||
| 429 | type-break-interval) | ||
| 430 | |||
| 360 | (and (interactive-p) | 431 | (and (interactive-p) |
| 361 | (message "Type Break mode is enabled and reset"))) | 432 | (message "Type Break mode is enabled and set"))) |
| 362 | (t | 433 | (t |
| 363 | (type-break-keystroke-reset) | 434 | (type-break-keystroke-reset) |
| 364 | (type-break-mode-line-countdown-or-break nil) | 435 | (type-break-mode-line-countdown-or-break nil) |
| 365 | (type-break-cancel-schedule) | 436 | (type-break-cancel-schedule) |
| 437 | (do-auto-save) | ||
| 438 | (with-current-buffer (find-file-noselect type-break-file-name | ||
| 439 | 'nowarn) | ||
| 440 | (set-buffer-modified-p nil) | ||
| 441 | (unlock-buffer) | ||
| 442 | (kill-this-buffer)) | ||
| 443 | (if (boundp 'save-some-buffers-always) | ||
| 444 | (setq save-some-buffers-always | ||
| 445 | (remove (expand-file-name type-break-file-name) | ||
| 446 | save-some-buffers-always))) | ||
| 366 | (and (interactive-p) | 447 | (and (interactive-p) |
| 367 | (message "Type Break mode is disabled"))))) | 448 | (message "Type Break mode is disabled"))))) |
| 368 | type-break-mode) | 449 | type-break-mode) |
| @@ -370,7 +451,7 @@ Finally, the command `type-break-statistics' prints interesting things." | |||
| 370 | (defun type-break-mode-line-message-mode (&optional prefix) | 451 | (defun type-break-mode-line-message-mode (&optional prefix) |
| 371 | "Enable or disable warnings in the mode line about typing breaks. | 452 | "Enable or disable warnings in the mode line about typing breaks. |
| 372 | 453 | ||
| 373 | A negative prefix argument disables this mode. | 454 | A negative PREFIX argument disables this mode. |
| 374 | No argument or any non-negative argument enables it. | 455 | No argument or any non-negative argument enables it. |
| 375 | 456 | ||
| 376 | The user may also enable or disable this mode simply by setting the | 457 | The user may also enable or disable this mode simply by setting the |
| @@ -398,7 +479,7 @@ When enabled, the user is periodically queried about whether to take a | |||
| 398 | typing break at that moment. The function which does this query is | 479 | typing break at that moment. The function which does this query is |
| 399 | specified by the variable `type-break-query-function'. | 480 | specified by the variable `type-break-query-function'. |
| 400 | 481 | ||
| 401 | A negative prefix argument disables this mode. | 482 | A negative PREFIX argument disables this mode. |
| 402 | No argument or any non-negative argument enables it. | 483 | No argument or any non-negative argument enables it. |
| 403 | 484 | ||
| 404 | The user may also enable or disable this mode simply by setting the | 485 | The user may also enable or disable this mode simply by setting the |
| @@ -413,6 +494,89 @@ variable of the same name." | |||
| 413 | type-break-query-mode) | 494 | type-break-query-mode) |
| 414 | 495 | ||
| 415 | 496 | ||
| 497 | ;;; session file functions | ||
| 498 | |||
| 499 | (defvar type-break-auto-save-file-name | ||
| 500 | (let ((buffer-file-name type-break-file-name)) | ||
| 501 | (make-auto-save-file-name)) | ||
| 502 | "Auto-save name of `type-break-file-name'.") | ||
| 503 | |||
| 504 | (defun type-break-file-time (&optional time) | ||
| 505 | "File break time in `type-break-file-name', unless the file is locked." | ||
| 506 | (if (not (stringp (file-locked-p type-break-file-name))) | ||
| 507 | (with-current-buffer (find-file-noselect type-break-file-name | ||
| 508 | 'nowarn) | ||
| 509 | (let ((inhibit-read-only t)) | ||
| 510 | (erase-buffer) | ||
| 511 | (insert (format "%s\n\n" (or time type-break-interval-start))) | ||
| 512 | ;; file saving is left to auto-save | ||
| 513 | )))) | ||
| 514 | |||
| 515 | (defun type-break-file-keystroke-count () | ||
| 516 | "File keystroke count in `type-break-file-name', unless the file is locked." | ||
| 517 | (if (not (stringp (file-locked-p type-break-file-name))) | ||
| 518 | (with-current-buffer (find-file-noselect type-break-file-name | ||
| 519 | 'nowarn) | ||
| 520 | (save-excursion | ||
| 521 | (let ((inhibit-read-only t)) | ||
| 522 | (goto-char (point-min)) | ||
| 523 | (forward-line) | ||
| 524 | (delete-region (point) (save-excursion (end-of-line) (point))) | ||
| 525 | (insert (format "%s" type-break-keystroke-count)) | ||
| 526 | ;; file saving is left to auto-save | ||
| 527 | ))))) | ||
| 528 | |||
| 529 | (defun timep (time) | ||
| 530 | "If TIME is in the format returned by `current-time' then | ||
| 531 | return TIME, else return nil." | ||
| 532 | (and (listp time) | ||
| 533 | (eq (length time) 3) | ||
| 534 | (integerp (car time)) | ||
| 535 | (integerp (nth 1 time)) | ||
| 536 | (integerp (nth 2 time)) | ||
| 537 | time)) | ||
| 538 | |||
| 539 | (defun type-break-choose-file () | ||
| 540 | "Return file to read from." | ||
| 541 | (cond | ||
| 542 | ((and (file-exists-p type-break-auto-save-file-name) | ||
| 543 | (file-readable-p type-break-auto-save-file-name)) | ||
| 544 | type-break-auto-save-file-name) | ||
| 545 | ((and (file-exists-p type-break-file-name) | ||
| 546 | (file-readable-p type-break-file-name)) | ||
| 547 | type-break-file-name) | ||
| 548 | (t nil))) | ||
| 549 | |||
| 550 | (defun type-break-get-previous-time () | ||
| 551 | "Get previous break time from `type-break-file-name'. | ||
| 552 | Returns nil if the file is missing or if the time breaks with the | ||
| 553 | `current-time' format." | ||
| 554 | (let ((file (type-break-choose-file))) | ||
| 555 | (if file | ||
| 556 | (timep ;; returns expected format, else nil | ||
| 557 | (with-current-buffer (find-file-noselect file 'nowarn) | ||
| 558 | (save-excursion | ||
| 559 | (goto-char (point-min)) | ||
| 560 | (read (current-buffer)))))))) | ||
| 561 | |||
| 562 | (defun type-break-get-previous-count () | ||
| 563 | "Get previous keystroke count from `type-break-file-name'. | ||
| 564 | Return 0 if the file is missing or if the form read is not an | ||
| 565 | integer." | ||
| 566 | (let ((file (type-break-choose-file))) | ||
| 567 | (if (and file | ||
| 568 | (integerp | ||
| 569 | (setq file | ||
| 570 | (with-current-buffer | ||
| 571 | (find-file-noselect file 'nowarn) | ||
| 572 | (save-excursion | ||
| 573 | (goto-char (point-min)) | ||
| 574 | (forward-line 1) | ||
| 575 | (read (current-buffer))))))) | ||
| 576 | file | ||
| 577 | 0))) | ||
| 578 | |||
| 579 | |||
| 416 | ;;;###autoload | 580 | ;;;###autoload |
| 417 | (defun type-break () | 581 | (defun type-break () |
| 418 | "Take a typing break. | 582 | "Take a typing break. |
| @@ -425,6 +589,8 @@ as per the function `type-break-schedule'." | |||
| 425 | (interactive) | 589 | (interactive) |
| 426 | (do-auto-save) | 590 | (do-auto-save) |
| 427 | (type-break-cancel-schedule) | 591 | (type-break-cancel-schedule) |
| 592 | ;; remove any query scheduled during interactive invocation | ||
| 593 | (remove-hook 'type-break-post-command-hook 'type-break-do-query) | ||
| 428 | (let ((continue t) | 594 | (let ((continue t) |
| 429 | (start-time (current-time))) | 595 | (start-time (current-time))) |
| 430 | (setq type-break-time-last-break start-time) | 596 | (setq type-break-time-last-break start-time) |
| @@ -435,7 +601,8 @@ as per the function `type-break-schedule'." | |||
| 435 | (other-window 1)) | 601 | (other-window 1)) |
| 436 | (delete-other-windows) | 602 | (delete-other-windows) |
| 437 | (scroll-right (window-width)) | 603 | (scroll-right (window-width)) |
| 438 | (message "Press any key to resume from typing break.") | 604 | (unless type-break-terse-messages |
| 605 | (message "Press any key to resume from typing break.")) | ||
| 439 | 606 | ||
| 440 | (random t) | 607 | (random t) |
| 441 | (let* ((len (length type-break-demo-functions)) | 608 | (let* ((len (length type-break-demo-functions)) |
| @@ -445,36 +612,45 @@ as per the function `type-break-schedule'." | |||
| 445 | (funcall fn) | 612 | (funcall fn) |
| 446 | (error nil)))) | 613 | (error nil)))) |
| 447 | 614 | ||
| 448 | (cond | 615 | (let ((good-interval (or type-break-good-rest-interval |
| 449 | (type-break-good-rest-interval | 616 | type-break-good-break-interval))) |
| 450 | (let ((break-secs (type-break-time-difference | 617 | (cond |
| 451 | start-time (current-time)))) | 618 | (good-interval |
| 452 | (cond | 619 | (let ((break-secs (type-break-time-difference |
| 453 | ((>= break-secs type-break-good-rest-interval) | 620 | start-time (current-time)))) |
| 454 | (setq continue nil)) | 621 | (cond |
| 455 | ;; 60 seconds may be too much leeway if the break is only 3 | 622 | ((>= break-secs good-interval) |
| 456 | ;; minutes to begin with. You can just say "no" to the query | 623 | (setq continue nil)) |
| 457 | ;; below if you're in that much of a hurry. | 624 | ;; 60 seconds may be too much leeway if the break is only 3 |
| 458 | ;((> 60 (abs (- break-secs type-break-good-rest-interval))) | 625 | ;; minutes to begin with. You can just say "no" to the query |
| 459 | ; (setq continue nil)) | 626 | ;; below if you're in that much of a hurry. |
| 460 | ((funcall | 627 | ;;((> 60 (abs (- break-secs good-interval))) |
| 461 | type-break-query-function | 628 | ;; (setq continue nil)) |
| 462 | (format "%sYou really ought to rest %s more. Continue break? " | 629 | ((funcall |
| 463 | (type-break-time-stamp) | 630 | type-break-query-function |
| 464 | (type-break-format-time (- type-break-good-rest-interval | 631 | (format |
| 465 | break-secs))))) | 632 | (if type-break-terse-messages |
| 466 | (t | 633 | "%s%s remaining. Continue break? " |
| 467 | (setq continue nil))))) | 634 | "%sYou really ought to rest %s more. Continue break? ") |
| 468 | (t (setq continue nil))))) | 635 | (type-break-time-stamp) |
| 636 | (type-break-format-time (- good-interval | ||
| 637 | break-secs))))) | ||
| 638 | (t | ||
| 639 | (setq continue nil))))) | ||
| 640 | (t (setq continue nil)))))) | ||
| 469 | 641 | ||
| 470 | (type-break-keystroke-reset) | 642 | (type-break-keystroke-reset) |
| 643 | (type-break-file-time) | ||
| 471 | (type-break-mode-line-countdown-or-break nil) | 644 | (type-break-mode-line-countdown-or-break nil) |
| 472 | (type-break-schedule)) | 645 | (type-break-schedule)) |
| 473 | 646 | ||
| 474 | 647 | ||
| 475 | (defun type-break-schedule (&optional time) | 648 | (defun type-break-schedule (&optional time start interval) |
| 476 | "Schedule a typing break for TIME seconds from now. | 649 | "Schedule a typing break for TIME seconds from now. |
| 477 | If time is not specified, default to `type-break-interval'." | 650 | If time is not specified it defaults to `type-break-interval'. |
| 651 | START and INTERVAL are used when recovering a break. | ||
| 652 | START is the start of the break (defaults to now). | ||
| 653 | INTERVAL is the full length of an interval (defaults to TIME)." | ||
| 478 | (interactive (list (and current-prefix-arg | 654 | (interactive (list (and current-prefix-arg |
| 479 | (prefix-numeric-value current-prefix-arg)))) | 655 | (prefix-numeric-value current-prefix-arg)))) |
| 480 | (or time (setq time type-break-interval)) | 656 | (or time (setq time type-break-interval)) |
| @@ -483,7 +659,8 @@ If time is not specified, default to `type-break-interval'." | |||
| 483 | (type-break-time-warning-schedule time 'reset) | 659 | (type-break-time-warning-schedule time 'reset) |
| 484 | (type-break-run-at-time (max 1 time) nil 'type-break-alarm) | 660 | (type-break-run-at-time (max 1 time) nil 'type-break-alarm) |
| 485 | (setq type-break-time-next-break | 661 | (setq type-break-time-next-break |
| 486 | (type-break-time-sum (current-time) time))) | 662 | (type-break-time-sum (or start (current-time)) |
| 663 | (or interval time)))) | ||
| 487 | 664 | ||
| 488 | (defun type-break-cancel-schedule () | 665 | (defun type-break-cancel-schedule () |
| 489 | (type-break-cancel-time-warning-schedule) | 666 | (type-break-cancel-time-warning-schedule) |
| @@ -532,6 +709,7 @@ If time is not specified, default to `type-break-interval'." | |||
| 532 | (remove-hook 'type-break-post-command-hook 'type-break-time-warning) | 709 | (remove-hook 'type-break-post-command-hook 'type-break-time-warning) |
| 533 | (setq type-break-current-time-warning-interval | 710 | (setq type-break-current-time-warning-interval |
| 534 | type-break-time-warning-intervals) | 711 | type-break-time-warning-intervals) |
| 712 | (setq type-break-time-warning-count 0) ; avoid warnings after break | ||
| 535 | (setq type-break-warning-countdown-string nil)) | 713 | (setq type-break-warning-countdown-string nil)) |
| 536 | 714 | ||
| 537 | (defun type-break-alarm () | 715 | (defun type-break-alarm () |
| @@ -556,6 +734,7 @@ If time is not specified, default to `type-break-interval'." | |||
| 556 | This may be the case either because the scheduled time has come \(and the | 734 | This may be the case either because the scheduled time has come \(and the |
| 557 | minimum keystroke threshold has been reached\) or because the maximum | 735 | minimum keystroke threshold has been reached\) or because the maximum |
| 558 | keystroke threshold has been exceeded." | 736 | keystroke threshold has been exceeded." |
| 737 | (type-break-file-keystroke-count) | ||
| 559 | (let* ((min-threshold (car type-break-keystroke-threshold)) | 738 | (let* ((min-threshold (car type-break-keystroke-threshold)) |
| 560 | (max-threshold (cdr type-break-keystroke-threshold))) | 739 | (max-threshold (cdr type-break-keystroke-threshold))) |
| 561 | (and type-break-good-rest-interval | 740 | (and type-break-good-rest-interval |
| @@ -657,16 +836,19 @@ keystroke threshold has been exceeded." | |||
| 657 | ;; from taking place before this one has even returned. | 836 | ;; from taking place before this one has even returned. |
| 658 | ;; The condition-case wrapper will reschedule on quit. | 837 | ;; The condition-case wrapper will reschedule on quit. |
| 659 | (type-break-cancel-schedule) | 838 | (type-break-cancel-schedule) |
| 839 | ;; Also prevent a second query when the break is interrupted. | ||
| 840 | (remove-hook 'type-break-post-command-hook 'type-break-do-query) | ||
| 660 | (funcall type-break-query-function | 841 | (funcall type-break-query-function |
| 661 | (format "%s%s" | 842 | (format "%s%s" |
| 662 | (type-break-time-stamp) | 843 | (type-break-time-stamp) |
| 663 | "Take a break from typing now? "))) | 844 | (if type-break-terse-messages |
| 845 | "Break now? " | ||
| 846 | "Take a break from typing now? ")))) | ||
| 664 | (type-break)) | 847 | (type-break)) |
| 665 | (t | 848 | (t |
| 666 | (type-break-schedule type-break-query-interval))) | 849 | (type-break-schedule type-break-query-interval))) |
| 667 | (quit | 850 | (quit |
| 668 | (type-break-schedule type-break-query-interval))) | 851 | (type-break-schedule type-break-query-interval)))))) |
| 669 | (remove-hook 'type-break-post-command-hook 'type-break-do-query)))) | ||
| 670 | 852 | ||
| 671 | (defun type-break-noninteractive-query (&optional ignored-args) | 853 | (defun type-break-noninteractive-query (&optional ignored-args) |
| 672 | "Null query function which doesn't interrupt user and assumes `no'. | 854 | "Null query function which doesn't interrupt user and assumes `no'. |
| @@ -810,7 +992,7 @@ based on a fairly simple algorithm involving assumptions about the average | |||
| 810 | length of words (5). For the minimum threshold, it uses about a fifth of | 992 | length of words (5). For the minimum threshold, it uses about a fifth of |
| 811 | the computed maximum threshold. | 993 | the computed maximum threshold. |
| 812 | 994 | ||
| 813 | When called from lisp programs, the optional args WORDLEN and FRAC can be | 995 | When called from Lisp programs, the optional args WORDLEN and FRAC can be |
| 814 | used to override the default assumption about average word length and the | 996 | used to override the default assumption about average word length and the |
| 815 | fraction of the maximum threshold to which to set the minimum threshold. | 997 | fraction of the maximum threshold to which to set the minimum threshold. |
| 816 | FRAC should be the inverse of the fractional value; for example, a value of | 998 | FRAC should be the inverse of the fractional value; for example, a value of |
| @@ -891,6 +1073,7 @@ FRAC should be the inverse of the fractional value; for example, a value of | |||
| 891 | (t (format "%d seconds" secs))))) | 1073 | (t (format "%d seconds" secs))))) |
| 892 | 1074 | ||
| 893 | (defun type-break-keystroke-reset () | 1075 | (defun type-break-keystroke-reset () |
| 1076 | (setq type-break-interval-start (current-time)) ; not a keystroke | ||
| 894 | (setq type-break-keystroke-count 0) | 1077 | (setq type-break-keystroke-count 0) |
| 895 | (setq type-break-keystroke-warning-count 0) | 1078 | (setq type-break-keystroke-warning-count 0) |
| 896 | (setq type-break-current-keystroke-warning-interval | 1079 | (setq type-break-current-keystroke-warning-interval |
| @@ -903,7 +1086,7 @@ With optional non-nil ALL, force redisplay of all mode-lines." | |||
| 903 | (and all (save-excursion (set-buffer (other-buffer)))) | 1086 | (and all (save-excursion (set-buffer (other-buffer)))) |
| 904 | (set-buffer-modified-p (buffer-modified-p))) | 1087 | (set-buffer-modified-p (buffer-modified-p))) |
| 905 | 1088 | ||
| 906 | ;; If an exception occurs in emacs while running the post command hook, the | 1089 | ;; If an exception occurs in Emacs while running the post command hook, the |
| 907 | ;; value of that hook is clobbered. This is because the value of the | 1090 | ;; value of that hook is clobbered. This is because the value of the |
| 908 | ;; variable is temporarily set to nil while it's running to prevent | 1091 | ;; variable is temporarily set to nil while it's running to prevent |
| 909 | ;; recursive application, but it also means an exception aborts the routine | 1092 | ;; recursive application, but it also means an exception aborts the routine |
| @@ -916,7 +1099,7 @@ With optional non-nil ALL, force redisplay of all mode-lines." | |||
| 916 | ;;; Timer wrapper functions | 1099 | ;;; Timer wrapper functions |
| 917 | ;;; | 1100 | ;;; |
| 918 | ;;; These shield type-break from variations in the interval timer packages | 1101 | ;;; These shield type-break from variations in the interval timer packages |
| 919 | ;;; for different versions of emacs. | 1102 | ;;; for different versions of Emacs. |
| 920 | 1103 | ||
| 921 | (defun type-break-run-at-time (time repeat function) | 1104 | (defun type-break-run-at-time (time repeat function) |
| 922 | (condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) | 1105 | (condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) |
| @@ -1002,44 +1185,83 @@ With optional non-nil ALL, force redisplay of all mode-lines." | |||
| 1002 | ;; Boring demo, but doesn't use many cycles | 1185 | ;; Boring demo, but doesn't use many cycles |
| 1003 | (defun type-break-demo-boring () | 1186 | (defun type-break-demo-boring () |
| 1004 | "Boring typing break demo." | 1187 | "Boring typing break demo." |
| 1005 | (let ((rmsg "Press any key to resume from typing break") | 1188 | (let ((rmsg (if type-break-terse-messages |
| 1189 | "" | ||
| 1190 | "Press any key to resume from typing break")) | ||
| 1006 | (buffer-name "*Typing Break Buffer*") | 1191 | (buffer-name "*Typing Break Buffer*") |
| 1007 | line col pos | 1192 | lines elapsed timeleft tmsg) |
| 1008 | elapsed timeleft tmsg) | ||
| 1009 | (condition-case () | 1193 | (condition-case () |
| 1010 | (progn | 1194 | (progn |
| 1011 | (switch-to-buffer (get-buffer-create buffer-name)) | 1195 | (switch-to-buffer (get-buffer-create buffer-name)) |
| 1012 | (buffer-disable-undo (current-buffer)) | 1196 | (buffer-disable-undo (current-buffer)) |
| 1013 | (erase-buffer) | 1197 | (setq lines (/ (window-body-height) 2)) |
| 1014 | (setq line (1+ (/ (window-height) 2))) | 1198 | (unless type-break-terse-messages (setq lines (1- lines))) |
| 1015 | (setq col (/ (- (window-width) (length rmsg)) 2)) | 1199 | (if type-break-demo-boring-stats |
| 1016 | (insert (make-string line ?\C-j) | 1200 | (setq lines (- lines 2))) |
| 1017 | (make-string col ?\ ) | 1201 | (setq lines (make-string lines ?\C-j)) |
| 1018 | rmsg) | ||
| 1019 | (forward-line -1) | ||
| 1020 | (beginning-of-line) | ||
| 1021 | (setq pos (point)) | ||
| 1022 | (while (not (input-pending-p)) | 1202 | (while (not (input-pending-p)) |
| 1023 | (delete-region pos (progn | 1203 | (erase-buffer) |
| 1024 | (goto-char pos) | ||
| 1025 | (end-of-line) | ||
| 1026 | (point))) | ||
| 1027 | (setq elapsed (type-break-time-difference | 1204 | (setq elapsed (type-break-time-difference |
| 1028 | type-break-time-last-break | 1205 | type-break-time-last-break |
| 1029 | (current-time))) | 1206 | (current-time))) |
| 1030 | (cond | 1207 | (let ((good-interval (or type-break-good-rest-interval |
| 1031 | (type-break-good-rest-interval | 1208 | type-break-good-break-interval))) |
| 1032 | (setq timeleft (- type-break-good-rest-interval elapsed)) | 1209 | (cond |
| 1033 | (if (> timeleft 0) | 1210 | (good-interval |
| 1034 | (setq tmsg (format "You should rest for %s more" | 1211 | (setq timeleft (- good-interval elapsed)) |
| 1035 | (type-break-format-time timeleft))) | 1212 | (if (> timeleft 0) |
| 1036 | (setq tmsg (format "Typing break has lasted %s" | 1213 | (setq tmsg |
| 1037 | (type-break-format-time elapsed))))) | 1214 | (format (if type-break-terse-messages |
| 1038 | (t | 1215 | "Break remaining: %s" |
| 1039 | (setq tmsg (format "Typing break has lasted %s" | 1216 | "You should rest for %s more") |
| 1040 | (type-break-format-time elapsed))))) | 1217 | (type-break-format-time timeleft))) |
| 1041 | (setq col (/ (- (window-width) (length tmsg)) 2)) | 1218 | (setq tmsg |
| 1042 | (insert (make-string col ?\ ) tmsg) | 1219 | (format (if type-break-terse-messages |
| 1220 | "Break complete (%s elapsed in total)" | ||
| 1221 | "Typing break has lasted %s") | ||
| 1222 | (type-break-format-time elapsed))))) | ||
| 1223 | (t | ||
| 1224 | (setq tmsg | ||
| 1225 | (format (if type-break-terse-messages | ||
| 1226 | "Break has lasted %s" | ||
| 1227 | "Typing break has lasted %s") | ||
| 1228 | (type-break-format-time elapsed)))))) | ||
| 1229 | (insert lines | ||
| 1230 | (make-string (/ (- (window-width) (length tmsg)) 2) ?\ ) | ||
| 1231 | tmsg) | ||
| 1232 | (if (> (length rmsg) 0) | ||
| 1233 | (insert "\n" | ||
| 1234 | (make-string (/ (- (window-width) (length rmsg)) 2) | ||
| 1235 | ?\ ) | ||
| 1236 | rmsg)) | ||
| 1237 | (if type-break-demo-boring-stats | ||
| 1238 | (let* | ||
| 1239 | ((message | ||
| 1240 | (format | ||
| 1241 | (if type-break-terse-messages | ||
| 1242 | "Since last break: %s keystrokes\n" | ||
| 1243 | "Since your last break you've typed %s keystrokes\n") | ||
| 1244 | type-break-keystroke-count)) | ||
| 1245 | (column-spaces | ||
| 1246 | (make-string (/ (- (window-width) (length message)) 2) | ||
| 1247 | ?\ )) | ||
| 1248 | (wpm (/ (/ (float type-break-keystroke-count) 5) | ||
| 1249 | (/ (type-break-time-difference | ||
| 1250 | type-break-interval-start | ||
| 1251 | type-break-time-last-break) | ||
| 1252 | 60.0)))) | ||
| 1253 | (insert "\n\n" column-spaces message) | ||
| 1254 | (if type-break-terse-messages | ||
| 1255 | (insert (format " %s%.2f wpm" | ||
| 1256 | column-spaces | ||
| 1257 | wpm)) | ||
| 1258 | (setq message | ||
| 1259 | (format "at an average of %.2f words per minute" | ||
| 1260 | wpm)) | ||
| 1261 | (insert | ||
| 1262 | (make-string (/ (- (window-width) (length message)) 2) | ||
| 1263 | ?\ ) | ||
| 1264 | message)))) | ||
| 1043 | (goto-char (point-min)) | 1265 | (goto-char (point-min)) |
| 1044 | (sit-for 60)) | 1266 | (sit-for 60)) |
| 1045 | (read-char) | 1267 | (read-char) |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 2392ccdfb47..33f1f06ba9a 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -382,6 +382,7 @@ new value.") | |||
| 382 | (setq help-echo 'widget-mouse-help)) | 382 | (setq help-echo 'widget-mouse-help)) |
| 383 | (overlay-put overlay 'button widget) | 383 | (overlay-put overlay 'button widget) |
| 384 | (overlay-put overlay 'keymap (widget-get widget :keymap)) | 384 | (overlay-put overlay 'keymap (widget-get widget :keymap)) |
| 385 | (overlay-put overlay 'evaporate t) | ||
| 385 | ;; We want to avoid the face with image buttons. | 386 | ;; We want to avoid the face with image buttons. |
| 386 | (unless (widget-get widget :suppress-face) | 387 | (unless (widget-get widget :suppress-face) |
| 387 | (overlay-put overlay 'face (widget-apply widget :button-face-get)) | 388 | (overlay-put overlay 'face (widget-apply widget :button-face-get)) |
| @@ -401,6 +402,7 @@ new value.") | |||
| 401 | "Specify sample for WIDGET between FROM and TO." | 402 | "Specify sample for WIDGET between FROM and TO." |
| 402 | (let ((overlay (make-overlay from to nil t nil))) | 403 | (let ((overlay (make-overlay from to nil t nil))) |
| 403 | (overlay-put overlay 'face (widget-apply widget :sample-face-get)) | 404 | (overlay-put overlay 'face (widget-apply widget :sample-face-get)) |
| 405 | (overlay-put overlay 'evaporate t) | ||
| 404 | (widget-put widget :sample-overlay overlay))) | 406 | (widget-put widget :sample-overlay overlay))) |
| 405 | 407 | ||
| 406 | (defun widget-specify-doc (widget from to) | 408 | (defun widget-specify-doc (widget from to) |
| @@ -408,6 +410,7 @@ new value.") | |||
| 408 | (let ((overlay (make-overlay from to nil t nil))) | 410 | (let ((overlay (make-overlay from to nil t nil))) |
| 409 | (overlay-put overlay 'widget-doc widget) | 411 | (overlay-put overlay 'widget-doc widget) |
| 410 | (overlay-put overlay 'face widget-documentation-face) | 412 | (overlay-put overlay 'face widget-documentation-face) |
| 413 | (overlay-put overlay 'evaporate t) | ||
| 411 | (widget-put widget :doc-overlay overlay))) | 414 | (widget-put widget :doc-overlay overlay))) |
| 412 | 415 | ||
| 413 | (defmacro widget-specify-insert (&rest form) | 416 | (defmacro widget-specify-insert (&rest form) |
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index db63d2adaa9..365d0e4392d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2004-04-27 Matthew Mundell <matt@mundell.ukfsn.org> | ||
| 2 | |||
| 3 | * files.texi (Changing Files): Document set-file-times. | ||
| 4 | |||
| 1 | 2004-04-23 Juanma Barranquero <lektu@terra.es> | 5 | 2004-04-23 Juanma Barranquero <lektu@terra.es> |
| 2 | 6 | ||
| 3 | * makefile.w32-in: Add "-*- makefile -*-" mode tag. | 7 | * makefile.w32-in: Add "-*- makefile -*-" mode tag. |
diff --git a/lispref/files.texi b/lispref/files.texi index 045b5741108..7ea482efa51 100644 --- a/lispref/files.texi +++ b/lispref/files.texi | |||
| @@ -1445,6 +1445,14 @@ the default file protection has no effect. | |||
| 1445 | This function returns the current default protection value. | 1445 | This function returns the current default protection value. |
| 1446 | @end defun | 1446 | @end defun |
| 1447 | 1447 | ||
| 1448 | @defun set-file-times filename &optional time | ||
| 1449 | This function sets the access and modification times of @var{filename} | ||
| 1450 | to @var{time}. The return value is @code{t} if the times are successfully | ||
| 1451 | set, otherwise it is @code{nil}. @var{time} defaults to the current | ||
| 1452 | time and must be in the format returned by @code{current-time} | ||
| 1453 | (@pxref{Time of Day}). | ||
| 1454 | @end defun | ||
| 1455 | |||
| 1448 | @cindex MS-DOS and file modes | 1456 | @cindex MS-DOS and file modes |
| 1449 | @cindex file modes and MS-DOS | 1457 | @cindex file modes and MS-DOS |
| 1450 | On MS-DOS, there is no such thing as an ``executable'' file mode bit. | 1458 | On MS-DOS, there is no such thing as an ``executable'' file mode bit. |
| @@ -2503,7 +2511,7 @@ Here are the operations that a magic file name handler gets to handle: | |||
| 2503 | @code{load}, @code{make-directory}, | 2511 | @code{load}, @code{make-directory}, |
| 2504 | @code{make-directory-internal}, | 2512 | @code{make-directory-internal}, |
| 2505 | @code{make-symbolic-link},@* | 2513 | @code{make-symbolic-link},@* |
| 2506 | @code{rename-file}, @code{set-file-modes}, | 2514 | @code{rename-file}, @code{set-file-modes}, @code{set-file-times}, |
| 2507 | @code{set-visited-file-modtime}, @code{shell-command}, | 2515 | @code{set-visited-file-modtime}, @code{shell-command}, |
| 2508 | @code{substitute-in-file-name},@* | 2516 | @code{substitute-in-file-name},@* |
| 2509 | @code{unhandled-file-name-directory}, | 2517 | @code{unhandled-file-name-directory}, |
diff --git a/man/ChangeLog b/man/ChangeLog index b8bcd4129ac..2514ea979b8 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2004-04-28 Masatake YAMATO <jet@gyve.org> | ||
| 2 | |||
| 3 | * widget.texi (Programming Example): Remove | ||
| 4 | overlays. | ||
| 5 | |||
| 6 | 2004-04-27 Jesper Harder <harder@ifa.au.dk> | ||
| 7 | |||
| 8 | * faq.texi, viper.texi, dired-x.texi, autotype.texi: lisp -> Lisp. | ||
| 9 | |||
| 1 | 2004-04-23 Juanma Barranquero <lektu@terra.es> | 10 | 2004-04-23 Juanma Barranquero <lektu@terra.es> |
| 2 | 11 | ||
| 3 | * makefile.w32-in: Add "-*- makefile -*-" mode tag. | 12 | * makefile.w32-in: Add "-*- makefile -*-" mode tag. |
diff --git a/man/autotype.texi b/man/autotype.texi index e7df280f524..5b24f26f2f5 100644 --- a/man/autotype.texi +++ b/man/autotype.texi | |||
| @@ -196,7 +196,7 @@ define an abbreviation (@pxref{(emacs)Defining Abbrevs}) that will expand | |||
| 196 | 196 | ||
| 197 | Say you want @samp{ifst} to be an abbreviation for the C language if | 197 | Say you want @samp{ifst} to be an abbreviation for the C language if |
| 198 | statement. You will tell Emacs that @samp{ifst} expands to the empty string | 198 | statement. You will tell Emacs that @samp{ifst} expands to the empty string |
| 199 | and then calls the skeleton command. In Emacs-lisp you can say something like | 199 | and then calls the skeleton command. In Emacs Lisp you can say something like |
| 200 | @code{(define-abbrev c-mode-abbrev-table "ifst" "" 'c-if)}. Or you can edit | 200 | @code{(define-abbrev c-mode-abbrev-table "ifst" "" 'c-if)}. Or you can edit |
| 201 | the output from @kbd{M-x list-abbrevs} to make it look like this: | 201 | the output from @kbd{M-x list-abbrevs} to make it look like this: |
| 202 | 202 | ||
| @@ -263,7 +263,7 @@ copy of this variable. | |||
| 263 | @item @code{v1}, @code{v2} | 263 | @item @code{v1}, @code{v2} |
| 264 | Skeleton-local user variables. | 264 | Skeleton-local user variables. |
| 265 | @item @code{'@var{expression}} | 265 | @item @code{'@var{expression}} |
| 266 | Evaluate following lisp expression for its side-effect, but prevent it from | 266 | Evaluate following Lisp expression for its side-effect, but prevent it from |
| 267 | being interpreted as a skeleton element. | 267 | being interpreted as a skeleton element. |
| 268 | @item @var{skeleton} | 268 | @item @var{skeleton} |
| 269 | Subskeletons are inserted recursively, not once, but as often as the user | 269 | Subskeletons are inserted recursively, not once, but as often as the user |
| @@ -605,9 +605,9 @@ formatting or define special points of interest in the inserted text. | |||
| 605 | @kbd{M-x tempo-backward-mark} and @kbd{M-x tempo-forward-mark} can be | 605 | @kbd{M-x tempo-backward-mark} and @kbd{M-x tempo-forward-mark} can be |
| 606 | used to jump between such points. | 606 | used to jump between such points. |
| 607 | 607 | ||
| 608 | More flexible templates can be created by including lisp symbols, which | 608 | More flexible templates can be created by including Lisp symbols, which |
| 609 | will be evaluated as variables, or lists, which will be evaluated | 609 | will be evaluated as variables, or lists, which will be evaluated |
| 610 | as lisp expressions. Automatic completion of specified tags to expanded | 610 | as Lisp expressions. Automatic completion of specified tags to expanded |
| 611 | templates can be provided. | 611 | templates can be provided. |
| 612 | 612 | ||
| 613 | @findex tempo-define-template | 613 | @findex tempo-define-template |
diff --git a/man/dired-x.texi b/man/dired-x.texi index ad7711d10ae..f8ea6e82edb 100644 --- a/man/dired-x.texi +++ b/man/dired-x.texi | |||
| @@ -696,7 +696,7 @@ Each element of the alist looks like | |||
| 696 | @end example | 696 | @end example |
| 697 | 697 | ||
| 698 | @noindent | 698 | @noindent |
| 699 | where each @var{command} can either be a string or a lisp expression | 699 | where each @var{command} can either be a string or a Lisp expression |
| 700 | that evaluates to a string. If several commands are given, all of | 700 | that evaluates to a string. If several commands are given, all of |
| 701 | them will temporarily be pushed onto the history. | 701 | them will temporarily be pushed onto the history. |
| 702 | 702 | ||
| @@ -927,11 +927,11 @@ List of extensions of dispensable files created by Bib@TeX{}. | |||
| 927 | @kindex M-( | 927 | @kindex M-( |
| 928 | @findex dired-mark-sexp | 928 | @findex dired-mark-sexp |
| 929 | @cindex Lisp expression, marking files with in Dired | 929 | @cindex Lisp expression, marking files with in Dired |
| 930 | @cindex Mark file by lisp expression | 930 | @cindex Mark file by Lisp expression |
| 931 | (@code{dired-mark-sexp}) Mark files for which @var{predicate} returns | 931 | (@code{dired-mark-sexp}) Mark files for which @var{predicate} returns |
| 932 | non-@code{nil}. With a prefix argument, unflag those files instead. | 932 | non-@code{nil}. With a prefix argument, unflag those files instead. |
| 933 | 933 | ||
| 934 | The @var{predicate} is a lisp expression that can refer to the following | 934 | The @var{predicate} is a Lisp expression that can refer to the following |
| 935 | symbols: | 935 | symbols: |
| 936 | @table @code | 936 | @table @code |
| 937 | @item inode | 937 | @item inode |
| @@ -965,7 +965,7 @@ For example, use | |||
| 965 | @end example | 965 | @end example |
| 966 | to mark all zero length files. | 966 | to mark all zero length files. |
| 967 | 967 | ||
| 968 | To find out all not yet compiled Emacs lisp files in a directory, Dired | 968 | To find out all not yet compiled Emacs Lisp files in a directory, Dired |
| 969 | all @file{.el} files in the lisp directory using the wildcard | 969 | all @file{.el} files in the lisp directory using the wildcard |
| 970 | @samp{*.el}. Then use @kbd{M-(} with | 970 | @samp{*.el}. Then use @kbd{M-(} with |
| 971 | @example | 971 | @example |
| @@ -998,7 +998,7 @@ directory in special major modes: | |||
| 998 | Default: @code{((dired-mode . (dired-current-directory)))} | 998 | Default: @code{((dired-mode . (dired-current-directory)))} |
| 999 | 999 | ||
| 1000 | Alist of major modes and their notion of @code{default-directory}, as a | 1000 | Alist of major modes and their notion of @code{default-directory}, as a |
| 1001 | lisp expression to evaluate. A resulting value of @code{nil} is ignored | 1001 | Lisp expression to evaluate. A resulting value of @code{nil} is ignored |
| 1002 | in favor of @code{default-directory}. | 1002 | in favor of @code{default-directory}. |
| 1003 | 1003 | ||
| 1004 | @item default-directory | 1004 | @item default-directory |
diff --git a/man/faq.texi b/man/faq.texi index 6894918079e..7c13dc16e7b 100644 --- a/man/faq.texi +++ b/man/faq.texi | |||
| @@ -3542,7 +3542,7 @@ see @ref{Packages that do not come with Emacs}. | |||
| 3542 | @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.html, The Emacs Lisp | 3542 | @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.html, The Emacs Lisp |
| 3543 | List (ELL)}, maintained by @email{stephen@@anc.ed.ac.uk, Stephen Eglen}, | 3543 | List (ELL)}, maintained by @email{stephen@@anc.ed.ac.uk, Stephen Eglen}, |
| 3544 | aims to provide one compact list with links to all of the current Emacs | 3544 | aims to provide one compact list with links to all of the current Emacs |
| 3545 | lisp files on the internet. The ELL can be browsed over the web, or | 3545 | Lisp files on the internet. The ELL can be browsed over the web, or |
| 3546 | from Emacs with @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.el, | 3546 | from Emacs with @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.el, |
| 3547 | the @file{ell} package}. | 3547 | the @file{ell} package}. |
| 3548 | 3548 | ||
diff --git a/man/viper.texi b/man/viper.texi index a31ce9a003d..5d4329730dc 100644 --- a/man/viper.texi +++ b/man/viper.texi | |||
| @@ -314,8 +314,8 @@ x}. Viper uses @key{ESC} to switch from Insert state to Vi state. Therefore | |||
| 314 | Viper defines @kbd{C-\} as its Meta key in Vi state. @xref{Vi State}, for | 314 | Viper defines @kbd{C-\} as its Meta key in Vi state. @xref{Vi State}, for |
| 315 | more info.@refill | 315 | more info.@refill |
| 316 | 316 | ||
| 317 | Emacs is structured as a lisp interpreter around a C core. Emacs keys | 317 | Emacs is structured as a Lisp interpreter around a C core. Emacs keys |
| 318 | cause lisp functions to be called. It is possible to call these | 318 | cause Lisp functions to be called. It is possible to call these |
| 319 | functions directly, by typing @kbd{M-x function-name}. | 319 | functions directly, by typing @kbd{M-x function-name}. |
| 320 | 320 | ||
| 321 | @node Loading Viper, States in Viper, Emacs Preliminaries, Overview | 321 | @node Loading Viper, States in Viper, Emacs Preliminaries, Overview |
| @@ -2066,7 +2066,7 @@ To customize the binding for @kbd{C-h} in Insert state: | |||
| 2066 | @end example | 2066 | @end example |
| 2067 | @noindent | 2067 | @noindent |
| 2068 | 2068 | ||
| 2069 | Each Emacs command key calls some lisp function. If you have enabled the | 2069 | Each Emacs command key calls some Lisp function. If you have enabled the |
| 2070 | Help, (@pxref{Rudimentary Changes}) @kbd{C-h k} will show you the function | 2070 | Help, (@pxref{Rudimentary Changes}) @kbd{C-h k} will show you the function |
| 2071 | for each specific key; @kbd{C-h b} will show all bindings, and @kbd{C-h m} | 2071 | for each specific key; @kbd{C-h b} will show all bindings, and @kbd{C-h m} |
| 2072 | will provide information on the major mode in effect. If Help is not | 2072 | will provide information on the major mode in effect. If Help is not |
diff --git a/man/widget.texi b/man/widget.texi index c919a394efe..457af8a07bb 100644 --- a/man/widget.texi +++ b/man/widget.texi | |||
| @@ -341,6 +341,7 @@ Interface}). | |||
| 341 | (make-local-variable 'widget-example-repeat) | 341 | (make-local-variable 'widget-example-repeat) |
| 342 | (let ((inhibit-read-only t)) | 342 | (let ((inhibit-read-only t)) |
| 343 | (erase-buffer)) | 343 | (erase-buffer)) |
| 344 | (remove-overlays) | ||
| 344 | (widget-insert "Here is some documentation.\n\nName: ") | 345 | (widget-insert "Here is some documentation.\n\nName: ") |
| 345 | (widget-create 'editable-field | 346 | (widget-create 'editable-field |
| 346 | :size 13 | 347 | :size 13 |
diff --git a/src/ChangeLog b/src/ChangeLog index 4db9b8cb4d9..c3314cb98e5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,23 @@ | |||
| 1 | 2004-04-27 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * xdisp.c (x_produce_glyphs): Fix the proverbial int/Lisp_Object mixup. | ||
| 4 | (on_hot_spot_p): Make sure we always return a value. | ||
| 5 | (Flookup_image_map): Remove unused var ix and iy. | ||
| 6 | (note_mode_line_or_margin_highlight): Remove unused var `image'. | ||
| 7 | |||
| 8 | 2004-04-27 Eli Zaretskii <eliz@gnu.org> | ||
| 9 | |||
| 10 | * msdos.c (init_environment): If one of the TMP... environment | ||
| 11 | variables is set to a drive letter without a trailing slash, | ||
| 12 | append a slash. | ||
| 13 | |||
| 14 | 2004-04-27 Matthew Mundell <matt@mundell.ukfsn.org> | ||
| 15 | |||
| 16 | * editfns.c (lisp_time_argument): Provide externally. | ||
| 17 | |||
| 18 | * fileio.c (Fset_file_times): New function. | ||
| 19 | (syms_of_fileio): Intern and staticpro it. | ||
| 20 | |||
| 1 | 2004-04-27 Kim F. Storm <storm@cua.dk> | 21 | 2004-04-27 Kim F. Storm <storm@cua.dk> |
| 2 | 22 | ||
| 3 | * xdisp.c (x_produce_glyphs): Fix last change; handle newline in | 23 | * xdisp.c (x_produce_glyphs): Fix last change; handle newline in |
diff --git a/src/editfns.c b/src/editfns.c index a5c3aea14bc..51187c0e473 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -73,7 +73,7 @@ static int tm_diff P_ ((struct tm *, struct tm *)); | |||
| 73 | static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *)); | 73 | static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *)); |
| 74 | static void update_buffer_properties P_ ((int, int)); | 74 | static void update_buffer_properties P_ ((int, int)); |
| 75 | static Lisp_Object region_limit P_ ((int)); | 75 | static Lisp_Object region_limit P_ ((int)); |
| 76 | static int lisp_time_argument P_ ((Lisp_Object, time_t *, int *)); | 76 | int lisp_time_argument P_ ((Lisp_Object, time_t *, int *)); |
| 77 | static size_t emacs_memftimeu P_ ((char *, size_t, const char *, | 77 | static size_t emacs_memftimeu P_ ((char *, size_t, const char *, |
| 78 | size_t, const struct tm *, int)); | 78 | size_t, const struct tm *, int)); |
| 79 | static void general_insert_function P_ ((void (*) (const unsigned char *, int), | 79 | static void general_insert_function P_ ((void (*) (const unsigned char *, int), |
| @@ -1377,7 +1377,7 @@ resolution finer than a second. */) | |||
| 1377 | } | 1377 | } |
| 1378 | 1378 | ||
| 1379 | 1379 | ||
| 1380 | static int | 1380 | int |
| 1381 | lisp_time_argument (specified_time, result, usec) | 1381 | lisp_time_argument (specified_time, result, usec) |
| 1382 | Lisp_Object specified_time; | 1382 | Lisp_Object specified_time; |
| 1383 | time_t *result; | 1383 | time_t *result; |
diff --git a/src/fileio.c b/src/fileio.c index 38b2cbd5b52..db1aac0afda 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -325,6 +325,7 @@ Lisp_Object Qfile_regular_p; | |||
| 325 | Lisp_Object Qfile_accessible_directory_p; | 325 | Lisp_Object Qfile_accessible_directory_p; |
| 326 | Lisp_Object Qfile_modes; | 326 | Lisp_Object Qfile_modes; |
| 327 | Lisp_Object Qset_file_modes; | 327 | Lisp_Object Qset_file_modes; |
| 328 | Lisp_Object Qset_file_times; | ||
| 328 | Lisp_Object Qfile_newer_than_file_p; | 329 | Lisp_Object Qfile_newer_than_file_p; |
| 329 | Lisp_Object Qinsert_file_contents; | 330 | Lisp_Object Qinsert_file_contents; |
| 330 | Lisp_Object Qwrite_region; | 331 | Lisp_Object Qwrite_region; |
| @@ -3440,7 +3441,59 @@ The value is an integer. */) | |||
| 3440 | XSETINT (value, (~ realmask) & 0777); | 3441 | XSETINT (value, (~ realmask) & 0777); |
| 3441 | return value; | 3442 | return value; |
| 3442 | } | 3443 | } |
| 3444 | |||
| 3445 | extern int lisp_time_argument P_ ((Lisp_Object, time_t *, int *)); | ||
| 3446 | |||
| 3447 | DEFUN ("set-file-times", Fset_file_times, Sset_file_times, 1, 2, 0, | ||
| 3448 | doc: /* Set times of file FILENAME to TIME. | ||
| 3449 | Set both access and modification times. | ||
| 3450 | Return t on success, else nil. | ||
| 3451 | Use the current time if TIME is nil. TIME is in the format of | ||
| 3452 | `current-time'. */) | ||
| 3453 | (filename, time) | ||
| 3454 | Lisp_Object filename, time; | ||
| 3455 | { | ||
| 3456 | Lisp_Object absname, encoded_absname; | ||
| 3457 | Lisp_Object handler; | ||
| 3458 | time_t sec; | ||
| 3459 | int usec; | ||
| 3460 | |||
| 3461 | if (! lisp_time_argument (time, &sec, &usec)) | ||
| 3462 | error ("Invalid time specification"); | ||
| 3463 | |||
| 3464 | absname = Fexpand_file_name (filename, current_buffer->directory); | ||
| 3465 | |||
| 3466 | /* If the file name has special constructs in it, | ||
| 3467 | call the corresponding file handler. */ | ||
| 3468 | handler = Ffind_file_name_handler (absname, Qset_file_times); | ||
| 3469 | if (!NILP (handler)) | ||
| 3470 | return call3 (handler, Qset_file_times, absname, time); | ||
| 3471 | |||
| 3472 | encoded_absname = ENCODE_FILE (absname); | ||
| 3443 | 3473 | ||
| 3474 | { | ||
| 3475 | EMACS_TIME t; | ||
| 3476 | |||
| 3477 | EMACS_SET_SECS (t, sec); | ||
| 3478 | EMACS_SET_USECS (t, usec); | ||
| 3479 | |||
| 3480 | if (set_file_times (SDATA (encoded_absname), t, t)) | ||
| 3481 | { | ||
| 3482 | #ifdef DOS_NT | ||
| 3483 | struct stat st; | ||
| 3484 | |||
| 3485 | /* Setting times on a directory always fails. */ | ||
| 3486 | if (stat (SDATA (encoded_absname), &st) == 0 | ||
| 3487 | && (st.st_mode & S_IFMT) == S_IFDIR) | ||
| 3488 | return Qnil; | ||
| 3489 | #endif | ||
| 3490 | report_file_error ("Setting file times", Fcons (absname, Qnil)); | ||
| 3491 | return Qnil; | ||
| 3492 | } | ||
| 3493 | } | ||
| 3494 | |||
| 3495 | return Qt; | ||
| 3496 | } | ||
| 3444 | 3497 | ||
| 3445 | #ifdef __NetBSD__ | 3498 | #ifdef __NetBSD__ |
| 3446 | #define unix 42 | 3499 | #define unix 42 |
| @@ -6344,6 +6397,7 @@ syms_of_fileio () | |||
| 6344 | Qfile_accessible_directory_p = intern ("file-accessible-directory-p"); | 6397 | Qfile_accessible_directory_p = intern ("file-accessible-directory-p"); |
| 6345 | Qfile_modes = intern ("file-modes"); | 6398 | Qfile_modes = intern ("file-modes"); |
| 6346 | Qset_file_modes = intern ("set-file-modes"); | 6399 | Qset_file_modes = intern ("set-file-modes"); |
| 6400 | Qset_file_times = intern ("set-file-times"); | ||
| 6347 | Qfile_newer_than_file_p = intern ("file-newer-than-file-p"); | 6401 | Qfile_newer_than_file_p = intern ("file-newer-than-file-p"); |
| 6348 | Qinsert_file_contents = intern ("insert-file-contents"); | 6402 | Qinsert_file_contents = intern ("insert-file-contents"); |
| 6349 | Qwrite_region = intern ("write-region"); | 6403 | Qwrite_region = intern ("write-region"); |
| @@ -6377,6 +6431,7 @@ syms_of_fileio () | |||
| 6377 | staticpro (&Qfile_accessible_directory_p); | 6431 | staticpro (&Qfile_accessible_directory_p); |
| 6378 | staticpro (&Qfile_modes); | 6432 | staticpro (&Qfile_modes); |
| 6379 | staticpro (&Qset_file_modes); | 6433 | staticpro (&Qset_file_modes); |
| 6434 | staticpro (&Qset_file_times); | ||
| 6380 | staticpro (&Qfile_newer_than_file_p); | 6435 | staticpro (&Qfile_newer_than_file_p); |
| 6381 | staticpro (&Qinsert_file_contents); | 6436 | staticpro (&Qinsert_file_contents); |
| 6382 | staticpro (&Qwrite_region); | 6437 | staticpro (&Qwrite_region); |
| @@ -6600,6 +6655,7 @@ a non-nil value. */); | |||
| 6600 | defsubr (&Sfile_regular_p); | 6655 | defsubr (&Sfile_regular_p); |
| 6601 | defsubr (&Sfile_modes); | 6656 | defsubr (&Sfile_modes); |
| 6602 | defsubr (&Sset_file_modes); | 6657 | defsubr (&Sset_file_modes); |
| 6658 | defsubr (&Sset_file_times); | ||
| 6603 | defsubr (&Sset_default_file_modes); | 6659 | defsubr (&Sset_default_file_modes); |
| 6604 | defsubr (&Sdefault_file_modes); | 6660 | defsubr (&Sdefault_file_modes); |
| 6605 | defsubr (&Sfile_newer_than_file_p); | 6661 | defsubr (&Sfile_newer_than_file_p); |
diff --git a/src/msdos.c b/src/msdos.c index 39d28564890..b30e51bbb36 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -4408,9 +4408,28 @@ init_environment (argc, argv, skip_args) | |||
| 4408 | for (i = 0; i < imax ; i++) | 4408 | for (i = 0; i < imax ; i++) |
| 4409 | { | 4409 | { |
| 4410 | const char *tmp = tempdirs[i]; | 4410 | const char *tmp = tempdirs[i]; |
| 4411 | char buf[FILENAME_MAX]; | ||
| 4411 | 4412 | ||
| 4412 | if (*tmp == '$') | 4413 | if (*tmp == '$') |
| 4413 | tmp = getenv (tmp + 1); | 4414 | { |
| 4415 | int tmp_len; | ||
| 4416 | |||
| 4417 | tmp = getenv (tmp + 1); | ||
| 4418 | if (!tmp) | ||
| 4419 | continue; | ||
| 4420 | |||
| 4421 | /* Some lusers set TMPDIR=e:, probably because some losing | ||
| 4422 | programs cannot handle multiple slashes if they use e:/. | ||
| 4423 | e: fails in `access' below, so we interpret e: as e:/. */ | ||
| 4424 | tmp_len = strlen(tmp); | ||
| 4425 | if (tmp[tmp_len - 1] != '/' && tmp[tmp_len - 1] != '\\') | ||
| 4426 | { | ||
| 4427 | strcpy(buf, tmp); | ||
| 4428 | buf[tmp_len++] = '/', buf[tmp_len] = 0; | ||
| 4429 | tmp = buf; | ||
| 4430 | } | ||
| 4431 | } | ||
| 4432 | |||
| 4414 | /* Note that `access' can lie to us if the directory resides on a | 4433 | /* Note that `access' can lie to us if the directory resides on a |
| 4415 | read-only filesystem, like CD-ROM or a write-protected floppy. | 4434 | read-only filesystem, like CD-ROM or a write-protected floppy. |
| 4416 | The only way to be really sure is to actually create a file and | 4435 | The only way to be really sure is to actually create a file and |
diff --git a/src/xdisp.c b/src/xdisp.c index d5e12e68546..e77fa98cab1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -18707,7 +18707,8 @@ x_produce_glyphs (it) | |||
| 18707 | it->pixel_width = 0; | 18707 | it->pixel_width = 0; |
| 18708 | it->nglyphs = 0; | 18708 | it->nglyphs = 0; |
| 18709 | 18709 | ||
| 18710 | lh = Fget_text_property (IT_CHARPOS (*it), Qline_height, it->object); | 18710 | lh = Fget_text_property (make_number (IT_CHARPOS (*it)), |
| 18711 | Qline_height, it->object); | ||
| 18711 | 18712 | ||
| 18712 | if (EQ (lh, Qt)) | 18713 | if (EQ (lh, Qt)) |
| 18713 | { | 18714 | { |
| @@ -18753,17 +18754,20 @@ x_produce_glyphs (it) | |||
| 18753 | if (INTEGERP (lh)) | 18754 | if (INTEGERP (lh)) |
| 18754 | explicit_height = XINT (lh); | 18755 | explicit_height = XINT (lh); |
| 18755 | else if (FLOATP (lh)) | 18756 | else if (FLOATP (lh)) |
| 18756 | explicit_height = (it->phys_ascent + it->phys_descent) * XFLOAT_DATA (lh); | 18757 | explicit_height = (it->phys_ascent + it->phys_descent) |
| 18758 | * XFLOAT_DATA (lh); | ||
| 18757 | 18759 | ||
| 18758 | if (explicit_height > it->ascent + it->descent) | 18760 | if (explicit_height > it->ascent + it->descent) |
| 18759 | it->ascent = explicit_height - it->descent; | 18761 | it->ascent = explicit_height - it->descent; |
| 18760 | } | 18762 | } |
| 18761 | 18763 | ||
| 18762 | lsp = Fget_text_property (IT_CHARPOS (*it), Qline_spacing, it->object); | 18764 | lsp = Fget_text_property (make_number (IT_CHARPOS (*it)), |
| 18765 | Qline_spacing, it->object); | ||
| 18763 | if (INTEGERP (lsp)) | 18766 | if (INTEGERP (lsp)) |
| 18764 | extra_line_spacing = XINT (lsp); | 18767 | extra_line_spacing = XINT (lsp); |
| 18765 | else if (FLOATP (lsp)) | 18768 | else if (FLOATP (lsp)) |
| 18766 | extra_line_spacing = (it->phys_ascent + it->phys_descent) * XFLOAT_DATA (lsp); | 18769 | extra_line_spacing = (it->phys_ascent + it->phys_descent) |
| 18770 | * XFLOAT_DATA (lsp); | ||
| 18767 | } | 18771 | } |
| 18768 | else if (it->char_to_display == '\t') | 18772 | else if (it->char_to_display == '\t') |
| 18769 | { | 18773 | { |
| @@ -21342,8 +21346,8 @@ phys_cursor_in_rect_p (w, r) | |||
| 21342 | I assume the effect is the same -- and this is portable. */ | 21346 | I assume the effect is the same -- and this is portable. */ |
| 21343 | return x_intersect_rectangles (&cr, r, &result); | 21347 | return x_intersect_rectangles (&cr, r, &result); |
| 21344 | } | 21348 | } |
| 21345 | else | 21349 | /* If we don't understand the format, pretend we're not in the hot-spot. */ |
| 21346 | return 0; | 21350 | return 0; |
| 21347 | } | 21351 | } |
| 21348 | 21352 | ||
| 21349 | 21353 | ||