diff options
| author | Karoly Lorentey | 2004-07-10 14:37:36 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-07-10 14:37:36 +0000 |
| commit | 46e6ff4b7d21a6f54b9359184b98ff88480ff87d (patch) | |
| tree | 2d731847409f4921a41ffc089a9656f1a8c350c3 | |
| parent | 301f31cf2f699ceecc552a74485ee6dcec9666b5 (diff) | |
| parent | bcdf2143d312616d027880b16a6f43f4e0066792 (diff) | |
| download | emacs-46e6ff4b7d21a6f54b9359184b98ff88480ff87d.tar.gz emacs-46e6ff4b7d21a6f54b9359184b98ff88480ff87d.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-439
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-440
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-441
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-442
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-443
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-444
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-445
Tweak permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-446
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-211
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | Makefile.in | 1 | ||||
| -rw-r--r-- | etc/ChangeLog | 4 | ||||
| -rw-r--r-- | etc/NEWS | 12 | ||||
| -rw-r--r-- | etc/TODO | 22 | ||||
| -rw-r--r-- | lisp/ChangeLog | 46 | ||||
| -rw-r--r-- | lisp/ibuffer.el | 2 | ||||
| -rw-r--r-- | lisp/international/mule.el | 4 | ||||
| -rw-r--r-- | lisp/isearch.el | 24 | ||||
| -rw-r--r-- | lisp/replace.el | 147 | ||||
| -rw-r--r-- | lisp/term/mac-win.el | 13 | ||||
| -rw-r--r-- | lispref/ChangeLog | 31 | ||||
| -rw-r--r-- | lispref/frames.texi | 30 | ||||
| -rw-r--r-- | lispref/os.texi | 217 | ||||
| -rw-r--r-- | src/ChangeLog | 24 | ||||
| -rw-r--r-- | src/eval.c | 1 | ||||
| -rw-r--r-- | src/fileio.c | 17 | ||||
| -rw-r--r-- | src/fns.c | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 12 | ||||
| -rw-r--r-- | src/macterm.c | 17 |
20 files changed, 440 insertions, 192 deletions
| @@ -1,3 +1,7 @@ | |||
| 1 | 2004-07-05 Andreas Schwab <schwab@suse.de> | ||
| 2 | |||
| 3 | * Makefile.in (install-arch-indep): Remove .arch-inventory files. | ||
| 4 | |||
| 1 | 2004-06-21 Kenichi Handa <handa@m17n.org> | 5 | 2004-06-21 Kenichi Handa <handa@m17n.org> |
| 2 | 6 | ||
| 3 | * make-dist: Link leim-ext.el into tempdir. | 7 | * make-dist: Link leim-ext.el into tempdir. |
diff --git a/Makefile.in b/Makefile.in index 760f7d34f77..35cc2798e32 100644 --- a/Makefile.in +++ b/Makefile.in | |||
| @@ -415,6 +415,7 @@ install-arch-indep: mkdir info | |||
| 415 | rm -rf $${subdir}/RCS ; \ | 415 | rm -rf $${subdir}/RCS ; \ |
| 416 | rm -rf $${subdir}/CVS ; \ | 416 | rm -rf $${subdir}/CVS ; \ |
| 417 | rm -f $${subdir}/.cvsignore ; \ | 417 | rm -f $${subdir}/.cvsignore ; \ |
| 418 | rm -f $${subdir}/.arch-inventory ; \ | ||
| 418 | rm -f $${subdir}/\#* ; \ | 419 | rm -f $${subdir}/\#* ; \ |
| 419 | rm -f $${subdir}/.\#* ; \ | 420 | rm -f $${subdir}/.\#* ; \ |
| 420 | rm -f $${subdir}/*~ ; \ | 421 | rm -f $${subdir}/*~ ; \ |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 356946001bd..d9c0c2816f0 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2004-07-08 David Kastrup <dak@gnu.org> | ||
| 2 | |||
| 3 | * NEWS (Lisp changes in 21.4): document (match-data t) change. | ||
| 4 | |||
| 1 | 2002-06-26 Eli Zaretskii <eliz@is.elta.co.il> | 5 | 2002-06-26 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 6 | ||
| 3 | * FOR-RELEASE: Moved to the admin directory. | 7 | * FOR-RELEASE: Moved to the admin directory. |
| @@ -2171,7 +2171,7 @@ mode-lines in inverse-video. | |||
| 2171 | ** New package benchmark.el contains simple support for convenient | 2171 | ** New package benchmark.el contains simple support for convenient |
| 2172 | timing measurements of code (including the garbage collection component). | 2172 | timing measurements of code (including the garbage collection component). |
| 2173 | 2173 | ||
| 2174 | ** The new Lisp library fringe.el controls the apperance of fringes. | 2174 | ** The new Lisp library fringe.el controls the appearance of fringes. |
| 2175 | 2175 | ||
| 2176 | ** `cfengine-mode' is a major mode for editing GNU Cfengine | 2176 | ** `cfengine-mode' is a major mode for editing GNU Cfengine |
| 2177 | configuration files. | 2177 | configuration files. |
| @@ -2952,6 +2952,11 @@ variable is used by read-file-name-internal to filter the completion list. | |||
| 2952 | ** The new variable `read-file-name-function' can be used by lisp code | 2952 | ** The new variable `read-file-name-function' can be used by lisp code |
| 2953 | to override the internal read-file-name function. | 2953 | to override the internal read-file-name function. |
| 2954 | 2954 | ||
| 2955 | |||
| 2956 | ** The new variable `read-file-name-completion-ignore-case' specifies | ||
| 2957 | whether completion ignores case when reading a file name with the | ||
| 2958 | `read-file-name' function. | ||
| 2959 | |||
| 2955 | +++ | 2960 | +++ |
| 2956 | ** The new function `read-directory-name' can be used instead of | 2961 | ** The new function `read-directory-name' can be used instead of |
| 2957 | `read-file-name' to read a directory name; when used, completion | 2962 | `read-file-name' to read a directory name; when used, completion |
| @@ -3559,6 +3564,11 @@ it in that buffer. | |||
| 3559 | properties from surrounding text. | 3564 | properties from surrounding text. |
| 3560 | 3565 | ||
| 3561 | +++ | 3566 | +++ |
| 3567 | ** `(match-data t)' will append the buffer as a final element of the | ||
| 3568 | match data if the last match was on a buffer. `set-match-data' will | ||
| 3569 | accept this for restoring the match state. | ||
| 3570 | |||
| 3571 | +++ | ||
| 3562 | ** New function `buffer-local-value'. | 3572 | ** New function `buffer-local-value'. |
| 3563 | 3573 | ||
| 3564 | This function returns the buffer-local binding of VARIABLE (a symbol) | 3574 | This function returns the buffer-local binding of VARIABLE (a symbol) |
| @@ -276,6 +276,28 @@ to the FSF. | |||
| 276 | the definition of `file-attributes' and `directory-files-and-attributes' | 276 | the definition of `file-attributes' and `directory-files-and-attributes' |
| 277 | and from the calls. | 277 | and from the calls. |
| 278 | 278 | ||
| 279 | ** Re-design language environment handling so that Emacs can fit | ||
| 280 | better to a users locale (e.g. ja_JP.UTF-8). | ||
| 281 | |||
| 282 | ** Eliminate the current restriction on header printing by ps-print. | ||
| 283 | Currently, a header can contain only single 1-byte charset in | ||
| 284 | addition to ASCII. | ||
| 285 | |||
| 286 | ** In ps-print, provide an user friendly interface to specify fonts. | ||
| 287 | |||
| 288 | ** OpenType font support for various complex scripts (e.g. Devanagari). | ||
| 289 | As X protocal doesn't provide a way to access OpenType Layout Tables | ||
| 290 | in a OpenType font of a server side, we need a way to utilize local | ||
| 291 | fonts (perhaps by directly using the Freetype library or indirectly | ||
| 292 | via Xft library). | ||
| 293 | |||
| 294 | ** Enhance word boundary detection for such a script that doesn't use | ||
| 295 | space at word boundary (e.g. Thai). | ||
| 296 | |||
| 297 | ** Include a better Japanese input method in the distribution. | ||
| 298 | Currently, most Japanese users are using external packages | ||
| 299 | (e.g. tamago, anthy) or an input method via XIM. | ||
| 300 | |||
| 279 | * Internal changes | 301 | * Internal changes |
| 280 | 302 | ||
| 281 | ** Replace gmalloc.c with the modified Doug Lea code from the current | 303 | ** Replace gmalloc.c with the modified Doug Lea code from the current |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7dc899bd605..b36e1bae10c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,46 @@ | |||
| 1 | 2004-07-08 Steven Tamm <steventamm@mac.com> | ||
| 2 | |||
| 3 | * term/mac-win.el (mac-scroll-ignore-events, mac-scroll-down) | ||
| 4 | (mac-scroll-down-line, mac-scroll-up, mac-scroll-up-line): | ||
| 5 | Do not treat double clicks and triple clicks specially in the | ||
| 6 | scroll bar (preventing strange repositioning problems) | ||
| 7 | |||
| 8 | 2004-07-06 Stefan <monnier@iro.umontreal.ca> | ||
| 9 | |||
| 10 | * replace.el (query-replace-regexp-eval): Fix last change. | ||
| 11 | |||
| 12 | 2004-07-05 Stefan <monnier@iro.umontreal.ca> | ||
| 13 | |||
| 14 | * replace.el (query-replace-descr): New fun. | ||
| 15 | (query-replace-read-from, query-replace-read-args): Default to the | ||
| 16 | previous from&to. | ||
| 17 | (query-replace-read-to): Quote the `from' string when displaying it. | ||
| 18 | (query-replace-regexp-eval): Immediately check read-only status. | ||
| 19 | Use query-replace-read-from to get the \n checking. | ||
| 20 | Quote the `from' string when displaying it. | ||
| 21 | (map-query-replace-regexp, occur-read-primary-args): | ||
| 22 | Quote the `from' string when displaying it. | ||
| 23 | |||
| 24 | * isearch.el (isearch-query-replace): Pass the regexp-ness and | ||
| 25 | delimited-ness of the search to query-replace. | ||
| 26 | |||
| 27 | * replace.el (query-replace-read-from, query-replace-read-to): | ||
| 28 | New funs extracted from query-replace-read-args. | ||
| 29 | (query-replace-read-args): Use them. | ||
| 30 | |||
| 31 | * replace.el (query-replace-interactive, query-replace-read-args): | ||
| 32 | Remove the `initial' special value. | ||
| 33 | (query-replace-regexp-eval, map-query-replace-regexp): Simplify. | ||
| 34 | (occur-engine): Remove unused var `matchend'. | ||
| 35 | |||
| 36 | * isearch.el (isearch-query-replace, isearch-query-replace-regexp): | ||
| 37 | Use the search string without prompting. | ||
| 38 | |||
| 39 | 2004-07-05 Kenichi Handa <handa@m17n.org> | ||
| 40 | |||
| 41 | * international/mule.el (decode-coding-inserted-region): | ||
| 42 | Set last-coding-system-used only when coding is nil. | ||
| 43 | |||
| 1 | 2004-07-03 Eli Zaretskii <eliz@gnu.org> | 44 | 2004-07-03 Eli Zaretskii <eliz@gnu.org> |
| 2 | 45 | ||
| 3 | * progmodes/grep.el (grep-compute-defaults, grep-command) | 46 | * progmodes/grep.el (grep-compute-defaults, grep-command) |
| @@ -9,8 +52,7 @@ | |||
| 9 | 52 | ||
| 10 | 2004-07-03 KOSEKI Yoshinori <kose@meadowy.org> | 53 | 2004-07-03 KOSEKI Yoshinori <kose@meadowy.org> |
| 11 | 54 | ||
| 12 | * iimage.el (turn-on-iimage-mode, iimage-mode): Add autoload | 55 | * iimage.el (turn-on-iimage-mode, iimage-mode): Add autoload cookies. |
| 13 | cookies. | ||
| 14 | (iimage-mode-image-search-path): New user option to search the | 56 | (iimage-mode-image-search-path): New user option to search the |
| 15 | image file. | 57 | image file. |
| 16 | (iimage-locate-file): New funcion. Emacs21.3 or earlier does not | 58 | (iimage-locate-file): New funcion. Emacs21.3 or earlier does not |
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index fef9b7f811d..140f2995292 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ibuffer.el --- operate on buffers like dired | 1 | ;;; ibuffer.el --- operate on buffers like dired |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Colin Walters <walters@verbum.org> | 5 | ;; Author: Colin Walters <walters@verbum.org> |
| 6 | ;; Maintainer: John Paul Wallington <jpw@gnu.org> | 6 | ;; Maintainer: John Paul Wallington <jpw@gnu.org> |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index bbe83c2baf7..8b4ba9b2ce3 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -1878,8 +1878,8 @@ of the function `insert-file-contents'." | |||
| 1878 | (coding-system-change-text-conversion coding 'raw-text))) | 1878 | (coding-system-change-text-conversion coding 'raw-text))) |
| 1879 | (setq coding nil)) | 1879 | (setq coding nil)) |
| 1880 | (if coding | 1880 | (if coding |
| 1881 | (decode-coding-region (point-min) (point-max) coding)) | 1881 | (decode-coding-region (point-min) (point-max) coding) |
| 1882 | (setq last-coding-system-used coding))))) | 1882 | (setq last-coding-system-used coding)))))) |
| 1883 | 1883 | ||
| 1884 | (defun make-translation-table (&rest args) | 1884 | (defun make-translation-table (&rest args) |
| 1885 | "Make a translation table from arguments. | 1885 | "Make a translation table from arguments. |
diff --git a/lisp/isearch.el b/lisp/isearch.el index d30c7c6cc66..a5261d2530c 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; isearch.el --- incremental search minor mode | 1 | ;;; isearch.el --- incremental search minor mode |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1999, 2000, 01, 2003, 2004 | 3 | ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999, |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; 2000, 2001, 2003, 2004 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> | 6 | ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> |
| 7 | ;; Maintainer: FSF | 7 | ;; Maintainer: FSF |
| @@ -59,7 +59,6 @@ | |||
| 59 | 59 | ||
| 60 | ;; TODO | 60 | ;; TODO |
| 61 | ;; - Integrate the emacs 19 generalized command history. | 61 | ;; - Integrate the emacs 19 generalized command history. |
| 62 | ;; - Think about incorporating query-replace. | ||
| 63 | ;; - Hooks and options for failed search. | 62 | ;; - Hooks and options for failed search. |
| 64 | 63 | ||
| 65 | ;;; Change Log: | 64 | ;;; Change Log: |
| @@ -338,8 +337,8 @@ Default value, nil, means edit the string instead." | |||
| 338 | (define-key map "\M-r" 'isearch-toggle-regexp) | 337 | (define-key map "\M-r" 'isearch-toggle-regexp) |
| 339 | (define-key map "\M-e" 'isearch-edit-string) | 338 | (define-key map "\M-e" 'isearch-edit-string) |
| 340 | 339 | ||
| 341 | (define-key map (kbd "M-%") 'isearch-query-replace) | 340 | (define-key map [?\M-%] 'isearch-query-replace) |
| 342 | (define-key map (kbd "C-M-%") 'isearch-query-replace-regexp) | 341 | (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) |
| 343 | 342 | ||
| 344 | map) | 343 | map) |
| 345 | "Keymap for `isearch-mode'.") | 344 | "Keymap for `isearch-mode'.") |
| @@ -1062,19 +1061,20 @@ Use `isearch-exit' to quit without signaling." | |||
| 1062 | (defun isearch-query-replace () | 1061 | (defun isearch-query-replace () |
| 1063 | "Start query-replace with string to replace from last search string." | 1062 | "Start query-replace with string to replace from last search string." |
| 1064 | (interactive) | 1063 | (interactive) |
| 1065 | (let ((query-replace-interactive 'initial) | 1064 | (barf-if-buffer-read-only) |
| 1066 | (case-fold-search isearch-case-fold-search)) | 1065 | (let ((case-fold-search isearch-case-fold-search)) |
| 1067 | ;; Put search string into the right ring | ||
| 1068 | (setq isearch-regexp nil) | ||
| 1069 | (isearch-done) | 1066 | (isearch-done) |
| 1070 | (isearch-clean-overlays) | 1067 | (isearch-clean-overlays) |
| 1071 | (and isearch-forward isearch-other-end (goto-char isearch-other-end)) | 1068 | (and isearch-forward isearch-other-end (goto-char isearch-other-end)) |
| 1072 | (call-interactively 'query-replace))) | 1069 | (perform-replace |
| 1070 | isearch-string | ||
| 1071 | (query-replace-read-to isearch-string "Query replace" isearch-regexp) | ||
| 1072 | t isearch-regexp isearch-word))) | ||
| 1073 | 1073 | ||
| 1074 | (defun isearch-query-replace-regexp () | 1074 | (defun isearch-query-replace-regexp () |
| 1075 | "Start query-replace-regexp with string to replace from last search string." | 1075 | "Start query-replace-regexp with string to replace from last search string." |
| 1076 | (interactive) | 1076 | (interactive) |
| 1077 | (let ((query-replace-interactive 'initial) | 1077 | (let ((query-replace-interactive t) |
| 1078 | (case-fold-search isearch-case-fold-search)) | 1078 | (case-fold-search isearch-case-fold-search)) |
| 1079 | ;; Put search string into the right ring | 1079 | ;; Put search string into the right ring |
| 1080 | (setq isearch-regexp t) | 1080 | (setq isearch-regexp t) |
| @@ -2380,5 +2380,5 @@ CASE-FOLD non-nil means the search was case-insensitive." | |||
| 2380 | isearch-case-fold-search case-fold) | 2380 | isearch-case-fold-search case-fold) |
| 2381 | (isearch-search)) | 2381 | (isearch-search)) |
| 2382 | 2382 | ||
| 2383 | ;;; arch-tag: 74850515-f7d8-43a6-8a2c-ca90a4c1e675 | 2383 | ;; arch-tag: 74850515-f7d8-43a6-8a2c-ca90a4c1e675 |
| 2384 | ;;; isearch.el ends here | 2384 | ;;; isearch.el ends here |
diff --git a/lisp/replace.el b/lisp/replace.el index 4c381c658e5..60c28d6c48a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; replace.el --- replace commands for Emacs | 1 | ;;; replace.el --- replace commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000, 2001, 2002, | 3 | ;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1996, 1997, 2000, 2001, 2002, |
| 4 | ;; 2003, 2004 Free Software Foundation, Inc. | 4 | ;; 2003, 2004 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| 7 | 7 | ||
| @@ -36,15 +36,9 @@ | |||
| 36 | 36 | ||
| 37 | (defvar query-replace-history nil) | 37 | (defvar query-replace-history nil) |
| 38 | 38 | ||
| 39 | (defcustom query-replace-interactive nil | 39 | (defvar query-replace-interactive nil |
| 40 | "Non-nil means `query-replace' uses the last search string. | 40 | "Non-nil means `query-replace' uses the last search string. |
| 41 | That becomes the \"string to replace\". | 41 | That becomes the \"string to replace\".") |
| 42 | If value is `initial', the last search string is inserted into | ||
| 43 | the minibuffer as an initial value for \"string to replace\"." | ||
| 44 | :type '(choice (const :tag "Off" nil) | ||
| 45 | (const :tag "Initial content" initial) | ||
| 46 | (other :tag "Use default value" t)) | ||
| 47 | :group 'matching) | ||
| 48 | 42 | ||
| 49 | (defcustom query-replace-from-history-variable 'query-replace-history | 43 | (defcustom query-replace-from-history-variable 'query-replace-history |
| 50 | "History list to use for the FROM argument of `query-replace' commands. | 44 | "History list to use for the FROM argument of `query-replace' commands. |
| @@ -70,40 +64,56 @@ strings or patterns." | |||
| 70 | :group 'matching | 64 | :group 'matching |
| 71 | :version "21.4") | 65 | :version "21.4") |
| 72 | 66 | ||
| 73 | (defun query-replace-read-args (string regexp-flag &optional noerror) | 67 | (defun query-replace-descr (string) |
| 74 | (unless noerror | 68 | (mapconcat 'isearch-text-char-description string "")) |
| 75 | (barf-if-buffer-read-only)) | 69 | |
| 76 | (let (from to) | 70 | (defun query-replace-read-from (string regexp-flag) |
| 77 | (if (and query-replace-interactive | 71 | "Query and return the `from' argument of a query-replace operation. |
| 78 | (not (eq query-replace-interactive 'initial))) | 72 | The return value can also be a pair (FROM . TO) indicating that the user |
| 79 | (setq from (car (if regexp-flag regexp-search-ring search-ring))) | 73 | wants to replace FROM with TO." |
| 80 | ;; The save-excursion here is in case the user marks and copies | 74 | (if query-replace-interactive |
| 81 | ;; a region in order to specify the minibuffer input. | 75 | (car (if regexp-flag regexp-search-ring search-ring)) |
| 82 | ;; That should not clobber the region for the query-replace itself. | 76 | (let* ((lastfrom (car (symbol-value query-replace-from-history-variable))) |
| 83 | (save-excursion | 77 | (lastto (car (symbol-value query-replace-to-history-variable))) |
| 84 | (setq from (read-from-minibuffer | 78 | (from |
| 85 | (format "%s: " string) | 79 | ;; The save-excursion here is in case the user marks and copies |
| 86 | (if (eq query-replace-interactive 'initial) | 80 | ;; a region in order to specify the minibuffer input. |
| 87 | (car (if regexp-flag regexp-search-ring search-ring))) | 81 | ;; That should not clobber the region for the query-replace itself. |
| 88 | nil nil | 82 | (save-excursion |
| 89 | query-replace-from-history-variable | 83 | (when (equal lastfrom lastto) |
| 90 | nil t))) | 84 | ;; Typically, this is because the two histlists are shared. |
| 91 | ;; Warn if user types \n or \t, but don't reject the input. | 85 | (setq lastfrom (cadr (symbol-value |
| 92 | (and regexp-flag | 86 | query-replace-from-history-variable)))) |
| 93 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) | 87 | (read-from-minibuffer |
| 94 | (let ((match (match-string 3 from))) | 88 | (if (and lastto lastfrom) |
| 95 | (cond | 89 | (format "%s (default %s -> %s): " string |
| 96 | ((string= match "\\n") | 90 | (query-replace-descr lastfrom) |
| 97 | (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) | 91 | (query-replace-descr lastto)) |
| 98 | ((string= match "\\t") | 92 | (format "%s: " string)) |
| 99 | (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) | 93 | nil nil nil |
| 100 | (sit-for 2)))) | 94 | query-replace-from-history-variable |
| 101 | 95 | nil t)))) | |
| 102 | (save-excursion | 96 | (if (and (zerop (length from)) lastto lastfrom) |
| 103 | (setq to (read-from-minibuffer | 97 | (cons lastfrom lastto) |
| 104 | (format "%s %s with: " string from) | 98 | ;; Warn if user types \n or \t, but don't reject the input. |
| 105 | nil nil nil | 99 | (and regexp-flag |
| 106 | query-replace-to-history-variable from t))) | 100 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) |
| 101 | (let ((match (match-string 3 from))) | ||
| 102 | (cond | ||
| 103 | ((string= match "\\n") | ||
| 104 | (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) | ||
| 105 | ((string= match "\\t") | ||
| 106 | (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) | ||
| 107 | (sit-for 2))) | ||
| 108 | from)))) | ||
| 109 | |||
| 110 | (defun query-replace-read-to (from string regexp-flag) | ||
| 111 | "Query and return the `from' argument of a query-replace operation." | ||
| 112 | (let ((to (save-excursion | ||
| 113 | (read-from-minibuffer | ||
| 114 | (format "%s %s with: " string (query-replace-descr from)) | ||
| 115 | nil nil nil | ||
| 116 | query-replace-to-history-variable from t)))) | ||
| 107 | (when (and regexp-flag | 117 | (when (and regexp-flag |
| 108 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)) | 118 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)) |
| 109 | (let (pos list char) | 119 | (let (pos list char) |
| @@ -138,6 +148,14 @@ strings or patterns." | |||
| 138 | (if (> (length to) 1) | 148 | (if (> (length to) 1) |
| 139 | (cons 'concat to) | 149 | (cons 'concat to) |
| 140 | (car to))))) | 150 | (car to))))) |
| 151 | to)) | ||
| 152 | |||
| 153 | (defun query-replace-read-args (string regexp-flag &optional noerror) | ||
| 154 | (unless noerror | ||
| 155 | (barf-if-buffer-read-only)) | ||
| 156 | (let* ((from (query-replace-read-from string regexp-flag)) | ||
| 157 | (to (if (consp from) (prog1 (cdr from) (setq from (car from))) | ||
| 158 | (query-replace-read-to from string regexp-flag)))) | ||
| 141 | (list from to current-prefix-arg))) | 159 | (list from to current-prefix-arg))) |
| 142 | 160 | ||
| 143 | (defun query-replace (from-string to-string &optional delimited start end) | 161 | (defun query-replace (from-string to-string &optional delimited start end) |
| @@ -269,16 +287,18 @@ Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace | |||
| 269 | only matches that are surrounded by word boundaries. | 287 | only matches that are surrounded by word boundaries. |
| 270 | Fourth and fifth arg START and END specify the region to operate on." | 288 | Fourth and fifth arg START and END specify the region to operate on." |
| 271 | (interactive | 289 | (interactive |
| 272 | (let (from to) | 290 | (progn |
| 273 | (if query-replace-interactive | 291 | (barf-if-buffer-read-only) |
| 274 | (setq from (car regexp-search-ring)) | 292 | (let* ((from |
| 275 | (setq from (read-from-minibuffer "Query replace regexp: " | 293 | ;; Let-bind the history var to disable the "foo -> bar" default. |
| 276 | nil nil nil | 294 | ;; Maybe we shouldn't disable this default, but for now I'll |
| 277 | query-replace-from-history-variable | 295 | ;; leave it off. --Stef |
| 278 | nil t))) | 296 | (let ((query-replace-to-history-variable nil)) |
| 279 | (setq to (list (read-from-minibuffer | 297 | (query-replace-read-from "Query replace regexp" t))) |
| 280 | (format "Query replace regexp %s with eval: " from) | 298 | (to (list (read-from-minibuffer |
| 281 | nil nil t query-replace-to-history-variable from t))) | 299 | (format "Query replace regexp %s with eval: " |
| 300 | (query-replace-descr from)) | ||
| 301 | nil nil t query-replace-to-history-variable from t)))) | ||
| 282 | ;; We make TO a list because replace-match-string-symbols requires one, | 302 | ;; We make TO a list because replace-match-string-symbols requires one, |
| 283 | ;; and the user might enter a single token. | 303 | ;; and the user might enter a single token. |
| 284 | (replace-match-string-symbols to) | 304 | (replace-match-string-symbols to) |
| @@ -286,7 +306,7 @@ Fourth and fifth arg START and END specify the region to operate on." | |||
| 286 | (if (and transient-mark-mode mark-active) | 306 | (if (and transient-mark-mode mark-active) |
| 287 | (region-beginning)) | 307 | (region-beginning)) |
| 288 | (if (and transient-mark-mode mark-active) | 308 | (if (and transient-mark-mode mark-active) |
| 289 | (region-end))))) | 309 | (region-end)))))) |
| 290 | (perform-replace regexp (cons 'replace-eval-replacement to-expr) | 310 | (perform-replace regexp (cons 'replace-eval-replacement to-expr) |
| 291 | t 'literal delimited nil nil start end)) | 311 | t 'literal delimited nil nil start end)) |
| 292 | 312 | ||
| @@ -311,17 +331,16 @@ A prefix argument N says to use each replacement string N times | |||
| 311 | before rotating to the next. | 331 | before rotating to the next. |
| 312 | Fourth and fifth arg START and END specify the region to operate on." | 332 | Fourth and fifth arg START and END specify the region to operate on." |
| 313 | (interactive | 333 | (interactive |
| 314 | (let (from to) | 334 | (let* ((from (if query-replace-interactive |
| 315 | (setq from (if query-replace-interactive | ||
| 316 | (car regexp-search-ring) | 335 | (car regexp-search-ring) |
| 317 | (read-from-minibuffer "Map query replace (regexp): " | 336 | (read-from-minibuffer "Map query replace (regexp): " |
| 318 | nil nil nil | 337 | nil nil nil |
| 319 | 'query-replace-history nil t))) | 338 | 'query-replace-history nil t))) |
| 320 | (setq to (read-from-minibuffer | 339 | (to (read-from-minibuffer |
| 321 | (format "Query replace %s with (space-separated strings): " | 340 | (format "Query replace %s with (space-separated strings): " |
| 322 | from) | 341 | (query-replace-descr from)) |
| 323 | nil nil nil | 342 | nil nil nil |
| 324 | 'query-replace-history from t)) | 343 | 'query-replace-history from t))) |
| 325 | (list from to | 344 | (list from to |
| 326 | (and current-prefix-arg | 345 | (and current-prefix-arg |
| 327 | (prefix-numeric-value current-prefix-arg)) | 346 | (prefix-numeric-value current-prefix-arg)) |
| @@ -762,7 +781,7 @@ If the value is nil, don't highlight the buffer names specially." | |||
| 762 | (read-from-minibuffer | 781 | (read-from-minibuffer |
| 763 | (if default | 782 | (if default |
| 764 | (format "List lines matching regexp (default `%s'): " | 783 | (format "List lines matching regexp (default `%s'): " |
| 765 | default) | 784 | (query-replace-descr default)) |
| 766 | "List lines matching regexp: ") | 785 | "List lines matching regexp: ") |
| 767 | nil | 786 | nil |
| 768 | nil | 787 | nil |
| @@ -925,7 +944,6 @@ See also `multi-occur'." | |||
| 925 | (let ((matches 0) ;; count of matched lines | 944 | (let ((matches 0) ;; count of matched lines |
| 926 | (lines 1) ;; line count | 945 | (lines 1) ;; line count |
| 927 | (matchbeg 0) | 946 | (matchbeg 0) |
| 928 | (matchend 0) | ||
| 929 | (origpt nil) | 947 | (origpt nil) |
| 930 | (begpt nil) | 948 | (begpt nil) |
| 931 | (endpt nil) | 949 | (endpt nil) |
| @@ -945,8 +963,7 @@ See also `multi-occur'." | |||
| 945 | (setq origpt (point)) | 963 | (setq origpt (point)) |
| 946 | (when (setq endpt (re-search-forward regexp nil t)) | 964 | (when (setq endpt (re-search-forward regexp nil t)) |
| 947 | (setq matches (1+ matches)) ;; increment match count | 965 | (setq matches (1+ matches)) ;; increment match count |
| 948 | (setq matchbeg (match-beginning 0) | 966 | (setq matchbeg (match-beginning 0)) |
| 949 | matchend (match-end 0)) | ||
| 950 | (setq begpt (save-excursion | 967 | (setq begpt (save-excursion |
| 951 | (goto-char matchbeg) | 968 | (goto-char matchbeg) |
| 952 | (line-beginning-position))) | 969 | (line-beginning-position))) |
| @@ -1542,5 +1559,5 @@ make, or the user didn't cancel the call." | |||
| 1542 | (if (facep 'query-replace) | 1559 | (if (facep 'query-replace) |
| 1543 | 'query-replace 'region))))) | 1560 | 'query-replace 'region))))) |
| 1544 | 1561 | ||
| 1545 | ;;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 | 1562 | ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 |
| 1546 | ;;; replace.el ends here | 1563 | ;;; replace.el ends here |
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 9a61a8057b4..e42c2151701 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el | |||
| @@ -68,24 +68,29 @@ | |||
| 68 | (goto-char (window-start window)) | 68 | (goto-char (window-start window)) |
| 69 | (mac-scroll-up-line))))) | 69 | (mac-scroll-up-line))))) |
| 70 | 70 | ||
| 71 | (defun mac-scroll-ignore-events () | ||
| 72 | ;; Ignore confusing non-mouse events | ||
| 73 | (while (not (memq (car-safe (read-event)) | ||
| 74 | '(mouse-1 double-mouse-1 triple-mouse-1))) nil)) | ||
| 75 | |||
| 71 | (defun mac-scroll-down () | 76 | (defun mac-scroll-down () |
| 72 | (track-mouse | 77 | (track-mouse |
| 73 | (while (not (eq (car-safe (read-event)) 'mouse-1)) nil) | 78 | (mac-scroll-ignore-events) |
| 74 | (scroll-down))) | 79 | (scroll-down))) |
| 75 | 80 | ||
| 76 | (defun mac-scroll-down-line () | 81 | (defun mac-scroll-down-line () |
| 77 | (track-mouse | 82 | (track-mouse |
| 78 | (while (not (eq (car-safe (read-event)) 'mouse-1)) nil) | 83 | (mac-scroll-ignore-events) |
| 79 | (scroll-down 1))) | 84 | (scroll-down 1))) |
| 80 | 85 | ||
| 81 | (defun mac-scroll-up () | 86 | (defun mac-scroll-up () |
| 82 | (track-mouse | 87 | (track-mouse |
| 83 | (while (not (eq (car-safe (read-event)) 'mouse-1)) nil) | 88 | (mac-scroll-ignore-events) |
| 84 | (scroll-up))) | 89 | (scroll-up))) |
| 85 | 90 | ||
| 86 | (defun mac-scroll-up-line () | 91 | (defun mac-scroll-up-line () |
| 87 | (track-mouse | 92 | (track-mouse |
| 88 | (while (not (eq (car-safe (read-event)) 'mouse-1)) nil) | 93 | (mac-scroll-ignore-events) |
| 89 | (scroll-up 1))) | 94 | (scroll-up 1))) |
| 90 | 95 | ||
| 91 | (defun xw-defined-colors (&optional frame) | 96 | (defun xw-defined-colors (&optional frame) |
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index dfb558463fe..cfe47c3ea5d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,34 @@ | |||
| 1 | 2004-07-07 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2 | |||
| 3 | * frames.texi (Input Focus): Clarify descriptions of | ||
| 4 | `select-frame-set-input-focus' and `select-frame'. | ||
| 5 | |||
| 6 | 2004-07-06 Luc Teirlinck <teirllm@auburn.edu> | ||
| 7 | |||
| 8 | * os.texi: Various small changes in addition to: | ||
| 9 | (Killing Emacs): Expand and clarify description of | ||
| 10 | `kill-emacs-query-functions' and `kill-emacs-hook'. | ||
| 11 | (System Environment): Expand and clarify description of `getenv' | ||
| 12 | and `setenv'. | ||
| 13 | (Timers): Clarify description of `run-at-time'. | ||
| 14 | (Translating Input): Correct description of | ||
| 15 | `extra-keyboard-modifiers'. | ||
| 16 | (Flow Control): Correct description of `enable-flow-control'. | ||
| 17 | |||
| 18 | 2004-07-06 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 19 | |||
| 20 | * os.texi: Update copyright. | ||
| 21 | (Session Management): Grammar fix. | ||
| 22 | Clarify which Emacs does the restarting. | ||
| 23 | Use @samp for *scratch* buffer. | ||
| 24 | |||
| 25 | 2004-07-04 Alan Mackenzie <acm@muc.de> | ||
| 26 | |||
| 27 | * frames.texi (Input Focus): Add documentation for | ||
| 28 | `select-frame-set-input-focus'. Replace refs to non-existent | ||
| 29 | `switch-frame' with `select-frame'. Minor corrections and tidying | ||
| 30 | up of text-only terminal stuff. | ||
| 31 | |||
| 1 | 2004-07-02 Richard M. Stallman <rms@gnu.org> | 32 | 2004-07-02 Richard M. Stallman <rms@gnu.org> |
| 2 | 33 | ||
| 3 | * files.texi (Saving Buffers): Cleanup write-contents-function. | 34 | * files.texi (Saving Buffers): Cleanup write-contents-function. |
diff --git a/lispref/frames.texi b/lispref/frames.texi index fe3bca7c119..7188b4f8b97 100644 --- a/lispref/frames.texi +++ b/lispref/frames.texi | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2002 | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2002, 2004 |
| 4 | @c Free Software Foundation, Inc. | 4 | @c Free Software Foundation, Inc. |
| 5 | @c See the file elisp.texi for copying conditions. | 5 | @c See the file elisp.texi for copying conditions. |
| 6 | @setfilename ../info/frames | 6 | @setfilename ../info/frames |
| @@ -996,19 +996,30 @@ This function returns the selected frame. | |||
| 996 | Some window systems and window managers direct keyboard input to the | 996 | Some window systems and window managers direct keyboard input to the |
| 997 | window object that the mouse is in; others require explicit clicks or | 997 | window object that the mouse is in; others require explicit clicks or |
| 998 | commands to @dfn{shift the focus} to various window objects. Either | 998 | commands to @dfn{shift the focus} to various window objects. Either |
| 999 | way, Emacs automatically keeps track of which frame has the focus. | 999 | way, Emacs automatically keeps track of which frame has the focus. To |
| 1000 | switch to a different frame from a Lisp function, call | ||
| 1001 | @code{select-frame-set-input-focus}. | ||
| 1000 | 1002 | ||
| 1001 | Lisp programs can also switch frames ``temporarily'' by calling the | 1003 | Lisp programs can also switch frames ``temporarily'' by calling the |
| 1002 | function @code{select-frame}. This does not alter the window system's | 1004 | function @code{select-frame}. This does not alter the window system's |
| 1003 | concept of focus; rather, it escapes from the window manager's control | 1005 | concept of focus; rather, it escapes from the window manager's control |
| 1004 | until that control is somehow reasserted. | 1006 | until that control is somehow reasserted. |
| 1005 | 1007 | ||
| 1006 | When using a text-only terminal, only the selected terminal frame is | 1008 | When using a text-only terminal, only one frame can be displayed at a |
| 1007 | actually displayed on the terminal. @code{switch-frame} is the only way | 1009 | time on the terminal, so after a call to @code{select-frame}, the next |
| 1008 | to switch frames, and the change lasts until overridden by a subsequent | 1010 | redisplay actually displays the newly selected frame. This frame |
| 1009 | call to @code{switch-frame}. Each terminal screen except for the | 1011 | remains displayed until a subsequent call to @code{select-frame} or |
| 1010 | initial one has a number, and the number of the selected frame appears | 1012 | @code{select-frame-set-input-focus}. Each terminal frame has a number |
| 1011 | in the mode line before the buffer name (@pxref{Mode Line Variables}). | 1013 | which appears in the mode line before the buffer name (@pxref{Mode |
| 1014 | Line Variables}). | ||
| 1015 | |||
| 1016 | @defun select-frame-set-input-focus frame | ||
| 1017 | This function makes @var{frame} the selected frame, raises it (should | ||
| 1018 | it happen to be obscured by other frames) and tries to give it the X | ||
| 1019 | server's focus. On a text-only terminal, the next redisplay displays | ||
| 1020 | the new frame on the entire terminal screen. The return value of this | ||
| 1021 | function is not significant. | ||
| 1022 | @end defun | ||
| 1012 | 1023 | ||
| 1013 | @c ??? This is not yet implemented properly. | 1024 | @c ??? This is not yet implemented properly. |
| 1014 | @defun select-frame frame | 1025 | @defun select-frame frame |
| @@ -1017,7 +1028,8 @@ focus of the X server if any. The selection of @var{frame} lasts until | |||
| 1017 | the next time the user does something to select a different frame, or | 1028 | the next time the user does something to select a different frame, or |
| 1018 | until the next time this function is called. The specified @var{frame} | 1029 | until the next time this function is called. The specified @var{frame} |
| 1019 | becomes the selected frame, as explained above, and the terminal that | 1030 | becomes the selected frame, as explained above, and the terminal that |
| 1020 | @var{frame} is on becomes the selected terminal. | 1031 | @var{frame} is on becomes the selected terminal. This function |
| 1032 | returns @var{frame}, or @code{nil} if @var{frame} has been deleted. | ||
| 1021 | 1033 | ||
| 1022 | In general, you should never use @code{select-frame} in a way that could | 1034 | In general, you should never use @code{select-frame} in a way that could |
| 1023 | switch to a different terminal without switching back when you're done. | 1035 | switch to a different terminal without switching back when you're done. |
diff --git a/lispref/os.texi b/lispref/os.texi index b5814372df9..3e1b93339ad 100644 --- a/lispref/os.texi +++ b/lispref/os.texi | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004 |
| 4 | @c Free Software Foundation, Inc. | 4 | @c Free Software Foundation, Inc. |
| 5 | @c See the file elisp.texi for copying conditions. | 5 | @c See the file elisp.texi for copying conditions. |
| 6 | @setfilename ../info/os | 6 | @setfilename ../info/os |
| @@ -237,7 +237,7 @@ This normal hook is run, once, just before loading all the init files | |||
| 237 | This normal hook is run, once, just after loading all the init files | 237 | This normal hook is run, once, just after loading all the init files |
| 238 | (the user's init file, @file{default.el}, and/or @file{site-start.el}), | 238 | (the user's init file, @file{default.el}, and/or @file{site-start.el}), |
| 239 | before loading the terminal-specific library and processing the | 239 | before loading the terminal-specific library and processing the |
| 240 | command-line arguments. | 240 | command-line action arguments. |
| 241 | @end defvar | 241 | @end defvar |
| 242 | 242 | ||
| 243 | @defvar emacs-startup-hook | 243 | @defvar emacs-startup-hook |
| @@ -248,7 +248,7 @@ arguments, just before @code{term-setup-hook}. | |||
| 248 | 248 | ||
| 249 | @defvar user-init-file | 249 | @defvar user-init-file |
| 250 | @tindex user-init-file | 250 | @tindex user-init-file |
| 251 | This variable holds the file name of the user's init file. If the | 251 | This variable holds the absolute file name of the user's init file. If the |
| 252 | actual init file loaded is a compiled file, such as @file{.emacs.elc}, | 252 | actual init file loaded is a compiled file, such as @file{.emacs.elc}, |
| 253 | the value refers to the corresponding source file. | 253 | the value refers to the corresponding source file. |
| 254 | @end defvar | 254 | @end defvar |
| @@ -471,20 +471,31 @@ been saved, is lost when the Emacs process is killed. Because killing | |||
| 471 | Emacs inadvertently can lose a lot of work, Emacs queries for | 471 | Emacs inadvertently can lose a lot of work, Emacs queries for |
| 472 | confirmation before actually terminating if you have buffers that need | 472 | confirmation before actually terminating if you have buffers that need |
| 473 | saving or subprocesses that are running. This is done in the function | 473 | saving or subprocesses that are running. This is done in the function |
| 474 | @code{save-buffers-kill-emacs}. | 474 | @code{save-buffers-kill-emacs}, the higher level function from which |
| 475 | @code{kill-emacs} is usually called. | ||
| 475 | 476 | ||
| 476 | @defvar kill-emacs-query-functions | 477 | @defvar kill-emacs-query-functions |
| 477 | After asking the standard questions, @code{save-buffers-kill-emacs} | 478 | After asking the standard questions, @code{save-buffers-kill-emacs} |
| 478 | calls the functions in the list @code{kill-emacs-query-functions}, in | 479 | calls the functions in the list @code{kill-emacs-query-functions}, in |
| 479 | order of appearance, with no arguments. These functions can ask for | 480 | order of appearance, with no arguments. These functions can ask for |
| 480 | additional confirmation from the user. If any of them returns | 481 | additional confirmation from the user. If any of them returns |
| 481 | @code{nil}, Emacs is not killed. | 482 | @code{nil}, @code{save-buffers-kill-emacs} does not kill Emacs, and |
| 483 | does not run the remaining functions in this hook. Calling | ||
| 484 | @code{kill-emacs} directly does not run this hook. | ||
| 482 | @end defvar | 485 | @end defvar |
| 483 | 486 | ||
| 484 | @defvar kill-emacs-hook | 487 | @defvar kill-emacs-hook |
| 485 | This variable is a normal hook; once @code{save-buffers-kill-emacs} is | 488 | This variable is a normal hook; once @code{save-buffers-kill-emacs} is |
| 486 | finished with all file saving and confirmation, it runs the functions in | 489 | finished with all file saving and confirmation, it calls |
| 487 | this hook. This hook is not run in batch mode. | 490 | @code{kill-emacs} which runs the functions in this hook. |
| 491 | @code{kill-emacs} does not run this hook in batch mode. | ||
| 492 | |||
| 493 | @code{kill-emacs} may be invoked directly (that is not via | ||
| 494 | @code{save-buffers-kill-emacs}) if the terminal is disconnected, or in | ||
| 495 | similar situations where interaction with the user is not possible. | ||
| 496 | Thus, if your hook needs to interact with the user, put it on | ||
| 497 | @code{kill-emacs-query-functions}; if it needs to run regardless of | ||
| 498 | how Emacs is killed, put it on @code{kill-emacs-hook}. | ||
| 488 | @end defvar | 499 | @end defvar |
| 489 | 500 | ||
| 490 | @node Suspending Emacs | 501 | @node Suspending Emacs |
| @@ -508,7 +519,7 @@ give input to some other job such as a shell merely by moving to a | |||
| 508 | different window. Therefore, suspending is not allowed when Emacs is using | 519 | different window. Therefore, suspending is not allowed when Emacs is using |
| 509 | a window system (X or MS Windows). | 520 | a window system (X or MS Windows). |
| 510 | 521 | ||
| 511 | @defun suspend-emacs string | 522 | @defun suspend-emacs &optional string |
| 512 | This function stops Emacs and returns control to the superior process. | 523 | This function stops Emacs and returns control to the superior process. |
| 513 | If and when the superior process resumes Emacs, @code{suspend-emacs} | 524 | If and when the superior process resumes Emacs, @code{suspend-emacs} |
| 514 | returns @code{nil} to its caller in Lisp. | 525 | returns @code{nil} to its caller in Lisp. |
| @@ -542,10 +553,10 @@ Emacs is suspended. But it is read and executed by the shell. | |||
| 542 | (function (lambda () | 553 | (function (lambda () |
| 543 | (or (y-or-n-p | 554 | (or (y-or-n-p |
| 544 | "Really suspend? ") | 555 | "Really suspend? ") |
| 545 | (error "Suspend cancelled"))))) | 556 | (error "Suspend canceled"))))) |
| 546 | @result{} (lambda nil | 557 | @result{} (lambda nil |
| 547 | (or (y-or-n-p "Really suspend? ") | 558 | (or (y-or-n-p "Really suspend? ") |
| 548 | (error "Suspend cancelled"))) | 559 | (error "Suspend canceled"))) |
| 549 | @end group | 560 | @end group |
| 550 | @group | 561 | @group |
| 551 | (add-hook 'suspend-resume-hook | 562 | (add-hook 'suspend-resume-hook |
| @@ -694,8 +705,10 @@ Emacs was dumped. @xref{Building Emacs}.) | |||
| 694 | @deffn Command getenv var | 705 | @deffn Command getenv var |
| 695 | @cindex environment variable access | 706 | @cindex environment variable access |
| 696 | This function returns the value of the environment variable @var{var}, | 707 | This function returns the value of the environment variable @var{var}, |
| 697 | as a string. Within Emacs, the environment variable values are kept in | 708 | as a string. @var{var} should be a string. If @var{var} is undefined |
| 698 | the Lisp variable @code{process-environment}. | 709 | in the environment, @code{getenv} returns @code{nil}. If returns |
| 710 | @samp{""} if @var{var} is set but null. Within Emacs, the environment | ||
| 711 | variable values are kept in the Lisp variable @code{process-environment}. | ||
| 699 | 712 | ||
| 700 | @example | 713 | @example |
| 701 | @group | 714 | @group |
| @@ -717,11 +730,22 @@ HOME=/user/lewis | |||
| 717 | @end deffn | 730 | @end deffn |
| 718 | 731 | ||
| 719 | @c Emacs 19 feature | 732 | @c Emacs 19 feature |
| 720 | @deffn Command setenv variable value | 733 | @deffn Command setenv variable &optional value |
| 721 | This command sets the value of the environment variable named | 734 | This command sets the value of the environment variable named |
| 722 | @var{variable} to @var{value}. Both arguments should be strings. This | 735 | @var{variable} to @var{value}. @var{variable} should be a string. |
| 723 | function works by modifying @code{process-environment}; binding that | 736 | Internally, Emacs Lisp can handle any string. However, normally |
| 724 | variable with @code{let} is also reasonable practice. | 737 | @var{variable} should be a valid shell identifier, that is, a sequence |
| 738 | of letters, digits and underscores, starting with a letter or | ||
| 739 | underscore. Otherwise, errors may occur if subprocesses of Emacs try | ||
| 740 | to access the value of @var{variable}. If @var{value} is omitted or | ||
| 741 | @code{nil}, @code{setenv} removes @var{variable} from the environment. | ||
| 742 | Otherwise, @var{value} should be a string. | ||
| 743 | |||
| 744 | @code{setenv} works by modifying @code{process-environment}; binding | ||
| 745 | that variable with @code{let} is also reasonable practice. | ||
| 746 | |||
| 747 | @code{setenv} returns the new value of @var{variable}, or @code{nil} | ||
| 748 | if it removed @var{variable} from the environment. | ||
| 725 | @end deffn | 749 | @end deffn |
| 726 | 750 | ||
| 727 | @defvar process-environment | 751 | @defvar process-environment |
| @@ -801,6 +825,10 @@ an error. On some platforms, access to load averages requires | |||
| 801 | installing Emacs as setuid or setgid so that it can read kernel | 825 | installing Emacs as setuid or setgid so that it can read kernel |
| 802 | information, and that usually isn't advisable. | 826 | information, and that usually isn't advisable. |
| 803 | 827 | ||
| 828 | If the 1-minute load average is available, but the 5- or 15-minute | ||
| 829 | averages are not, this function returns a shortened list containing | ||
| 830 | the available averages. | ||
| 831 | |||
| 804 | @example | 832 | @example |
| 805 | @group | 833 | @group |
| 806 | (load-average) | 834 | (load-average) |
| @@ -820,12 +848,14 @@ lewis@@rocky[5] % uptime | |||
| 820 | @end defun | 848 | @end defun |
| 821 | 849 | ||
| 822 | @defun emacs-pid | 850 | @defun emacs-pid |
| 823 | This function returns the process @acronym{ID} of the Emacs process. | 851 | This function returns the process @acronym{ID} of the Emacs process, |
| 852 | as an integer. | ||
| 824 | @end defun | 853 | @end defun |
| 825 | 854 | ||
| 826 | @defvar tty-erase-char | 855 | @defvar tty-erase-char |
| 827 | This variable holds the erase character that was selected | 856 | This variable holds the erase character that was selected |
| 828 | in the system's terminal driver, before Emacs was started. | 857 | in the system's terminal driver, before Emacs was started. |
| 858 | The value is @code{nil} if Emacs is running under a window system. | ||
| 829 | @end defvar | 859 | @end defvar |
| 830 | 860 | ||
| 831 | @defun setprv privilege-name &optional setp getprv | 861 | @defun setprv privilege-name &optional setp getprv |
| @@ -836,7 +866,7 @@ whether the privilege is to be turned on or off. Its default is | |||
| 836 | @code{nil}. The function returns @code{t} if successful, @code{nil} | 866 | @code{nil}. The function returns @code{t} if successful, @code{nil} |
| 837 | otherwise. | 867 | otherwise. |
| 838 | 868 | ||
| 839 | If the third argument, @var{getprv}, is non-@code{nil}, @code{setprv} | 869 | If the third argument, @var{getprv}, is non-@code{nil}, @code{setprv} |
| 840 | does not change the privilege, but returns @code{t} or @code{nil} | 870 | does not change the privilege, but returns @code{t} or @code{nil} |
| 841 | indicating whether the privilege is currently enabled. | 871 | indicating whether the privilege is currently enabled. |
| 842 | @end defun | 872 | @end defun |
| @@ -845,8 +875,9 @@ indicating whether the privilege is currently enabled. | |||
| 845 | @section User Identification | 875 | @section User Identification |
| 846 | 876 | ||
| 847 | @defvar init-file-user | 877 | @defvar init-file-user |
| 848 | This variable says which user's init files should be used by Emacs---or | 878 | This variable says which user's init files should be used by |
| 849 | @code{nil} if none. The value reflects command-line options such as | 879 | Emacs---or @code{nil} if none. @code{""} stands for the user who |
| 880 | originally logged in. The value reflects command-line options such as | ||
| 850 | @samp{-q} or @samp{-u @var{user}}. | 881 | @samp{-q} or @samp{-u @var{user}}. |
| 851 | 882 | ||
| 852 | Lisp packages that load files of customizations, or any other sort of | 883 | Lisp packages that load files of customizations, or any other sort of |
| @@ -873,7 +904,8 @@ is set, that value is used. Otherwise, if the environment variable | |||
| 873 | on the effective @acronym{UID}, not the real @acronym{UID}. | 904 | on the effective @acronym{UID}, not the real @acronym{UID}. |
| 874 | 905 | ||
| 875 | If you specify @var{uid}, the value is the user name that corresponds | 906 | If you specify @var{uid}, the value is the user name that corresponds |
| 876 | to @var{uid} (which should be an integer). | 907 | to @var{uid} (which should be an integer), or @code{nil} if there is |
| 908 | no such user. | ||
| 877 | 909 | ||
| 878 | @example | 910 | @example |
| 879 | @group | 911 | @group |
| @@ -904,7 +936,7 @@ of the environment variable @code{NAME}, if that is set. | |||
| 904 | If the Emacs job's user-id does not correspond to any known user (and | 936 | If the Emacs job's user-id does not correspond to any known user (and |
| 905 | provided @code{NAME} is not set), the value is @code{"unknown"}. | 937 | provided @code{NAME} is not set), the value is @code{"unknown"}. |
| 906 | 938 | ||
| 907 | If @var{uid} is non-@code{nil}, then it should be an integer (a user-id) | 939 | If @var{uid} is non-@code{nil}, then it should be a number (a user-id) |
| 908 | or a string (a login name). Then @code{user-full-name} returns the full | 940 | or a string (a login name). Then @code{user-full-name} returns the full |
| 909 | name corresponding to that user-id or login name. If you specify a | 941 | name corresponding to that user-id or login name. If you specify a |
| 910 | user-id or login name that isn't defined, it returns @code{nil}. | 942 | user-id or login name that isn't defined, it returns @code{nil}. |
| @@ -956,7 +988,8 @@ The argument @var{time-value}, if given, specifies a time to format | |||
| 956 | instead of the current time. The argument should be a list whose first | 988 | instead of the current time. The argument should be a list whose first |
| 957 | two elements are integers. Thus, you can use times obtained from | 989 | two elements are integers. Thus, you can use times obtained from |
| 958 | @code{current-time} (see below) and from @code{file-attributes} | 990 | @code{current-time} (see below) and from @code{file-attributes} |
| 959 | (@pxref{File Attributes}). | 991 | (@pxref{Definition of file-attributes}). @var{time-value} can also be |
| 992 | a cons of two integers, but this is considered obsolete. | ||
| 960 | 993 | ||
| 961 | @example | 994 | @example |
| 962 | @group | 995 | @group |
| @@ -971,7 +1004,7 @@ two elements are integers. Thus, you can use times obtained from | |||
| 971 | This function returns the system's time value as a list of three | 1004 | This function returns the system's time value as a list of three |
| 972 | integers: @code{(@var{high} @var{low} @var{microsec})}. The integers | 1005 | integers: @code{(@var{high} @var{low} @var{microsec})}. The integers |
| 973 | @var{high} and @var{low} combine to give the number of seconds since | 1006 | @var{high} and @var{low} combine to give the number of seconds since |
| 974 | 0:00 January 1, 1970 (local time), which is | 1007 | 0:00 January 1, 1970 UTC (Coordinated Universal Time), which is |
| 975 | @ifnottex | 1008 | @ifnottex |
| 976 | @var{high} * 2**16 + @var{low}. | 1009 | @var{high} * 2**16 + @var{low}. |
| 977 | @end ifnottex | 1010 | @end ifnottex |
| @@ -984,7 +1017,8 @@ start of the current second (or 0 for systems that return time with | |||
| 984 | the resolution of only one second). | 1017 | the resolution of only one second). |
| 985 | 1018 | ||
| 986 | The first two elements can be compared with file time values such as you | 1019 | The first two elements can be compared with file time values such as you |
| 987 | get with the function @code{file-attributes}. @xref{File Attributes}. | 1020 | get with the function @code{file-attributes}. |
| 1021 | @xref{Definition of file-attributes}. | ||
| 988 | @end defun | 1022 | @end defun |
| 989 | 1023 | ||
| 990 | @c Emacs 19 feature | 1024 | @c Emacs 19 feature |
| @@ -1001,20 +1035,21 @@ if the user has specified a time zone that does not use a seasonal time | |||
| 1001 | adjustment, then the value is constant through time. | 1035 | adjustment, then the value is constant through time. |
| 1002 | 1036 | ||
| 1003 | If the operating system doesn't supply all the information necessary to | 1037 | If the operating system doesn't supply all the information necessary to |
| 1004 | compute the value, both elements of the list are @code{nil}. | 1038 | compute the value, the unknown elements of the list are @code{nil}. |
| 1005 | 1039 | ||
| 1006 | The argument @var{time-value}, if given, specifies a time to analyze | 1040 | The argument @var{time-value}, if given, specifies a time to analyze |
| 1007 | instead of the current time. The argument should be a cons cell | 1041 | instead of the current time. The argument should have the same form |
| 1008 | containing two integers, or a list whose first two elements are | 1042 | as for @code{current-time-string} (see above). Thus, you can use |
| 1009 | integers. Thus, you can use times obtained from @code{current-time} | 1043 | times obtained from @code{current-time} (see above) and from |
| 1010 | (see above) and from @code{file-attributes} (@pxref{File Attributes}). | 1044 | @code{file-attributes}. @xref{Definition of file-attributes}. |
| 1011 | @end defun | 1045 | @end defun |
| 1012 | 1046 | ||
| 1013 | @defun set-time-zone-rule tz | 1047 | @defun set-time-zone-rule tz |
| 1014 | This function specifies the local time zone according to @var{tz}. If | 1048 | This function specifies the local time zone according to @var{tz}. If |
| 1015 | @var{tz} is @code{nil}, that means to use an implementation-defined | 1049 | @var{tz} is @code{nil}, that means to use an implementation-defined |
| 1016 | default time zone. If @var{tz} is @code{t}, that means to use | 1050 | default time zone. If @var{tz} is @code{t}, that means to use |
| 1017 | Universal Time. | 1051 | Universal Time. Otherwise, @var{tz} should be a string specifying a |
| 1052 | time zone rule. | ||
| 1018 | @end defun | 1053 | @end defun |
| 1019 | 1054 | ||
| 1020 | @defun float-time &optional time-value | 1055 | @defun float-time &optional time-value |
| @@ -1022,7 +1057,7 @@ This function returns the current time as a floating-point number of | |||
| 1022 | seconds since the epoch. The argument @var{time-value}, if given, | 1057 | seconds since the epoch. The argument @var{time-value}, if given, |
| 1023 | specifies a time to convert instead of the current time. The argument | 1058 | specifies a time to convert instead of the current time. The argument |
| 1024 | should have the same form as for @code{current-time-string} (see | 1059 | should have the same form as for @code{current-time-string} (see |
| 1025 | above), and it also accepts the output of @code{current-time} and | 1060 | above). Thus, it accepts the output of @code{current-time} and |
| 1026 | @code{file-attributes}. | 1061 | @code{file-attributes}. |
| 1027 | 1062 | ||
| 1028 | @emph{Warning}: Since the result is floating point, it may not be | 1063 | @emph{Warning}: Since the result is floating point, it may not be |
| @@ -1036,7 +1071,7 @@ exact. Do not use this function if precise time stamps are required. | |||
| 1036 | to strings or to calendrical information. There is also a function to | 1071 | to strings or to calendrical information. There is also a function to |
| 1037 | convert calendrical information to a time value. You can get time | 1072 | convert calendrical information to a time value. You can get time |
| 1038 | values from the functions @code{current-time} (@pxref{Time of Day}) and | 1073 | values from the functions @code{current-time} (@pxref{Time of Day}) and |
| 1039 | @code{file-attributes} (@pxref{File Attributes}). | 1074 | @code{file-attributes} (@pxref{Definition of file-attributes}). |
| 1040 | 1075 | ||
| 1041 | Many operating systems are limited to time values that contain 32 bits | 1076 | Many operating systems are limited to time values that contain 32 bits |
| 1042 | of information; these systems typically handle only the times from | 1077 | of information; these systems typically handle only the times from |
| @@ -1189,6 +1224,7 @@ Here is what the elements mean: | |||
| 1189 | @table @var | 1224 | @table @var |
| 1190 | @item seconds | 1225 | @item seconds |
| 1191 | The number of seconds past the minute, as an integer between 0 and 59. | 1226 | The number of seconds past the minute, as an integer between 0 and 59. |
| 1227 | On some operating systems, this is 60 for leap seconds. | ||
| 1192 | @item minutes | 1228 | @item minutes |
| 1193 | The number of minutes past the hour, as an integer between 0 and 59. | 1229 | The number of minutes past the hour, as an integer between 0 and 59. |
| 1194 | @item hour | 1230 | @item hour |
| @@ -1225,9 +1261,9 @@ yourself before you call @code{encode-time}. | |||
| 1225 | The optional argument @var{zone} defaults to the current time zone and | 1261 | The optional argument @var{zone} defaults to the current time zone and |
| 1226 | its daylight savings time rules. If specified, it can be either a list | 1262 | its daylight savings time rules. If specified, it can be either a list |
| 1227 | (as you would get from @code{current-time-zone}), a string as in the | 1263 | (as you would get from @code{current-time-zone}), a string as in the |
| 1228 | @code{TZ} environment variable, or an integer (as you would get from | 1264 | @code{TZ} environment variable, @code{t} for Universal Time, or an |
| 1229 | @code{decode-time}). The specified zone is used without any further | 1265 | integer (as you would get from @code{decode-time}). The specified |
| 1230 | alteration for daylight savings time. | 1266 | zone is used without any further alteration for daylight savings time. |
| 1231 | 1267 | ||
| 1232 | If you pass more than seven arguments to @code{encode-time}, the first | 1268 | If you pass more than seven arguments to @code{encode-time}, the first |
| 1233 | six are used as @var{seconds} through @var{year}, the last argument is | 1269 | six are used as @var{seconds} through @var{year}, the last argument is |
| @@ -1309,15 +1345,18 @@ because most timer functions don't do a lot of work. Indeed, for a | |||
| 1309 | timer to call a function that takes substantial time to run is likely | 1345 | timer to call a function that takes substantial time to run is likely |
| 1310 | to be annoying. | 1346 | to be annoying. |
| 1311 | 1347 | ||
| 1312 | @defun run-at-time time repeat function &rest args | 1348 | @deffn Command run-at-time time repeat function &rest args |
| 1313 | This function arranges to call @var{function} with arguments @var{args} | 1349 | This sets up a timer that calls the function @var{function} with |
| 1314 | at time @var{time}. The argument @var{function} is a function to call | 1350 | arguments @var{args} at time @var{time}. If @var{repeat} is a number |
| 1315 | later, and @var{args} are the arguments to give it when it is called. | 1351 | (integer or floating point), the timer also runs every @var{repeat} |
| 1316 | The time @var{time} is specified as a string. | 1352 | seconds after that. If @var{repeat} is @code{nil}, the timer runs |
| 1353 | only once. | ||
| 1354 | |||
| 1355 | @var{time} may specify an absolute or a relative time. | ||
| 1317 | 1356 | ||
| 1318 | Absolute times may be specified in a wide variety of formats; this | 1357 | Absolute times may be specified in a wide variety of formats; this |
| 1319 | function tries to accept all the commonly used date formats. Valid | 1358 | function tries to accept all the commonly used date formats. The most |
| 1320 | formats include these two, | 1359 | convenient formats are strings. Valid such formats include these two, |
| 1321 | 1360 | ||
| 1322 | @example | 1361 | @example |
| 1323 | @var{year}-@var{month}-@var{day} @var{hour}:@var{min}:@var{sec} @var{timezone} | 1362 | @var{year}-@var{month}-@var{day} @var{hour}:@var{min}:@var{sec} @var{timezone} |
| @@ -1330,7 +1369,7 @@ where in both examples all fields are numbers; the format that | |||
| 1330 | @code{current-time-string} returns is also allowed, and many others | 1369 | @code{current-time-string} returns is also allowed, and many others |
| 1331 | as well. | 1370 | as well. |
| 1332 | 1371 | ||
| 1333 | To specify a relative time, use numbers followed by units. | 1372 | To specify a relative time as a string, use numbers followed by units. |
| 1334 | For example: | 1373 | For example: |
| 1335 | 1374 | ||
| 1336 | @table @samp | 1375 | @table @samp |
| @@ -1345,13 +1384,9 @@ denotes exactly 103 months, 123 days, and 10862 seconds from now. | |||
| 1345 | For relative time values, Emacs considers a month to be exactly thirty | 1384 | For relative time values, Emacs considers a month to be exactly thirty |
| 1346 | days, and a year to be exactly 365.25 days. | 1385 | days, and a year to be exactly 365.25 days. |
| 1347 | 1386 | ||
| 1348 | If @var{time} is a number (integer or floating point), that specifies a | 1387 | Not all convenient formats are strings. If @var{time} is a number |
| 1349 | relative time measured in seconds. | 1388 | (integer or floating point), that specifies a relative time measured |
| 1350 | 1389 | in seconds. | |
| 1351 | The argument @var{repeat} specifies how often to repeat the call. If | ||
| 1352 | @var{repeat} is @code{nil}, there are no repetitions; @var{function} is | ||
| 1353 | called just once, at @var{time}. If @var{repeat} is a number, it | ||
| 1354 | specifies a repetition period measured in seconds. | ||
| 1355 | 1390 | ||
| 1356 | In most cases, @var{repeat} has no effect on when @emph{first} call | 1391 | In most cases, @var{repeat} has no effect on when @emph{first} call |
| 1357 | takes place---@var{time} alone specifies that. There is one exception: | 1392 | takes place---@var{time} alone specifies that. There is one exception: |
| @@ -1362,7 +1397,7 @@ functions like @code{display-time}. | |||
| 1362 | The function @code{run-at-time} returns a timer value that identifies | 1397 | The function @code{run-at-time} returns a timer value that identifies |
| 1363 | the particular scheduled future action. You can use this value to call | 1398 | the particular scheduled future action. You can use this value to call |
| 1364 | @code{cancel-timer} (see below). | 1399 | @code{cancel-timer} (see below). |
| 1365 | @end defun | 1400 | @end deffn |
| 1366 | 1401 | ||
| 1367 | @defmac with-timeout (seconds timeout-forms@dots{}) body@dots{} | 1402 | @defmac with-timeout (seconds timeout-forms@dots{}) body@dots{} |
| 1368 | Execute @var{body}, but give up after @var{seconds} seconds. If | 1403 | Execute @var{body}, but give up after @var{seconds} seconds. If |
| @@ -1388,7 +1423,7 @@ calls one of those primitives. So use @code{with-timeout} only with a | |||
| 1388 | a timer to avoid waiting too long for an answer. @xref{Yes-or-No | 1423 | a timer to avoid waiting too long for an answer. @xref{Yes-or-No |
| 1389 | Queries}. | 1424 | Queries}. |
| 1390 | 1425 | ||
| 1391 | @defun run-with-idle-timer secs repeat function &rest args | 1426 | @deffn Command run-with-idle-timer secs repeat function &rest args |
| 1392 | Set up a timer which runs when Emacs has been idle for @var{secs} | 1427 | Set up a timer which runs when Emacs has been idle for @var{secs} |
| 1393 | seconds. The value of @var{secs} may be an integer or a floating point | 1428 | seconds. The value of @var{secs} may be an integer or a floating point |
| 1394 | number. | 1429 | number. |
| @@ -1400,7 +1435,7 @@ remains idle for @var{secs} seconds. | |||
| 1400 | 1435 | ||
| 1401 | The function @code{run-with-idle-timer} returns a timer value which you | 1436 | The function @code{run-with-idle-timer} returns a timer value which you |
| 1402 | can use in calling @code{cancel-timer} (see below). | 1437 | can use in calling @code{cancel-timer} (see below). |
| 1403 | @end defun | 1438 | @end deffn |
| 1404 | 1439 | ||
| 1405 | @cindex idleness | 1440 | @cindex idleness |
| 1406 | Emacs becomes ``idle'' when it starts waiting for user input, and it | 1441 | Emacs becomes ``idle'' when it starts waiting for user input, and it |
| @@ -1426,8 +1461,8 @@ set up to repeat will subsequently run another time, one by one. | |||
| 1426 | @defun cancel-timer timer | 1461 | @defun cancel-timer timer |
| 1427 | Cancel the requested action for @var{timer}, which should be a value | 1462 | Cancel the requested action for @var{timer}, which should be a value |
| 1428 | previously returned by @code{run-at-time} or @code{run-with-idle-timer}. | 1463 | previously returned by @code{run-at-time} or @code{run-with-idle-timer}. |
| 1429 | This cancels the effect of that call to @code{run-at-time}; the arrival | 1464 | This cancels the effect of that call to one of these functions; the |
| 1430 | of the specified time will not cause anything special to happen. | 1465 | arrival of the specified time will not cause anything special to happen. |
| 1431 | @end defun | 1466 | @end defun |
| 1432 | 1467 | ||
| 1433 | @node Terminal Input | 1468 | @node Terminal Input |
| @@ -1450,7 +1485,7 @@ functions. | |||
| 1450 | @cindex input modes | 1485 | @cindex input modes |
| 1451 | @cindex terminal input modes | 1486 | @cindex terminal input modes |
| 1452 | 1487 | ||
| 1453 | @defun set-input-mode interrupt flow meta quit-char | 1488 | @defun set-input-mode interrupt flow meta &optional quit-char |
| 1454 | This function sets the mode for reading keyboard input. If | 1489 | This function sets the mode for reading keyboard input. If |
| 1455 | @var{interrupt} is non-null, then Emacs uses input interrupts. If it is | 1490 | @var{interrupt} is non-null, then Emacs uses input interrupts. If it is |
| 1456 | @code{nil}, then it uses @sc{cbreak} mode. The default setting is | 1491 | @code{nil}, then it uses @sc{cbreak} mode. The default setting is |
| @@ -1523,31 +1558,30 @@ being read; then subsequences containing it are checked first with | |||
| 1523 | @c Emacs 19 feature | 1558 | @c Emacs 19 feature |
| 1524 | @defvar extra-keyboard-modifiers | 1559 | @defvar extra-keyboard-modifiers |
| 1525 | This variable lets Lisp programs ``press'' the modifier keys on the | 1560 | This variable lets Lisp programs ``press'' the modifier keys on the |
| 1526 | keyboard. The value is a bit mask: | 1561 | keyboard. The value is a character. Only the modifiers of the |
| 1527 | 1562 | character matter. Each time the user types a keyboard key, it is | |
| 1528 | @table @asis | 1563 | altered as if those modifier keys were held down. For instance, if |
| 1529 | @item 1 | 1564 | you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all |
| 1530 | The @key{SHIFT} key. | 1565 | keyboard input characters typed during the scope of the binding will |
| 1531 | @item 2 | 1566 | have the control and meta modifiers applied to them. The character |
| 1532 | The @key{LOCK} key. | 1567 | @code{?\C-@@}, equivalent to the integer 0, does not count as a control |
| 1533 | @item 4 | 1568 | character for this purpose, but as a character with no modifiers. |
| 1534 | The @key{CTL} key. | 1569 | Thus, setting @code{extra-keyboard-modifiers} to zero cancels any |
| 1535 | @item 8 | 1570 | modification. |
| 1536 | The @key{META} key. | ||
| 1537 | @end table | ||
| 1538 | |||
| 1539 | Each time the user types a keyboard key, it is altered as if the | ||
| 1540 | modifier keys specified in the bit mask were held down. | ||
| 1541 | 1571 | ||
| 1542 | When using a window system, the program can ``press'' any of the | 1572 | When using a window system, the program can ``press'' any of the |
| 1543 | modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} | 1573 | modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} |
| 1544 | keys can be virtually pressed. | 1574 | keys can be virtually pressed. |
| 1575 | |||
| 1576 | Note that this variable applies only to events that really come from | ||
| 1577 | the keyboard, and has no effect on mouse events or any other events. | ||
| 1545 | @end defvar | 1578 | @end defvar |
| 1546 | 1579 | ||
| 1547 | @defvar keyboard-translate-table | 1580 | @defvar keyboard-translate-table |
| 1548 | This variable is the translate table for keyboard characters. It lets | 1581 | This variable is the translate table for keyboard characters. It lets |
| 1549 | you reshuffle the keys on the keyboard without changing any command | 1582 | you reshuffle the keys on the keyboard without changing any command |
| 1550 | bindings. Its value is normally a char-table, or else @code{nil}. | 1583 | bindings. Its value is normally a char-table, or else @code{nil}. |
| 1584 | (It can also be a string or vector, but this is considered obsolete.) | ||
| 1551 | 1585 | ||
| 1552 | If @code{keyboard-translate-table} is a char-table | 1586 | If @code{keyboard-translate-table} is a char-table |
| 1553 | (@pxref{Char-Tables}), then each character read from the keyboard is | 1587 | (@pxref{Char-Tables}), then each character read from the keyboard is |
| @@ -1587,6 +1621,11 @@ Note that this translation is the first thing that happens to a | |||
| 1587 | character after it is read from the terminal. Record-keeping features | 1621 | character after it is read from the terminal. Record-keeping features |
| 1588 | such as @code{recent-keys} and dribble files record the characters after | 1622 | such as @code{recent-keys} and dribble files record the characters after |
| 1589 | translation. | 1623 | translation. |
| 1624 | |||
| 1625 | Note also that this translation is done before the characters are | ||
| 1626 | supplied to input methods (@pxref{Input Methods}). Use | ||
| 1627 | @code{translation-table-for-input} (@pxref{Translation of Characters}), | ||
| 1628 | if you want to translate characters after input methods operate. | ||
| 1590 | @end defvar | 1629 | @end defvar |
| 1591 | 1630 | ||
| 1592 | @defun keyboard-translate from to | 1631 | @defun keyboard-translate from to |
| @@ -1699,7 +1738,7 @@ to turn the character that follows into a Hyper character: | |||
| 1699 | 1738 | ||
| 1700 | Finally, if you have enabled keyboard character set decoding using | 1739 | Finally, if you have enabled keyboard character set decoding using |
| 1701 | @code{set-keyboard-coding-system}, decoding is done after the | 1740 | @code{set-keyboard-coding-system}, decoding is done after the |
| 1702 | translations listed above. @xref{Specifying Coding Systems}. In future | 1741 | translations listed above. @xref{Terminal I/O Encoding}. In future |
| 1703 | Emacs versions, character set decoding may be done before the other | 1742 | Emacs versions, character set decoding may be done before the other |
| 1704 | translations. | 1743 | translations. |
| 1705 | 1744 | ||
| @@ -1804,7 +1843,10 @@ often than to actual Emacs bugs. Once you are certain which characters | |||
| 1804 | were actually output, you can determine reliably whether they correspond | 1843 | were actually output, you can determine reliably whether they correspond |
| 1805 | to the Termcap specifications in use. | 1844 | to the Termcap specifications in use. |
| 1806 | 1845 | ||
| 1807 | See also @code{open-dribble-file} in @ref{Terminal Input}. | 1846 | You close the termscript file by calling this function with an |
| 1847 | argument of @code{nil}. | ||
| 1848 | |||
| 1849 | See also @code{open-dribble-file} in @ref{Recording Input}. | ||
| 1808 | 1850 | ||
| 1809 | @example | 1851 | @example |
| 1810 | @group | 1852 | @group |
| @@ -1969,10 +2011,16 @@ terminals, the flow control problem is gradually disappearing. For the | |||
| 1969 | mean time, Emacs provides a convenient way of enabling flow control if | 2011 | mean time, Emacs provides a convenient way of enabling flow control if |
| 1970 | you want it: call the function @code{enable-flow-control}. | 2012 | you want it: call the function @code{enable-flow-control}. |
| 1971 | 2013 | ||
| 1972 | @deffn Command enable-flow-control | 2014 | @deffn Command enable-flow-control &optional arg |
| 1973 | This function enables use of @kbd{C-s} and @kbd{C-q} for output flow | 2015 | When @var{arg} is a positive integer, this function enables use of |
| 1974 | control, and provides the characters @kbd{C-\} and @kbd{C-^} as aliases | 2016 | @kbd{C-s} and @kbd{C-q} for output flow control, and provides the |
| 1975 | for them using @code{keyboard-translate-table} (@pxref{Translating Input}). | 2017 | characters @kbd{C-\} and @kbd{C-^} as aliases for them using |
| 2018 | @code{keyboard-translate-table} (@pxref{Translating Input}). | ||
| 2019 | |||
| 2020 | When @var{arg} is a negative integer or zero, it disables these | ||
| 2021 | features. When @var{arg} is @code{nil} or omitted, it toggles. | ||
| 2022 | Interactively, @var{arg} is the prefix argument. If non-@code{nil}, | ||
| 2023 | its numeric value is used. | ||
| 1976 | @end deffn | 2024 | @end deffn |
| 1977 | 2025 | ||
| 1978 | You can use the function @code{enable-flow-control-on} in your | 2026 | You can use the function @code{enable-flow-control-on} in your |
| @@ -1994,7 +2042,7 @@ if the terminal type is one of @var{termtypes}. For example: | |||
| 1994 | @item | 2042 | @item |
| 1995 | @cindex @sc{cbreak} | 2043 | @cindex @sc{cbreak} |
| 1996 | It sets @sc{cbreak} mode for terminal input, and tells the operating | 2044 | It sets @sc{cbreak} mode for terminal input, and tells the operating |
| 1997 | system to handle flow control, with @code{(set-input-mode nil t)}. | 2045 | system to handle flow control. This is done using @code{set-input-mode}. |
| 1998 | 2046 | ||
| 1999 | @item | 2047 | @item |
| 2000 | It sets up @code{keyboard-translate-table} to translate @kbd{C-\} and | 2048 | It sets up @code{keyboard-translate-table} to translate @kbd{C-\} and |
| @@ -2061,17 +2109,18 @@ saved session to restore. For Emacs, this argument is @samp{--smid | |||
| 2061 | Emacs supports saving state by using a hook called | 2109 | Emacs supports saving state by using a hook called |
| 2062 | @code{emacs-save-session-functions}. Each function in this hook is | 2110 | @code{emacs-save-session-functions}. Each function in this hook is |
| 2063 | called when the session manager tells Emacs that the window system is | 2111 | called when the session manager tells Emacs that the window system is |
| 2064 | shutting down. The functions are called with the current buffer set | 2112 | shutting down. The functions are called with no arguments and with the |
| 2065 | to a temporary buffer. Each functions can use @code{insert} to add | 2113 | current buffer set to a temporary buffer. Each function can use |
| 2066 | Lisp code to this buffer. At the end, Emacs saves the buffer in a | 2114 | @code{insert} to add Lisp code to this buffer. At the end, Emacs |
| 2067 | file that Emacs will load in order to restart the saved session. | 2115 | saves the buffer in a file that a subsequent Emacs invocation will |
| 2116 | load in order to restart the saved session. | ||
| 2068 | 2117 | ||
| 2069 | If a function in @code{emacs-save-session-functions} returns | 2118 | If a function in @code{emacs-save-session-functions} returns |
| 2070 | non-@code{nil}, Emacs tells the session manager to cancel the | 2119 | non-@code{nil}, Emacs tells the session manager to cancel the |
| 2071 | shutdown. | 2120 | shutdown. |
| 2072 | @end defvar | 2121 | @end defvar |
| 2073 | 2122 | ||
| 2074 | Here is an example that just inserts some text into *scratch* when | 2123 | Here is an example that just inserts some text into @samp{*scratch*} when |
| 2075 | Emacs is restarted by the session manager. | 2124 | Emacs is restarted by the session manager. |
| 2076 | 2125 | ||
| 2077 | @example | 2126 | @example |
diff --git a/src/ChangeLog b/src/ChangeLog index 6ba3196d4e7..758118e3236 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | 2004-07-06 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2 | |||
| 3 | * keyboard.c (syms_of_keyboard): Fix `keyboard-translate-table' | ||
| 4 | docstring. | ||
| 5 | |||
| 6 | * fns.c (Fclear_string): Declare `len' before call to CHECK_STRING. | ||
| 7 | |||
| 8 | 2004-07-06 John Paul Wallington <jpw@gnu.org> | ||
| 9 | |||
| 10 | * eval.c (Fdefmacro): Signal an error if NAME is not a symbol. | ||
| 11 | |||
| 12 | * fns.c (Fclear_string): Signal an error if STRING is not a string. | ||
| 13 | |||
| 14 | 2004-07-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 15 | |||
| 16 | * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList | ||
| 17 | instead of CGMainDisplayID (only in OSX 10.2 and later). | ||
| 18 | |||
| 19 | 2004-07-04 John Paul Wallington <jpw@gnu.org> | ||
| 20 | |||
| 21 | * fileio.c (read_file_name_completion_ignore_case): New variable. | ||
| 22 | (syms_of_fileio): Declare and initialise it. | ||
| 23 | (Fread_file_name): Bind `completion-ignore-case' to respect it. | ||
| 24 | |||
| 1 | 2004-07-03 Eli Zaretskii <eliz@gnu.org> | 25 | 2004-07-03 Eli Zaretskii <eliz@gnu.org> |
| 2 | 26 | ||
| 3 | * msdos.c (dos_rawgetc): Use make_number to produce Lisp objects | 27 | * msdos.c (dos_rawgetc): Use make_number to produce Lisp objects |
diff --git a/src/eval.c b/src/eval.c index 096755f9c77..d7cfe959158 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -657,6 +657,7 @@ usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */) | |||
| 657 | Lisp_Object lambda_list, doc, tail; | 657 | Lisp_Object lambda_list, doc, tail; |
| 658 | 658 | ||
| 659 | fn_name = Fcar (args); | 659 | fn_name = Fcar (args); |
| 660 | CHECK_SYMBOL (fn_name); | ||
| 660 | lambda_list = Fcar (Fcdr (args)); | 661 | lambda_list = Fcar (Fcdr (args)); |
| 661 | tail = Fcdr (Fcdr (args)); | 662 | tail = Fcdr (Fcdr (args)); |
| 662 | 663 | ||
diff --git a/src/fileio.c b/src/fileio.c index 6a95572ca3c..2a4d5fb230e 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -208,6 +208,9 @@ Lisp_Object Vread_file_name_function; | |||
| 208 | /* Current predicate used by read_file_name_internal. */ | 208 | /* Current predicate used by read_file_name_internal. */ |
| 209 | Lisp_Object Vread_file_name_predicate; | 209 | Lisp_Object Vread_file_name_predicate; |
| 210 | 210 | ||
| 211 | /* Nonzero means completion ignores case when reading file name. */ | ||
| 212 | int read_file_name_completion_ignore_case; | ||
| 213 | |||
| 211 | /* Nonzero means, when reading a filename in the minibuffer, | 214 | /* Nonzero means, when reading a filename in the minibuffer, |
| 212 | start out by inserting the default directory into the minibuffer. */ | 215 | start out by inserting the default directory into the minibuffer. */ |
| 213 | int insert_default_directory; | 216 | int insert_default_directory; |
| @@ -6286,10 +6289,8 @@ provides a file dialog box. */) | |||
| 6286 | } | 6289 | } |
| 6287 | 6290 | ||
| 6288 | count = SPECPDL_INDEX (); | 6291 | count = SPECPDL_INDEX (); |
| 6289 | #if defined VMS || defined DOS_NT || defined MAC_OSX | 6292 | specbind (intern ("completion-ignore-case"), |
| 6290 | specbind (intern ("completion-ignore-case"), Qt); | 6293 | read_file_name_completion_ignore_case ? Qt : Qnil); |
| 6291 | #endif | ||
| 6292 | |||
| 6293 | specbind (intern ("minibuffer-completing-file-name"), Qt); | 6294 | specbind (intern ("minibuffer-completing-file-name"), Qt); |
| 6294 | specbind (intern ("read-file-name-predicate"), | 6295 | specbind (intern ("read-file-name-predicate"), |
| 6295 | (NILP (predicate) ? Qfile_exists_p : predicate)); | 6296 | (NILP (predicate) ? Qfile_exists_p : predicate)); |
| @@ -6525,6 +6526,14 @@ same format as a regular save would use. */); | |||
| 6525 | doc: /* Current predicate used by `read-file-name-internal'. */); | 6526 | doc: /* Current predicate used by `read-file-name-internal'. */); |
| 6526 | Vread_file_name_predicate = Qnil; | 6527 | Vread_file_name_predicate = Qnil; |
| 6527 | 6528 | ||
| 6529 | DEFVAR_BOOL ("read-file-name-completion-ignore-case", &read_file_name_completion_ignore_case, | ||
| 6530 | doc: /* *Non-nil means when reading a file name completion ignores case. */); | ||
| 6531 | #if defined VMS || defined DOS_NT || defined MAC_OS | ||
| 6532 | read_file_name_completion_ignore_case = 1; | ||
| 6533 | #else | ||
| 6534 | read_file_name_completion_ignore_case = 0; | ||
| 6535 | #endif | ||
| 6536 | |||
| 6528 | DEFVAR_BOOL ("insert-default-directory", &insert_default_directory, | 6537 | DEFVAR_BOOL ("insert-default-directory", &insert_default_directory, |
| 6529 | doc: /* *Non-nil means when reading a filename start with default dir in minibuffer. | 6538 | doc: /* *Non-nil means when reading a filename start with default dir in minibuffer. |
| 6530 | If the initial minibuffer contents are non-empty, you can usually | 6539 | If the initial minibuffer contents are non-empty, you can usually |
| @@ -2370,7 +2370,9 @@ This makes STRING unibyte and may change its length. */) | |||
| 2370 | (string) | 2370 | (string) |
| 2371 | Lisp_Object string; | 2371 | Lisp_Object string; |
| 2372 | { | 2372 | { |
| 2373 | int len = SBYTES (string); | 2373 | int len; |
| 2374 | CHECK_STRING (string); | ||
| 2375 | len = SBYTES (string); | ||
| 2374 | bzero (SDATA (string), len); | 2376 | bzero (SDATA (string), len); |
| 2375 | STRING_SET_CHARS (string, len); | 2377 | STRING_SET_CHARS (string, len); |
| 2376 | STRING_SET_UNIBYTE (string); | 2378 | STRING_SET_UNIBYTE (string); |
diff --git a/src/keyboard.c b/src/keyboard.c index 8670308ba08..7c1c6f3f463 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -11285,11 +11285,13 @@ Useful to set before you dump a modified Emacs. */); | |||
| 11285 | 11285 | ||
| 11286 | DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table, | 11286 | DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table, |
| 11287 | doc: /* Translate table for keyboard input, or nil. | 11287 | doc: /* Translate table for keyboard input, or nil. |
| 11288 | Each character is looked up in this string and the contents used instead. | 11288 | If non-nil, the value should be a char-table. Each character read |
| 11289 | The value may be a string, a vector, or a char-table. | 11289 | from the keyboard is looked up in this char-table. If the value found |
| 11290 | If it is a string or vector of length N, | 11290 | there is non-nil, then it is used instead of the actual input character. |
| 11291 | character codes N and up are untranslated. | 11291 | |
| 11292 | In a vector or a char-table, an element which is nil means "no translation". | 11292 | The value can also be a string or vector, but this is considered obsolete. |
| 11293 | If it is a string or vector of length N, character codes N and up are left | ||
| 11294 | untranslated. In a vector, an element which is nil means "no translation". | ||
| 11293 | 11295 | ||
| 11294 | This is applied to the characters supplied to input methods, not their | 11296 | This is applied to the characters supplied to input methods, not their |
| 11295 | output. See also `translation-table-for-input'. */); | 11297 | output. See also `translation-table-for-input'. */); |
diff --git a/src/macterm.c b/src/macterm.c index 43a04dc65ec..efe3d166d11 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -8854,8 +8854,21 @@ mac_initialize_display_info () | |||
| 8854 | dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); | 8854 | dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); |
| 8855 | #ifdef MAC_OSX | 8855 | #ifdef MAC_OSX |
| 8856 | /* HasDepth returns true if it is possible to have a 32 bit display, | 8856 | /* HasDepth returns true if it is possible to have a 32 bit display, |
| 8857 | but this may not be what is actually used. Mac OSX can do better. */ | 8857 | but this may not be what is actually used. Mac OSX can do better. |
| 8858 | dpyinfo->n_planes = CGDisplayBitsPerPixel (CGMainDisplayID ()); | 8858 | CGMainDisplayID is only available on OSX 10.2 and higher, but the |
| 8859 | header for CGGetActiveDisplayList says that the first display returned | ||
| 8860 | is the active one, so we use that. */ | ||
| 8861 | { | ||
| 8862 | CGDirectDisplayID disp_id[1]; | ||
| 8863 | CGDisplayCount disp_count; | ||
| 8864 | CGDisplayErr error_code; | ||
| 8865 | |||
| 8866 | error_code = CGGetActiveDisplayList (1, disp_id, &disp_count); | ||
| 8867 | if (error_code != 0) | ||
| 8868 | error ("No display found, CGGetActiveDisplayList error %d", error_code); | ||
| 8869 | |||
| 8870 | dpyinfo->n_planes = CGDisplayBitsPerPixel (disp_id[0]); | ||
| 8871 | } | ||
| 8859 | #else | 8872 | #else |
| 8860 | for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) | 8873 | for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) |
| 8861 | if (HasDepth (main_device_handle, dpyinfo->n_planes, | 8874 | if (HasDepth (main_device_handle, dpyinfo->n_planes, |