From 09b0b7b3889c92ffe19d745e91c4ebb78e3c7fd1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 22 Jul 2005 09:54:45 +0000 Subject: [PATCH 01/69] (dired-move-to-filename-regexp): Recognize the B suffix of the file size (as in "177B" for 177 bytes). This happens with "ls -lh" on FreeBSD. --- lisp/dired.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 0ba369e4640..880d31d9b41 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1865,11 +1865,11 @@ DIR must be a directory name, not a file name." ;; The "[0-9]" below requires the previous column to end in a digit. ;; This avoids recognizing `1 may 1997' as a date in the line: ;; -r--r--r-- 1 may 1997 1168 Oct 19 16:49 README - ;; The "[kKMGTPEZY]?" below supports "ls -alh" output. + ;; The "[BkKMGTPEZY]?" below supports "ls -alh" output. ;; The ".*" below finds the last match if there are multiple matches. ;; This avoids recognizing `jservice 10 1024' as a date in the line: ;; drwxr-xr-x 3 jservice 10 1024 Jul 2 1997 esg-host - (concat ".*[0-9][kKMGTPEZY]?" s + (concat ".*[0-9][BkKMGTPEZY]?" s "\\(" western "\\|" western-comma "\\|" japanese "\\|" iso "\\)" s "+")) "Regular expression to match up to the file name in a directory listing. From 7dc24a368c0ec367c30b0780102133d751aeb13b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 22 Jul 2005 09:59:41 +0000 Subject: [PATCH 02/69] (Quoted File Names): Add index entry. --- man/files.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/man/files.texi b/man/files.texi index c1f32bcf7ad..bc217de7b18 100644 --- a/man/files.texi +++ b/man/files.texi @@ -3256,6 +3256,7 @@ File Names}). @section Quoted File Names @cindex quoting file names +@cindex file names, quote special characters You can @dfn{quote} an absolute file name to prevent special characters and syntax in it from having their special effects. The way to do this is to add @samp{/:} at the beginning. From 4be2783999901a86f3cfd683d58f07fc0d6a4c08 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 22 Jul 2005 10:00:09 +0000 Subject: [PATCH 03/69] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ man/ChangeLog | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3edf63adf03..01112f1b859 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-07-22 Eduardo Mu,Aq(Boz (tiny change) + + * dired.el (dired-move-to-filename-regexp): Recognize the B suffix + of the file size (as in "177B" for 177 bytes). This happens with + "ls -lh" on FreeBSD. + 2005-07-22 Juanma Barranquero * hilit-chg.el (highlight-changes-global-initial-state) diff --git a/man/ChangeLog b/man/ChangeLog index 43edb631b9c..92341ea9a56 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2005-07-22 Eli Zaretskii + + * files.texi (Quoted File Names): Add index entry. + 2005-07-19 Carsten Dominik * org.texi: Version 3.14 From 80362dd2c07d1167127036f71716c9fd80c32faa Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 22 Jul 2005 13:02:19 +0000 Subject: [PATCH 04/69] *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01112f1b859..0bcdbd2502a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-07-22 Kim F. Storm + + * image-file.el (insert-image-file, image-file-yank-handler): Fix + last change to maintain a (unique) yank-handler on yanked images. + 2005-07-22 Eduardo Mu,Aq(Boz (tiny change) * dired.el (dired-move-to-filename-regexp): Recognize the B suffix From eab4879567e0b4f4e73b5eda44d2cec1934aef0d Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 22 Jul 2005 13:11:34 +0000 Subject: [PATCH 05/69] (insert-image-file, image-file-yank-handler): Fix last change to maintain a (unique) yank-handler on yanked images. --- lisp/image-file.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/image-file.el b/lisp/image-file.el index be95470184c..6b88b84e19f 100644 --- a/lisp/image-file.el +++ b/lisp/image-file.el @@ -118,7 +118,8 @@ the command `insert-file-contents'." (create-image data nil t)) (props `(display ,image - yank-handler (image-file-yank-handler) + yank-handler + (image-file-yank-handler nil t) intangible ,image rear-nonsticky (display intangible) ;; This a cheap attempt to make the whole buffer @@ -141,12 +142,18 @@ the command `insert-file-contents'." ;; recognized as two different images. (defun image-file-yank-handler (string) "Yank handler for inserting an image into a buffer." - (let ((image (get-text-property 0 'display string))) + (let ((len (length string)) + (image (get-text-property 0 'display string))) + (remove-text-properties 0 len yank-excluded-properties string) (if (consp image) - (put-text-property 0 (length string) - 'display - (cons (car image) (cdr image)) - string)) + (add-text-properties 0 + (or (next-single-property-change 0 'image-counter string) + (length string)) + `(display + ,(cons (car image) (cdr image)) + yank-handler + ,(cons 'image-file-yank-handler '(nil t))) + string)) (insert string))) (put 'image-file-handler 'safe-magic t) From 290e47075b148630efe83b5616e9203490395a19 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Fri, 22 Jul 2005 14:22:02 +0000 Subject: [PATCH 06/69] typo --- etc/NEWS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index defc769b9d6..49ef10d021b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2183,7 +2183,7 @@ syntactic indentation. ** In sh-script, a continuation line is only indented if the backslash was preceded by a SPC or a TAB. - + --- ** Perl mode has a new variable `perl-indent-continued-arguments'. @@ -5030,8 +5030,8 @@ running under X. +++ *** New variable `gc-cons-percentage' automatically grows the GC cons threshold -as the heap sizxe increases. - +as the heap size increases. + +++ *** New variables `gc-elapsed' and `gcs-done' provide extra information on garbage collection. From 19292318e867a5c47b94591c43a3c2a751cc70d2 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Fri, 22 Jul 2005 17:11:04 +0000 Subject: [PATCH 07/69] * term/rxvt.el (function-key-map): Use substitute-key-definition to bind {C,S,C-S}-{f1-f10}. Add a few missing key bindings. * term/cygwin.el: New file. --- lisp/ChangeLog | 7 +++++ lisp/term/cygwin.el | 6 ++++ lisp/term/rxvt.el | 76 ++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 lisp/term/cygwin.el diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0bcdbd2502a..4a685e22355 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2005-07-22 Dan Nicolaescu + + * term/rxvt.el (function-key-map): Use substitute-key-definition + to bind {C,S,C-S}-{f1-f10}. Add a few missing key bindings. + + * term/cygwin.el: New file. + 2005-07-22 Kim F. Storm * image-file.el (insert-image-file, image-file-yank-handler): Fix diff --git a/lisp/term/cygwin.el b/lisp/term/cygwin.el new file mode 100644 index 00000000000..8330a91f1f9 --- /dev/null +++ b/lisp/term/cygwin.el @@ -0,0 +1,6 @@ +;;; cygwin.el --- support for the Cygwin terminal -*- no-byte-compile: t -*- + +;;; The Cygwin terminal can't really display underlines. +(tty-no-underline) + +;;; cygwin.el ends here diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 8dcd1826e0a..95742a1d34e 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -26,6 +26,47 @@ ;;; Code: +;;; The terminal intialization C code file might have initialized +;;; function keys F11->F42 from the termcap/terminfo information. On +;;; a PC-style keyboard these keys correspond to +;;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The +;;; code here subsitutes the corresponding defintions in +;;; function-key-map. This substitution is needed because if a key +;;; definition if found in function-key-map, there are no further +;;; lookups in other keymaps. +(substitute-key-definition [f11] [S-f1] function-key-map) +(substitute-key-definition [f12] [S-f2] function-key-map) +(substitute-key-definition [f13] [S-f3] function-key-map) +(substitute-key-definition [f14] [S-f4] function-key-map) +(substitute-key-definition [f15] [S-f5] function-key-map) +(substitute-key-definition [f16] [S-f6] function-key-map) +(substitute-key-definition [f17] [S-f7] function-key-map) +(substitute-key-definition [f18] [S-f8] function-key-map) +(substitute-key-definition [f19] [S-f9] function-key-map) +(substitute-key-definition [f20] [S-f10] function-key-map) + +(substitute-key-definition [f23] [C-f1] function-key-map) +(substitute-key-definition [f24] [C-f2] function-key-map) +(substitute-key-definition [f25] [C-f3] function-key-map) +(substitute-key-definition [f26] [C-f4] function-key-map) +(substitute-key-definition [f27] [C-f5] function-key-map) +(substitute-key-definition [f28] [C-f6] function-key-map) +(substitute-key-definition [f29] [C-f7] function-key-map) +(substitute-key-definition [f30] [C-f8] function-key-map) +(substitute-key-definition [f31] [C-f9] function-key-map) +(substitute-key-definition [f32] [C-f10] function-key-map) + +(substitute-key-definition [f33] [C-S-f1] function-key-map) +(substitute-key-definition [f34] [C-S-f2] function-key-map) +(substitute-key-definition [f35] [C-S-f3] function-key-map) +(substitute-key-definition [f36] [C-S-f4] function-key-map) +(substitute-key-definition [f37] [C-S-f5] function-key-map) +(substitute-key-definition [f38] [C-S-f6] function-key-map) +(substitute-key-definition [f39] [C-S-f7] function-key-map) +(substitute-key-definition [f40] [C-S-f8] function-key-map) +(substitute-key-definition [f41] [C-S-f9] function-key-map) +(substitute-key-definition [f42] [C-S-f10] function-key-map) + ;; Set up function-key-map entries that termcap and terminfo don't know. (let ((map (make-sparse-keymap))) (define-key map "\e[A" [up]) @@ -48,8 +89,10 @@ (define-key map "\e[19~" [f8]) (define-key map "\e[20~" [f9]) (define-key map "\e[21~" [f10]) - (define-key map "\e[23~" [f11]) - (define-key map "\e[24~" [f12]) + ;; The strings emitted by f11 and f12 are the same as the strings + ;; emitted by S-f1 and S-f2, so don't define f11 and f12. + ;; (define-key map "\e[23~" [f11]) + ;; (define-key map "\e[24~" [f12]) (define-key map "\e[29~" [print]) (define-key map "\e[11^" [C-f1]) @@ -62,23 +105,42 @@ (define-key map "\e[19^" [C-f8]) (define-key map "\e[20^" [C-f9]) (define-key map "\e[21^" [C-f10]) - (define-key map "\e[23^" [C-f11]) - (define-key map "\e[24^" [C-f12]) - (define-key map "\e[29~" [print]) + (define-key map "\e[23~" [S-f1]) + (define-key map "\e[24~" [S-f2]) + (define-key map "\e[25~" [S-f3]) + (define-key map "\e[26~" [S-f4]) + (define-key map "\e[28~" [S-f5]) + (define-key map "\e[29~" [S-f6]) + (define-key map "\e[31~" [S-f7]) + (define-key map "\e[32~" [S-f8]) + (define-key map "\e[33~" [S-f9]) + (define-key map "\e[34~" [S-f10]) - (define-key map "\e[2;2~" [S-insert]) - (define-key map "\e[3$" [S-delete]) + (define-key map "\e[23^" [C-S-f1]) + (define-key map "\e[24^" [C-S-f2]) + (define-key map "\e[25^" [C-S-f3]) + (define-key map "\e[26^" [C-S-f4]) + (define-key map "\e[28^" [C-S-f5]) + (define-key map "\e[29^" [C-S-f6]) + (define-key map "\e[31^" [C-S-f7]) + (define-key map "\e[32^" [C-S-f8]) + (define-key map "\e[33^" [C-S-f9]) + (define-key map "\e[34^" [C-S-f10]) (define-key map "\e[2^" [C-insert]) (define-key map "\e[3^" [C-delete]) (define-key map "\e[5^" [C-prior]) (define-key map "\e[6^" [C-next]) + (define-key map "\e[7^" [C-home]) + (define-key map "\e[8^" [C-end]) (define-key map "\eOd" [C-left]) (define-key map "\eOc" [C-right]) (define-key map "\eOa" [C-up]) (define-key map "\eOb" [C-down]) + (define-key map "\e[2;2~" [S-insert]) + (define-key map "\e[3$" [S-delete]) (define-key map "\e[5$" [S-prior]) (define-key map "\e[6$" [S-next]) (define-key map "\e[8$" [S-end]) From 6a55dae2625af1e47376cd54115236abc874d288 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Fri, 22 Jul 2005 18:40:15 +0000 Subject: [PATCH 08/69] Load term/rxvt if the terminal is actually an rxvt terminal. (xterm-rxvt-set-background-mode): Remove, not used anymore. --- lisp/ChangeLog | 4 ++++ lisp/term/xterm.el | 36 ++++++++---------------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4a685e22355..5c741ba6c4e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2005-07-22 Dan Nicolaescu + * term/xterm.el: Load term/rxvt if the terminal is actually an + rxvt terminal. + (xterm-rxvt-set-background-mode): Remove, not used anymore. + * term/rxvt.el (function-key-map): Use substitute-key-definition to bind {C,S,C-S}-{f1-f10}. Add a few missing key bindings. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 17d7cde0e8a..1d700b727d3 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -26,6 +26,13 @@ ;;; Code: +;;; rxvt terminals sometimes set the TERM variable to "xterm", but +;;; rxvt's keybindings that are incompatible with xterm's. It is +;;; better in that case to load rxvt's terminal initialization file. +(if (and (getenv "COLORTERM") + (string-match "\\`rxvt" (getenv "COLORTERM"))) + (load "term/rxvt") + ;;; The terminal intialization C code file might have initialized ;;; function keys F13->F60 from the termcap/terminfo information. On ;;; a PC-style keyboard these keys correspond to @@ -359,38 +366,11 @@ versions of xterm." ;; right colors, so clear them. (clear-face-cache))) -;; rxvt puts the default colors into an environment variable -;; COLORFGBG. We use this to set the background mode in a more -;; intelligent way than the default guesswork in startup.el. -(defun xterm-rxvt-set-background-mode () - "Set background mode as appropriate for the default rxvt colors." - (let ((fgbg (getenv "COLORFGBG")) - bg rgb) - (setq default-frame-background-mode 'light) - (when (and fgbg - (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg)) - (setq bg (string-to-number (substring fgbg (match-beginning 1)))) - ;; The next line assumes that xterm-standard-colors are ordered - ;; by the color index in the ascending order! - (setq rgb (car (cddr (nth bg xterm-standard-colors)))) - ;; See the commentary in frame-set-background-mode about the - ;; computation below. - (if (< (apply '+ rgb) - ;; The following line assumes that white is the 15th - ;; color in xterm-standard-colors. - (* (apply '+ (car (cddr (nth 15 xterm-standard-colors)))) 0.6)) - (setq default-frame-background-mode 'dark))) - (frame-set-background-mode (selected-frame)))) - ;; Do it! (xterm-register-default-colors) -;; If this xterm is actually a disguised rxvt, be more intelligent about -;; determining the background mode. -(and (getenv "COLORTERM") - (string-match "\\`rxvt" (getenv "COLORTERM")) - (xterm-rxvt-set-background-mode)) ;; This recomputes all the default faces given the colors we've just set up. (tty-set-up-initial-frame-faces) +) ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a ;;; xterm.el ends here From f9872a6bb3415b3c0b626cf5334a474e985e51f5 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 22 Jul 2005 18:43:24 +0000 Subject: [PATCH 09/69] (line-move-1): Fix comments. --- lisp/simple.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 9523bc6c28d..40a2dae129a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3491,8 +3491,8 @@ Outline mode sets this." ;; at least go to end of line. (end-of-line)) ((< arg 0) - ;; If we did not move down as far as desired, - ;; at least go to end of line. + ;; If we did not move up as far as desired, + ;; at least go to beginning of line. (beginning-of-line)) (t (line-move-finish (or goal-column temporary-goal-column) From 93bb512f12be1d59a6619a6d658d206d4604f849 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 22 Jul 2005 18:44:04 +0000 Subject: [PATCH 10/69] (normal-splash-screen): Update menu name. --- lisp/startup.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/startup.el b/lisp/startup.el index f1623cf374b..9c3a684a840 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1343,7 +1343,7 @@ You can do basic editing with the menu bar and scroll bar using the mouse. Useful File menu items: Exit Emacs (or type Control-x followed by Control-c) -Recover Session Recover files you were editing before a crash +Recover Crashed Session Recover files you were editing before a crash Important Help menu items: Emacs Tutorial Learn how to use Emacs efficiently From ba698f3b649630762f9e8da1503c93be07af0c6f Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 22 Jul 2005 18:44:45 +0000 Subject: [PATCH 11/69] (tempo-insert-template): Fix 2005-07-16 change. --- lisp/tempo.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/tempo.el b/lisp/tempo.el index 915d3a430d8..282885e2d65 100644 --- a/lisp/tempo.el +++ b/lisp/tempo.el @@ -303,7 +303,7 @@ mode, ON-REGION is ignored and assumed true if the region is active." transient-mark-mode mark-active) (if (featurep 'xemacs) - zmacs-regions (mark))) + (and zmacs-regions (mark)))) (setq on-region t)) (and on-region (set-marker tempo-region-start (min (mark) (point))) From 1050234a98ae6757876f8e110283499a410c7c90 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 22 Jul 2005 18:53:02 +0000 Subject: [PATCH 12/69] *** empty log message *** --- lisp/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c741ba6c4e..1823f0c3ec9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2005-07-22 Juri Linkov + + * simple.el (line-move-1): Fix comments. + + * startup.el (normal-splash-screen): Update menu name. + + * tempo.el (tempo-insert-template): Fix 2005-07-16 change. + 2005-07-22 Dan Nicolaescu * term/xterm.el: Load term/rxvt if the terminal is actually an From 6696f2a495b6cc41cf0e5f098ca23ed9d0a6ab6b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 22 Jul 2005 22:58:30 +0000 Subject: [PATCH 13/69] (Garbage Collection): Clarify previous change. --- lispref/ChangeLog | 4 ++++ lispref/internals.texi | 13 ++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 5ed7f2165ce..74431dc03be 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,7 @@ +2005-07-22 Richard M. Stallman + + * internals.texi (Garbage Collection): Clarify previous change. + 2005-07-21 Stefan Monnier * internals.texi (Garbage Collection): Add gc-cons-percentage. diff --git a/lispref/internals.texi b/lispref/internals.texi index 61b643bd54a..5cc0fe6e497 100644 --- a/lispref/internals.texi +++ b/lispref/internals.texi @@ -369,15 +369,14 @@ until the subsequent garbage collection, at which time @end defopt @defopt gc-cons-percentage -The value of this variable is the minimum portion of the heap that -should be allocated before a garbage collection takes place. It is -used only if the specified size is larger than -@code{gc-cons-threshold}. +The value of this variable specifies the amount of consing before a +garbage collection occurs, as a fraction of the current heap size. +This criterion and @code{gc-cons-threshold} apply in parallel, and +garbage collection occurs only when both criteria are satisfied. As the heap size increases, the time to perform a garbage collection -increases, so in order to compensate, this variable tries to -correspondingly reduce the frequency of collection by letting Emacs -allocate more memory between each collection. +increases. Thus, it can be desirable to do them less frequently in +proportion. @end defopt The value returned by @code{garbage-collect} describes the amount of From fc3216cb119b3f67cae6a9089666ba775a983c65 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sat, 23 Jul 2005 07:47:51 +0000 Subject: [PATCH 14/69] Don't include stdlib.h or string.h. (Fdo_applescript, Fmac_file_name_to_posix) (Fmac_file_name_to_posix): Doc fixes. [TARGET_API_MAC_CARBON] (Fmac_get_preference) (Fmac_code_convert_string): Likewise. [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode if the executable is not contained in a bundle. --- src/mac.c | 58 +++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/mac.c b/src/mac.c index 11dd93aa88d..5558cbb797e 100644 --- a/src/mac.c +++ b/src/mac.c @@ -59,11 +59,9 @@ Boston, MA 02110-1301, USA. */ #include #include #include -#include #include #include #include -#include #include #if __MWERKS__ #include @@ -3447,7 +3445,7 @@ mac_get_object_from_code(OSType defCode) DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, 1, 0, doc: /* Get the creator code of FILENAME as a four character string. */) - (filename) + (filename) Lisp_Object filename; { OSErr status; @@ -3502,7 +3500,7 @@ DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0, doc: /* Get the type code of FILENAME as a four character string. */) - (filename) + (filename) Lisp_Object filename; { OSErr status; @@ -3559,7 +3557,7 @@ DEFUN ("mac-set-file-creator", Fmac_set_file_creator, Smac_set_file_creator, 1, doc: /* Set creator code of file FILENAME to CODE. If non-nil, CODE must be a 4-character string. Otherwise, 'EMAx' is assumed. Return non-nil if successful. */) - (filename, code) + (filename, code) Lisp_Object filename, code; { OSErr status; @@ -3619,7 +3617,7 @@ assumed. Return non-nil if successful. */) DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0, doc: /* Set file code of file FILENAME to CODE. CODE must be a 4-character string. Return non-nil if successful. */) - (filename, code) + (filename, code) Lisp_Object filename, code; { OSErr status; @@ -3766,12 +3764,12 @@ do_applescript (char *script, char **result) DEFUN ("do-applescript", Fdo_applescript, Sdo_applescript, 1, 1, 0, - doc: /* Compile and execute AppleScript SCRIPT and retrieve and return the result. + doc: /* Compile and execute AppleScript SCRIPT and return the result. If compilation and execution are successful, the resulting script value is returned as a string. Otherwise the function aborts and displays the error message returned by the AppleScript scripting component. */) - (script) + (script) Lisp_Object script; { char *result, *temp; @@ -3811,16 +3809,15 @@ component. */) DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, Smac_file_name_to_posix, 1, 1, 0, - doc: /* Convert Macintosh filename to Posix form. */) - (mac_filename) - Lisp_Object mac_filename; + doc: /* Convert Macintosh FILENAME to Posix form. */) + (filename) + Lisp_Object filename; { char posix_filename[MAXPATHLEN+1]; - CHECK_STRING (mac_filename); + CHECK_STRING (filename); - if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename, - MAXPATHLEN)) + if (mac_to_posix_pathname (SDATA (filename), posix_filename, MAXPATHLEN)) return build_string (posix_filename); else return Qnil; @@ -3829,16 +3826,15 @@ DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac, Sposix_file_name_to_mac, 1, 1, 0, - doc: /* Convert Posix filename to Mac form. */) - (posix_filename) - Lisp_Object posix_filename; + doc: /* Convert Posix FILENAME to Mac form. */) + (filename) + Lisp_Object filename; { char mac_filename[MAXPATHLEN+1]; - CHECK_STRING (posix_filename); + CHECK_STRING (filename); - if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename, - MAXPATHLEN)) + if (posix_to_mac_pathname (SDATA (filename), mac_filename, MAXPATHLEN)) return build_string (mac_filename); else return Qnil; @@ -3853,8 +3849,8 @@ DEFUN ("mac-get-preference", Fmac_get_preference, Smac_get_preference, 1, 4, 0, doc: /* Return the application preference value for KEY. KEY is either a string specifying a preference key, or a list of key strings. If it is a list, the (i+1)-th element is used as a key for -the CFDictionary value obtained by the i-th element. If lookup is -failed at some stage, nil is returned. +the CFDictionary value obtained by the i-th element. Return nil if +lookup is failed at some stage. Optional arg APPLICATION is an application ID string. If omitted or nil, that stands for the current application. @@ -3885,7 +3881,7 @@ CFDictionary. If HASH-BOUND is a negative integer or nil, always generate alists. If HASH-BOUND >= 0, generate an alist if the number of keys in the dictionary is smaller than HASH-BOUND, and a hash table otherwise. */) - (key, application, format, hash_bound) + (key, application, format, hash_bound) Lisp_Object key, application, format, hash_bound; { CFStringRef app_id, key_str; @@ -4122,9 +4118,8 @@ charset string, or an integer as a CFStringEncoding value. On Mac OS X 10.2 and later, you can do Unicode Normalization by specifying the optional argument NORMALIZATION-FORM with a symbol NFD, NFKD, NFC, NFKC, HFS+D, or HFS+C. -On successful conversion, returns the result string, else returns -nil. */) - (string, source, target, normalization_form) +On successful conversion, return the result string, else return nil. */) + (string, source, target, normalization_form) Lisp_Object string, source, target, normalization_form; { Lisp_Object result = Qnil; @@ -4183,7 +4178,7 @@ nil. */) DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0, doc: /* Clear the font name table. */) - () + () { check_mac (); mac_clear_font_name_table (); @@ -4483,8 +4478,13 @@ init_mac_osx_environment () app_bundle_pathname. */ bundle = CFBundleGetMainBundle (); - if (!bundle) - return; + if (!bundle || CFBundleGetIdentifier (bundle) == NULL) + { + /* We could not find the bundle identifier. For now, prevent + the fatal error by bringing it up in the terminal. */ + inhibit_window_system = 1; + return; + } bundleURL = CFBundleCopyBundleURL (bundle); if (!bundleURL) From b8ab86c320e30a0b09c8a5dbe2dfbfb326db2854 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sat, 23 Jul 2005 07:48:10 +0000 Subject: [PATCH 15/69] Don't include stdlib.h or string.h. Include atimer.h. (gray_width, gray_height): Remove defines. (gray_bits, gray_bitmap_width, gray_bitmap_height) (gray_bitmap_bits): Remove variables. (lispy_function_keys): Remove extern. (free_frame_menubar): Add extern. (x_window_to_frame): Remove function. (unwind_create_tip_frame): Add declaration. (x_set_name_internal): New function. (x_set_name, x_set_title): Use it. (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width) (Fx_display_pixel_height, Fx_display_planes) (Fx_display_color_cells, Fx_server_max_request_size) (Fx_server_vendor, Fx_server_version, Fx_display_screens) (Fx_display_mm_height, Fx_display_mm_width) (Fx_display_backing_store, Fx_display_visual_class) (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes. --- src/macfns.c | 356 ++++++++++++++++++--------------------------------- 1 file changed, 125 insertions(+), 231 deletions(-) diff --git a/src/macfns.c b/src/macfns.c index 4af1bc8101b..daa1767fd52 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -21,58 +21,34 @@ Boston, MA 02110-1301, USA. */ /* Contributed by Andrew Choi (akochoi@mac.com). */ #include - #include #include -#include -#include #include "lisp.h" -#include "charset.h" #include "macterm.h" #include "frame.h" #include "window.h" #include "buffer.h" -#include "dispextern.h" -#include "fontset.h" #include "intervals.h" +#include "dispextern.h" #include "keyboard.h" #include "blockinput.h" -#include "epaths.h" -#include "termhooks.h" +#include +#include "charset.h" #include "coding.h" +#include "fontset.h" #include "systime.h" +#include "termhooks.h" +#include "atimer.h" -/* #include "bitmaps/gray.xbm" */ -#define gray_width 2 -#define gray_height 2 -static unsigned char gray_bits[] = { - 0x01, 0x02}; - -/*#include -#include */ #include #include #include +#include +#include #include -#include -#include - -/*extern void free_frame_menubar (); -extern double atof (); -extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state); -extern int quit_char;*/ - -extern char *lispy_function_keys[]; - -/* The gray bitmap `bitmaps/gray'. This is done because macterm.c uses - it, and including `bitmaps/gray' more than once is a problem when - config.h defines `static' as an empty replacement string. */ - -int gray_bitmap_width = gray_width; -int gray_bitmap_height = gray_height; -unsigned char *gray_bitmap_bits = gray_bits; +extern void free_frame_menubar (); /* Non-zero means we're allowed to display an hourglass cursor. */ @@ -109,46 +85,13 @@ Lisp_Object Vx_no_window_manager; Lisp_Object Vx_pixel_size_width_font_regexp; -/* Evaluate this expression to rebuild the section of syms_of_macfns - that initializes and staticpros the symbols declared below. Note - that Emacs 18 has a bug that keeps C-x C-e from being able to - evaluate this expression. - -(progn - ;; Accumulate a list of the symbols we want to initialize from the - ;; declarations at the top of the file. - (goto-char (point-min)) - (search-forward "/\*&&& symbols declared here &&&*\/\n") - (let (symbol-list) - (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)") - (setq symbol-list - (cons (buffer-substring (match-beginning 1) (match-end 1)) - symbol-list)) - (forward-line 1)) - (setq symbol-list (nreverse symbol-list)) - ;; Delete the section of syms_of_... where we initialize the symbols. - (search-forward "\n /\*&&& init symbols here &&&*\/\n") - (let ((start (point))) - (while (looking-at "^ Q") - (forward-line 2)) - (kill-region start (point))) - ;; Write a new symbol initialization section. - (while symbol-list - (insert (format " %s = intern (\"" (car symbol-list))) - (let ((start (point))) - (insert (substring (car symbol-list) 1)) - (subst-char-in-region start (point) ?_ ?-)) - (insert (format "\");\n staticpro (&%s);\n" (car symbol-list))) - (setq symbol-list (cdr symbol-list))))) - - */ - -/*&&& symbols declared here &&&*/ Lisp_Object Qnone; Lisp_Object Qsuppress_icon; Lisp_Object Qundefined_color; Lisp_Object Qcancel_timer; +/* In dispnew.c */ + extern Lisp_Object Vwindow_system_version; #if 0 /* Use xstricmp instead. */ @@ -243,40 +186,11 @@ check_x_display_info (frame) return dpyinfo; } - -/* Return the Emacs frame-object corresponding to a mac window. - It could be the frame's main window or an icon window. */ - -/* This function can be called during GC, so use GC_xxx type test macros. */ - -struct frame * -x_window_to_frame (dpyinfo, wdesc) - struct mac_display_info *dpyinfo; - WindowPtr wdesc; -{ - Lisp_Object tail, frame; - struct frame *f; - - for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) - { - frame = XCAR (tail); - if (!GC_FRAMEP (frame)) - continue; - f = XFRAME (frame); - if (!FRAME_W32_P (f) || FRAME_MAC_DISPLAY_INFO (f) != dpyinfo) - continue; - /*if (f->output_data.w32->hourglass_window == wdesc) - return f;*/ - - /* MAC_TODO: Check tooltips when supported. */ - if (FRAME_MAC_WINDOW (f) == wdesc) - return f; - } - return 0; -} + static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); +static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); @@ -302,6 +216,8 @@ static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *, extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); + + /* Store the screen positions of frame F into XPTR and YPTR. These are the positions of the containing window manager window, not Emacs's own window. */ @@ -1834,61 +1750,14 @@ x_set_tool_bar_lines (f, value, oldval) } -/* Change the name of frame F to NAME. If NAME is nil, set F's name to - w32_id_name. + +/* Set the Mac window title to NAME for frame F. */ - If EXPLICIT is non-zero, that indicates that lisp code is setting the - name; if NAME is a string, set F's name to NAME and set - F->explicit_name; if NAME is Qnil, then clear F->explicit_name. - - If EXPLICIT is zero, that indicates that Emacs redisplay code is - suggesting a new name, which lisp code should override; if - F->explicit_name is set, ignore the new name; otherwise, set it. */ - -void -x_set_name (f, name, explicit) - struct frame *f; +static void +x_set_name_internal (f, name) + FRAME_PTR f; Lisp_Object name; - int explicit; { - /* Make sure that requests from lisp code override requests from - Emacs redisplay code. */ - if (explicit) - { - /* If we're switching from explicit to implicit, we had better - update the mode lines and thereby update the title. */ - if (f->explicit_name && NILP (name)) - update_mode_lines = 1; - - f->explicit_name = ! NILP (name); - } - else if (f->explicit_name) - return; - - /* If NAME is nil, set the name to the w32_id_name. */ - if (NILP (name)) - { - /* Check for no change needed in this very common case - before we do any consing. */ - if (!strcmp (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name, - SDATA (f->name))) - return; - name = build_string (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name); - } - else - CHECK_STRING (name); - - /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, f->name))) - return; - - f->name = name; - - /* For setting the frame title, the title parameter should override - the name parameter. */ - if (! NILP (f->title)) - name = f->title; - if (FRAME_MAC_WINDOW (f)) { if (STRING_MULTIBYTE (name)) @@ -1922,6 +1791,64 @@ x_set_name (f, name, explicit) } } +/* Change the name of frame F to NAME. If NAME is nil, set F's name to + mac_id_name. + + If EXPLICIT is non-zero, that indicates that lisp code is setting the + name; if NAME is a string, set F's name to NAME and set + F->explicit_name; if NAME is Qnil, then clear F->explicit_name. + + If EXPLICIT is zero, that indicates that Emacs redisplay code is + suggesting a new name, which lisp code should override; if + F->explicit_name is set, ignore the new name; otherwise, set it. */ + +void +x_set_name (f, name, explicit) + struct frame *f; + Lisp_Object name; + int explicit; +{ + /* Make sure that requests from lisp code override requests from + Emacs redisplay code. */ + if (explicit) + { + /* If we're switching from explicit to implicit, we had better + update the mode lines and thereby update the title. */ + if (f->explicit_name && NILP (name)) + update_mode_lines = 1; + + f->explicit_name = ! NILP (name); + } + else if (f->explicit_name) + return; + + /* If NAME is nil, set the name to the mac_id_name. */ + if (NILP (name)) + { + /* Check for no change needed in this very common case + before we do any consing. */ + if (!strcmp (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name, + SDATA (f->name))) + return; + name = build_string (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name); + } + else + CHECK_STRING (name); + + /* Don't change the name if it's already NAME. */ + if (! NILP (Fstring_equal (name, f->name))) + return; + + f->name = name; + + /* For setting the frame title, the title parameter should override + the name parameter. */ + if (! NILP (f->title)) + name = f->title; + + x_set_name_internal (f, name); +} + /* This function should be called when the user's lisp code has specified a name for the frame; the name will override any set by the redisplay code. */ @@ -1970,38 +1897,10 @@ x_set_title (f, name, old_name) if (NILP (name)) name = f->name; + else + CHECK_STRING (name); - if (FRAME_MAC_WINDOW (f)) - { - if (STRING_MULTIBYTE (name)) -#if TARGET_API_MAC_CARBON - name = ENCODE_UTF_8 (name); -#else - name = ENCODE_SYSTEM (name); -#endif - - BLOCK_INPUT; - - { -#if TARGET_API_MAC_CARBON - CFStringRef windowTitle = - cfstring_create_with_utf8_cstring (SDATA (name)); - - SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); - CFRelease (windowTitle); -#else - Str255 windowTitle; - if (strlen (SDATA (name)) < 255) - { - strcpy (windowTitle, SDATA (name)); - c2pstr (windowTitle); - SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); - } -#endif - } - - UNBLOCK_INPUT; - } + x_set_name_internal (f, name); } void @@ -2470,7 +2369,7 @@ unwind_create_frame (frame) DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 1, 1, 0, - doc: /* Make a new window, which is called a \"frame\" in Emacs terms. + doc: /* Make a new window, which is called a "frame" in Emacs terms. Returns an Emacs frame object. ALIST is an alist of frame parameters. If the parameters specify that the frame should not have a minibuffer, @@ -2479,7 +2378,7 @@ then `default-minibuffer-frame' must be a frame whose minibuffer can be shared by the new frame. This function is an internal primitive--use `make-frame' instead. */) - (parms) + (parms) Lisp_Object parms; { struct frame *f; @@ -2804,7 +2703,7 @@ x_get_focus_frame (frame) DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, doc: /* Internal function called by `color-defined-p', which see. */) - (color, frame) + (color, frame) Lisp_Object color, frame; { XColor foo; @@ -2820,7 +2719,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, doc: /* Internal function called by `color-values', which see. */) - (color, frame) + (color, frame) Lisp_Object color, frame; { XColor foo; @@ -2843,7 +2742,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, doc: /* Internal function called by `display-color-p', which see. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2856,12 +2755,12 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, 0, 1, 0, - doc: /* Return t if the X display supports shades of gray. + doc: /* Return t if DISPLAY supports shades of gray. Note that color displays do support shades of gray. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2874,11 +2773,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, 0, 1, 0, - doc: /* Returns the width in pixels of the X display DISPLAY. + doc: /* Returns the width in pixels of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2888,11 +2787,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-pixel-height", Fx_display_pixel_height, Sx_display_pixel_height, 0, 1, 0, - doc: /* Returns the height in pixels of the X display DISPLAY. + doc: /* Returns the height in pixels of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2902,11 +2801,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, 0, 1, 0, - doc: /* Returns the number of bitplanes of the display DISPLAY. + doc: /* Returns the number of bitplanes of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2916,11 +2815,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells, 0, 1, 0, - doc: /* Returns the number of color cells of the display DISPLAY. + doc: /* Returns the number of color cells of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2932,11 +2831,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-server-max-request-size", Fx_server_max_request_size, Sx_server_max_request_size, 0, 1, 0, - doc: /* Returns the maximum request size of the server of display DISPLAY. + doc: /* Returns the maximum request size of the server of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2945,18 +2844,18 @@ If omitted or nil, that stands for the selected frame's display. */) } DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, - doc: /* Returns the vendor ID string of the Mac OS system (Apple). + doc: /* Returns the "vendor ID" string of the Mac OS system (Apple). The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { return build_string ("Apple Computers"); } DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, - doc: /* Returns the version numbers of the server of display DISPLAY. + doc: /* Returns the version numbers of the Mac OS system. The value is a list of three integers: the major and minor version numbers, and the vendor-specific release number. See also the function `x-server-vendor'. @@ -2964,7 +2863,7 @@ number. See also the function `x-server-vendor'. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { int mac_major_version; @@ -2989,22 +2888,22 @@ If omitted or nil, that stands for the selected frame's display. */) } DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, - doc: /* Return the number of screens on the server of display DISPLAY. + doc: /* Return the number of screens on the server of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { return make_number (1); } DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, - doc: /* Return the height in millimeters of the X display DISPLAY. + doc: /* Return the height in millimeters of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { /* MAC_TODO: this is an approximation, and only of the main display */ @@ -3015,11 +2914,11 @@ If omitted or nil, that stands for the selected frame's display. */) } DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, - doc: /* Return the width in millimeters of the X display DISPLAY. + doc: /* Return the width in millimeters of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { /* MAC_TODO: this is an approximation, and only of the main display */ @@ -3031,12 +2930,12 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-backing-store", Fx_display_backing_store, Sx_display_backing_store, 0, 1, 0, - doc: /* Returns an indication of whether display DISPLAY does backing store. + doc: /* Returns an indication of whether DISPLAY does backing store. The value may be `always', `when-mapped', or `not-useful'. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { return intern ("not-useful"); @@ -3044,14 +2943,14 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-visual-class", Fx_display_visual_class, Sx_display_visual_class, 0, 1, 0, - doc: /* Returns the visual class of the display DISPLAY. + doc: /* Returns the visual class of DISPLAY. The value is one of the symbols `static-gray', `gray-scale', `static-color', `pseudo-color', `true-color', or `direct-color'. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -3075,11 +2974,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-save-under", Fx_display_save_under, Sx_display_save_under, 0, 1, 0, - doc: /* Returns t if the display DISPLAY supports the save-under feature. + doc: /* Returns t if DISPLAY supports the save-under feature. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { return Qnil; @@ -3169,7 +3068,7 @@ DISPLAY is the name of the display to connect to. Optional second arg XRM-STRING is a string of resources in xrdb format. If the optional third arg MUST-SUCCEED is non-nil, terminate Emacs if we can't open the connection. */) - (display, xrm_string, must_succeed) + (display, xrm_string, must_succeed) Lisp_Object display, xrm_string, must_succeed; { unsigned char *xrm_option; @@ -3214,8 +3113,8 @@ DEFUN ("x-close-connection", Fx_close_connection, doc: /* Close the connection to DISPLAY's server. For DISPLAY, specify either a frame or a display name (a string). If DISPLAY is nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (display) + Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); int i; @@ -3241,7 +3140,7 @@ If DISPLAY is nil, that stands for the selected frame's display. */) DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, doc: /* Return the list of display names that Emacs has connections to. */) - () + () { Lisp_Object tail, result; @@ -3253,13 +3152,8 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, } DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, - doc: /* If ON is non-nil, report errors as soon as the erring request is made. -If ON is nil, allow buffering of requests. -This is a noop on Mac OS systems. -The optional second argument DISPLAY specifies which display to act on. -DISPLAY should be either a frame or a display name (a string). -If DISPLAY is omitted or nil, that stands for the selected frame's display. */) - (on, display) + doc: /* This is a noop on Mac OS systems. */) + (on, display) Lisp_Object display, on; { return Qnil; @@ -3318,7 +3212,7 @@ DEFUN ("x-delete-window-property", Fx_delete_window_property, Sx_delete_window_property, 1, 2, 0, doc: /* Remove window property PROP from X window of FRAME. FRAME nil or omitted means use the selected frame. Value is PROP. */) - (prop, frame) + (prop, frame) Lisp_Object prop, frame; { #if 0 /* MAC_TODO : port window properties to Mac */ @@ -3346,7 +3240,7 @@ DEFUN ("x-window-property", Fx_window_property, Sx_window_property, If FRAME is nil or omitted, use the selected frame. Value is nil if FRAME hasn't a property with name PROP or if PROP has no string value. */) - (prop, frame) + (prop, frame) Lisp_Object prop, frame; { #if 0 /* MAC_TODO : port window properties to Mac */ @@ -3948,7 +3842,7 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, doc: /* Show STRING in a "tooltip" window on frame FRAME. -A tooltip window is a small X window displaying a string. +A tooltip window is a small window displaying a string. FRAME nil or omitted means use the selected frame. @@ -3958,7 +3852,7 @@ change the tooltip's appearance. Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil means use the default timeout of 5 seconds. -If the list of frame parameters PARAMS contains a `left' parameters, +If the list of frame parameters PARMS contains a `left' parameter, the tooltip is displayed at that x-position. Otherwise it is displayed at the mouse position, with offset DX added (default is 5 if DX isn't specified). Likewise for the y-position; if a `top' frame @@ -4216,7 +4110,7 @@ Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file selection box, if specified. Ensure that file exists if MUSTMATCH is non-nil. If ONLY-DIR-P is non-nil, the user can only select directories. */) - (prompt, dir, default_filename, mustmatch, only_dir_p) + (prompt, dir, default_filename, mustmatch, only_dir_p) Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; { struct frame *f = SELECTED_FRAME (); From 50971a123a9ccca43497c008305de55cb2203fa1 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sat, 23 Jul 2005 07:48:26 +0000 Subject: [PATCH 16/69] (Fx_popup_menu, Fx_popup_menu): Doc fixes. --- src/macmenu.c | 57 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/src/macmenu.c b/src/macmenu.c index ab266f6f0b5..c7ee0dfaf21 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -611,37 +611,48 @@ cleanup_popup_menu (arg) DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, doc: /* Pop up a deck-of-cards menu and return user's selection. -POSITION is a position specification. This is either a mouse button -event or a list ((XOFFSET YOFFSET) WINDOW) where XOFFSET and YOFFSET -are positions in pixels from the top left corner of WINDOW's frame -\(WINDOW may be a frame object instead of a window). This controls the -position of the center of the first line in the first pane of the -menu, not the top left of the menu as a whole. If POSITION is t, it -means to use the current mouse position. +POSITION is a position specification. This is either a mouse button event +or a list ((XOFFSET YOFFSET) WINDOW) +where XOFFSET and YOFFSET are positions in pixels from the top left +corner of WINDOW. (WINDOW may be a window or a frame object.) +This controls the position of the top left of the menu as a whole. +If POSITION is t, it means to use the current mouse position. MENU is a specifier for a menu. For the simplest case, MENU is a keymap. The menu items come from key bindings that have a menu string as well as -a definition; actually, the \"definition\" in such a key binding looks like +a definition; actually, the "definition" in such a key binding looks like \(STRING . REAL-DEFINITION). To give the menu a title, put a string into the keymap as a top-level element. If REAL-DEFINITION is nil, that puts a nonselectable string in the menu. Otherwise, REAL-DEFINITION should be a valid key binding definition. -You can also use a list of keymaps as MENU. Then each keymap makes a -separate pane. When MENU is a keymap or a list of keymaps, the return -value is a list of events. +You can also use a list of keymaps as MENU. + Then each keymap makes a separate pane. -Alternatively, you can specify a menu of multiple panes with a list of -the form (TITLE PANE1 PANE2...), where each pane is a list of -form (TITLE ITEM1 ITEM2...). -Each ITEM is normally a cons cell (STRING . VALUE); but a string can -appear as an item--that makes a nonselectable line in the menu. +When MENU is a keymap or a list of keymaps, the return value is the +list of events corresponding to the user's choice. Note that +`x-popup-menu' does not actually execute the command bound to that +sequence of events. + +Alternatively, you can specify a menu of multiple panes + with a list of the form (TITLE PANE1 PANE2...), +where each pane is a list of form (TITLE ITEM1 ITEM2...). +Each ITEM is normally a cons cell (STRING . VALUE); +but a string can appear as an item--that makes a nonselectable line +in the menu. With this form of menu, the return value is VALUE from the chosen item. If POSITION is nil, don't display the menu at all, just precalculate the -cached information about equivalent key sequences. */) - (position, menu) +cached information about equivalent key sequences. + +If the user gets rid of the menu without making a valid choice, for +instance by clicking the mouse away from a valid choice or by typing +keyboard input, then this normally results in a quit and +`x-popup-menu' does not return. But if POSITION is a mouse button +event (indicating that the user invoked the menu with the mouse) then +no quit occurs and `x-popup-menu' returns nil. */) + (position, menu) Lisp_Object position, menu; { Lisp_Object keymap, tem; @@ -840,7 +851,7 @@ If POSITION is t, it means to use the frame the mouse is on. The dialog box appears in the middle of the specified frame. CONTENTS specifies the alternatives to display in the dialog box. -It is a list of the form (TITLE ITEM1 ITEM2...). +It is a list of the form (DIALOG ITEM1 ITEM2...). Each ITEM is a cons cell (STRING . VALUE). The return value is VALUE from the chosen item. @@ -850,8 +861,12 @@ on the left of the dialog box and all following items on the right. \(By default, approximately half appear on each side.) If HEADER is non-nil, the frame title for the box is "Information", -otherwise it is "Question". */) - (position, contents, header) +otherwise it is "Question". + +If the user gets rid of the dialog box without making a valid choice, +for instance using the window manager, then this produces a quit and +`x-popup-dialog' does not return. */) + (position, contents, header) Lisp_Object position, contents, header; { FRAME_PTR f = NULL; From 99f963e4ea6fa3ca4498731c271d07914e86ea1d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sat, 23 Jul 2005 07:50:27 +0000 Subject: [PATCH 17/69] (Fx_own_selection_internal): Follow error conventions. (Fx_get_selection_internal, Fx_selection_owner_p) (Fx_selection_exists_p): Doc fixes. (syms_of_macselect) : Likewise. --- src/ChangeLog | 36 ++++++++++++++++++++++++++++++++++++ src/macselect.c | 12 ++++++------ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 97b29b8cb6a..1a08ec8c81e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,39 @@ +2005-07-23 YAMAMOTO Mitsuharu + + * mac.c: Don't include stdlib.h or string.h. + (Fdo_applescript, Fmac_file_name_to_posix) + (Fmac_file_name_to_posix): Doc fixes. + [TARGET_API_MAC_CARBON] (Fmac_get_preference) + (Fmac_code_convert_string): Likewise. + [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode + if the executable is not contained in a bundle. + + * macfns.c: Don't include stdlib.h or string.h. Include atimer.h. + (gray_width, gray_height): Remove defines. + (gray_bits, gray_bitmap_width, gray_bitmap_height) + (gray_bitmap_bits): Remove variables. + (lispy_function_keys): Remove extern. + (free_frame_menubar): Add extern. + (x_window_to_frame): Remove function. + (unwind_create_tip_frame): Add declaration. + (x_set_name_internal): New function. + (x_set_name, x_set_title): Use it. + (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width) + (Fx_display_pixel_height, Fx_display_planes) + (Fx_display_color_cells, Fx_server_max_request_size) + (Fx_server_vendor, Fx_server_version, Fx_display_screens) + (Fx_display_mm_height, Fx_display_mm_width) + (Fx_display_backing_store, Fx_display_visual_class) + (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes. + + * macmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes. + + * macselect.c (Fx_own_selection_internal): Follow error + conventions. + (Fx_get_selection_internal, Fx_selection_owner_p) + (Fx_selection_exists_p): Doc fixes. + (syms_of_macselect) : Likewise. + 2005-07-21 Juanma Barranquero * buffer.c (syms_of_buffer) : Doc fix. diff --git a/src/macselect.c b/src/macselect.c index 94fe591a206..63221ba3a90 100644 --- a/src/macselect.c +++ b/src/macselect.c @@ -712,7 +712,7 @@ anything that the functions on `selection-converter-alist' know about. */) { check_mac (); CHECK_SYMBOL (selection_name); - if (NILP (selection_value)) error ("selection-value may not be nil"); + if (NILP (selection_value)) error ("SELECTION-VALUE may not be nil"); x_own_selection (selection_name, selection_value); return selection_value; } @@ -724,11 +724,11 @@ anything that the functions on `selection-converter-alist' know about. */) DEFUN ("x-get-selection-internal", Fx_get_selection_internal, Sx_get_selection_internal, 2, 3, 0, - doc: /* Return text selected from some Mac window. + doc: /* Return text selected from some Mac application. SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. TYPE is the type of data desired, typically `STRING'. TIME_STAMP is ignored on Mac. */) - (selection_symbol, target_type, time_stamp) + (selection_symbol, target_type, time_stamp) Lisp_Object selection_symbol, target_type, time_stamp; { Lisp_Object val = Qnil; @@ -821,7 +821,7 @@ Disowning it means there is no such selection. */) DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p, 0, 1, 0, - doc: /* Whether the current Emacs process owns the given Selection. + doc: /* Whether the current Emacs process owns the given SELECTION. The arg should be the name of the selection in question, typically one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. For convenience, the symbol nil is the same as `PRIMARY', @@ -866,7 +866,7 @@ and t is the same as `SECONDARY'. */) DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p, 0, 1, 0, - doc: /* Whether there is an owner for the given Selection. + doc: /* Whether there is an owner for the given SELECTION. The arg should be the name of the selection in question, typically one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. For convenience, the symbol nil is the same as `PRIMARY', @@ -1077,7 +1077,7 @@ a desired type to which the selection should be converted; and the local selection value (whatever was given to `x-own-selection'). The function should return the value to send to the Scrap Manager -\(a string). A return value of nil +\(must be a string). A return value of nil means that the conversion could not be done. A return value which is the symbol `NULL' means that a side-effect was executed, From ba6ebbd500397d924833ee8912f9f9b823731bab Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 23 Jul 2005 10:22:44 +0000 Subject: [PATCH 18/69] (Autoload): Make the `doctor' example be consistent with what's in current loaddefs.el. Describe the "fn" magic in the usage portion of the doc string. --- lispref/ChangeLog | 6 ++++++ lispref/loading.texi | 13 +++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 74431dc03be..cee4c55eb7d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,9 @@ +2005-07-23 Eli Zaretskii + + * loading.texi (Autoload): Make the `doctor' example be consistent + with what's in current loaddefs.el. Describe the "fn" magic in + the usage portion of the doc string. + 2005-07-22 Richard M. Stallman * internals.texi (Garbage Collection): Clarify previous change. diff --git a/lispref/loading.texi b/lispref/loading.texi index 4049877e782..b64a0ce6736 100644 --- a/lispref/loading.texi +++ b/lispref/loading.texi @@ -481,17 +481,22 @@ autoloading with a magic comment: Here's what that produces in @file{loaddefs.el}: @smallexample -(autoload 'doctor "doctor" "\ -Switch to *doctor* buffer and start giving psychotherapy." - t) +(autoload (quote doctor) "doctor" "\ +Switch to *doctor* buffer and start giving psychotherapy. + +\(fn)" t nil) @end smallexample @noindent +@cindex @code{fn} in function's documentation string The backslash and newline immediately following the double-quote are a convention used only in the preloaded uncompiled Lisp files such as @file{loaddefs.el}; they tell @code{make-docfile} to put the documentation string in the @file{etc/DOC} file. @xref{Building Emacs}. -See also the commentary in @file{lib-src/make-docfile.c}. +See also the commentary in @file{lib-src/make-docfile.c}. @samp{(fn)} +in the usage part of the documentation string is replaced with the +function's name when the various help functions (@pxref{Help +Functions}) display it. If you write a function definition with an unusual macro that is not one of the known and recognized function definition methods, use of an From 974aae61bbb8c05e0d0fc1a95b419fe596423fd8 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 19:08:06 +0000 Subject: [PATCH 19/69] (gc_cons_threshold): Not static. (gc_cons_combined_threshold): Var deleted. (gc_relative_threshold): New variable. (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold instead of gc_cons_combined_threshold. --- src/alloc.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index a65a96f1631..3c9b2199e52 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -172,10 +172,14 @@ EMACS_INT misc_objects_consed; EMACS_INT intervals_consed; EMACS_INT strings_consed; -/* Number of bytes of consing since GC before another GC should be done. */ +/* Minimum number of bytes of consing since GC before next GC. */ + +EMACS_INT gc_cons_threshold; + +/* Similar minimum, computed from Vgc_cons_percentage. */ + +EMACS_INT gc_relative_threshold; -static EMACS_INT gc_cons_threshold; -EMACS_INT gc_cons_combined_threshold; static Lisp_Object Vgc_cons_percentage; /* Nonzero during GC. */ @@ -4899,12 +4903,10 @@ returns nil, because real GC can't be done. */) if (gc_cons_threshold < 10000) gc_cons_threshold = 10000; - gc_cons_combined_threshold = gc_cons_threshold; - if (FLOATP (Vgc_cons_percentage)) { /* Set gc_cons_combined_threshold. */ EMACS_INT total = 0; - EMACS_INT threshold; + total += total_conses * sizeof (struct Lisp_Cons); total += total_symbols * sizeof (struct Lisp_Symbol); total += total_markers * sizeof (union Lisp_Misc); @@ -4914,10 +4916,10 @@ returns nil, because real GC can't be done. */) total += total_intervals * sizeof (struct interval); total += total_strings * sizeof (struct Lisp_String); - threshold = total * XFLOAT_DATA (Vgc_cons_percentage); - if (threshold > gc_cons_combined_threshold) - gc_cons_combined_threshold = threshold; + gc_relative_threshold = total * XFLOAT_DATA (Vgc_cons_percentage); } + else + gc_relative_threshold = 0; if (garbage_collection_messages) { @@ -6008,7 +6010,8 @@ init_alloc_once () staticidx = 0; consing_since_gc = 0; gc_cons_threshold = 100000 * sizeof (Lisp_Object); - gc_cons_combined_threshold = gc_cons_threshold; + gc_relative_threshold = 0; + #ifdef VIRT_ADDR_VARIES malloc_sbrk_unused = 1<<22; /* A large number */ malloc_sbrk_used = 100000; /* as reasonable as any number */ From 9bd32d8c95fcf3167ab970890fb101eb38be3cd9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 19:08:32 +0000 Subject: [PATCH 20/69] (gc_cons_threshold, gc_relative_threshold): Declared. (gc_cons_combined_threshold): Declaration deleted. --- src/lisp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lisp.h b/src/lisp.h index de7a6b05d87..f6a4e6ae9c6 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1876,9 +1876,11 @@ extern Lisp_Object Vascii_canon_table, Vascii_eqv_table; extern int consing_since_gc; -/* Threshold for doing another gc. */ +/* Thresholds for doing another gc. */ -extern EMACS_INT gc_cons_combined_threshold; +extern EMACS_INT gc_cons_threshold; + +extern EMACS_INT gc_relative_threshold; /* Structure for recording stack slots that need marking. */ From 8f6bda75fb08ea6c84f12f3a16389f29ee81a7b5 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 19:09:09 +0000 Subject: [PATCH 21/69] (Feval, Ffuncall): Test gc_cons_threshold and gc_relative_threshold, one by one. --- src/eval.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eval.c b/src/eval.c index 26d1ce967a7..d118a30804c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2094,7 +2094,8 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, return form; QUIT; - if (consing_since_gc > gc_cons_combined_threshold) + if (consing_since_gc > gc_cons_threshold + && consing_since_gc > gc_relative_threshold) { GCPRO1 (form); Fgarbage_collect (); @@ -2794,7 +2795,8 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) register int i; QUIT; - if (consing_since_gc > gc_cons_combined_threshold) + if (consing_since_gc > gc_cons_threshold + && consing_since_gc > gc_relative_threshold) Fgarbage_collect (); if (++lisp_eval_depth > max_lisp_eval_depth) From c8e16a028e3c3cf1902a1cfe18fc9d5d4a65086b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 19:09:50 +0000 Subject: [PATCH 22/69] (read_char): Test gc_cons_threshold. (syms_of_keyboard): staticpro Qecho_area_clear_hook. --- src/keyboard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/keyboard.c b/src/keyboard.c index b854d423cd1..194e52d2700 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2778,7 +2778,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) available, garbage collect if there has been enough consing going on to make it worthwhile. */ if (!detect_input_pending_run_timers (0) - && consing_since_gc > gc_cons_combined_threshold / 2) + && consing_since_gc > gc_cons_threshold / 2) Fgarbage_collect (); redisplay (); @@ -11282,6 +11282,7 @@ might happen repeatedly and make Emacs nonfunctional. */); doc: /* Normal hook run when clearing the echo area. */); #endif Qecho_area_clear_hook = intern ("echo-area-clear-hook"); + staticpro (&Qecho_area_clear_hook); SET_SYMBOL_VALUE (Qecho_area_clear_hook, Qnil); DEFVAR_LISP ("lucid-menu-bar-dirty-flag", &Vlucid_menu_bar_dirty_flag, From 3414f2d82b82cd71dba20c11289204716127c16f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 19:14:59 +0000 Subject: [PATCH 23/69] (MAYBE_GC): Test gc_cons_threshold and gc_relative_threshold, one by one. --- src/bytecode.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/bytecode.c b/src/bytecode.c index ee89e9e8d7b..3069e0a6ac3 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -355,13 +355,14 @@ unmark_byte_stack () /* Garbage collect if we have consed enough since the last time. We do this at every branch, to avoid loops that never GC. */ -#define MAYBE_GC() \ - if (consing_since_gc > gc_cons_combined_threshold) \ - { \ - BEFORE_POTENTIAL_GC (); \ - Fgarbage_collect (); \ - AFTER_POTENTIAL_GC (); \ - } \ +#define MAYBE_GC() \ + if (consing_since_gc > gc_cons_threshold \ + && consing_since_gc > gc_relative_threshold) \ + { \ + BEFORE_POTENTIAL_GC (); \ + Fgarbage_collect (); \ + AFTER_POTENTIAL_GC (); \ + } \ else /* Check for jumping out of range. */ From bf0bf758f61fafc601a365ffd36b78fd634ceb2e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 19:15:47 +0000 Subject: [PATCH 24/69] (syms_of_insdel): staticpro combine_after_change_buffer. --- src/ChangeLog | 22 ++++++++++++++++++++++ src/insdel.c | 1 + 2 files changed, 23 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 1a08ec8c81e..c5053161c83 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,25 @@ +2005-07-23 Richard M. Stallman + + * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer. + + * bytecode.c (MAYBE_GC): Test gc_cons_threshold and + gc_relative_threshold, one by one. + + * keyboard.c (read_char): Test gc_cons_threshold. + (syms_of_keyboard): staticpro Qecho_area_clear_hook. + + * eval.c (Feval, Ffuncall): Test gc_cons_threshold and + gc_relative_threshold, one by one. + + * alloc.c (gc_cons_threshold): Not static. + (gc_cons_combined_threshold): Var deleted. + (gc_relative_threshold): New variable. + (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold + instead of gc_cons_combined_threshold. + + * lisp.h (gc_cons_threshold, gc_relative_threshold): Declared. + (gc_cons_combined_threshold): Declaration deleted. + 2005-07-23 YAMAMOTO Mitsuharu * mac.c: Don't include stdlib.h or string.h. diff --git a/src/insdel.c b/src/insdel.c index 4760342c56b..49ff949ca4a 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -2393,6 +2393,7 @@ void syms_of_insdel () { staticpro (&combine_after_change_list); + staticpro (&combine_after_change_buffer); combine_after_change_list = Qnil; combine_after_change_buffer = Qnil; From 3bec7ffe70c3f1d58e6fcd0e48c0255d5daa55a6 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 22:11:30 +0000 Subject: [PATCH 25/69] (compilation-mode-font-lock-keywords): Don't use compilation-...-face for messages that are not file names. --- lisp/progmodes/compile.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index d3cbf142222..ff41a964ecc 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -377,13 +377,13 @@ you may also want to change `compilation-page-delimiter'.") '(;; configure output lines. ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$" (1 font-lock-variable-name-face) - (2 (compilation-face '(4 . 3)))) + (2 font-lock-keyword-face)) ;; Command output lines. Recognize `make[n]:' lines too. ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" (1 font-lock-function-name-face) (3 compilation-line-face nil t)) (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1) - ("^Compilation finished" . compilation-info-face) - ("^Compilation exited abnormally" . compilation-error-face)) + ("^Compilation finished" . font-lock-keyword-face) + ("^Compilation exited abnormally" . font-lock-keyword-face)) "Additional things to highlight in Compilation mode. This gets tacked on the end of the generated expressions.") From 69517e25dcf6eac43c13d53f22778798e0f9a2e0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 22:13:54 +0000 Subject: [PATCH 26/69] (grep-error-face): Use font-lock-keyword-face (grep-mode-font-lock-keywords): Don't use compilation-...-face for messages that are not file names. --- lisp/progmodes/grep.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 8f6dd73cba1..dce17ed1306 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -277,7 +277,8 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies (defvar grep-hit-face compilation-info-face "Face name to use for grep hits.") -(defvar grep-error-face compilation-error-face +;; compilation-error-face is wrong for this; it's designed to look like a link. +(defvar grep-error-face font-lock-keyword-face "Face name to use for grep error messages.") (defvar grep-match-face 'match @@ -291,12 +292,12 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies ;; remove match from grep-regexp-alist before fontifying ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*" (0 '(face nil message nil help-echo nil mouse-face nil) t) - (1 grep-hit-face nil t) - (2 grep-error-face nil t)) + (1 font-lock-keyword-face nil t) + (2 font-lock-keyword-face nil t)) ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*" (0 '(face nil message nil help-echo nil mouse-face nil) t) - (1 compilation-warning-face) - (2 compilation-line-face)) + (1 grep-error-face) + (2 grep-error-face)) ;; Highlight grep matches and delete markers ("\\(\033\\[01;31m\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" ;; Refontification does not work after the markers have been From 55fb4ff7a72385327061e1b90f70d4c4236e9730 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Jul 2005 22:51:58 +0000 Subject: [PATCH 27/69] (Man-bgproc-sentinel): Check here for failure to find any man page in the output, and report the error here. (Man-arguments): Make it permanent local. (Man-goto-page): New arg NOERROR. Never kill the current buffer. (Man-mode): Pass t for NOERROR. --- lisp/ChangeLog | 15 ++++++++++++++ lisp/man.el | 53 +++++++++++++++++++++++++++----------------------- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1823f0c3ec9..03c4b8943cf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2005-07-23 Richard M. Stallman + + * man.el (Man-bgproc-sentinel): Check here for failure to find + any man page in the output, and report the error here. + (Man-arguments): Make it permanent local. + (Man-goto-page): New arg NOERROR. Never kill the current buffer. + (Man-mode): Pass t for NOERROR. + + * progmodes/grep.el (grep-error-face): Use font-lock-keyword-face + (grep-mode-font-lock-keywords): + Don't use compilation-...-face for messages that are not file names. + + * progmodes/compile.el (compilation-mode-font-lock-keywords): + Don't use compilation-...-face for messages that are not file names. + 2005-07-22 Juri Linkov * simple.el (line-move-1): Fix comments. diff --git a/lisp/man.el b/lisp/man.el index cb62aa65e94..70304d32043 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -352,6 +352,7 @@ Otherwise, the value is whatever the function (make-variable-buffer-local 'Man-page-mode-string) (make-variable-buffer-local 'Man-original-frame) (make-variable-buffer-local 'Man-arguments) +(put 'Man-arguments 'permanent-local t) (setq-default Man-sections-alist nil) (setq-default Man-refpages-alist nil) @@ -1005,8 +1006,15 @@ manpage command." (if Man-fontify-manpage-flag (Man-fontify-manpage) (Man-cleanup-manpage)) + (run-hooks 'Man-cooked-hook) - (Man-mode) + (Man-mode) + + (if (not Man-page-list) + (let ((args Man-arguments)) + (kill-buffer (current-buffer)) + (error "Can't find the %s manpage" args))) + (set-buffer-modified-p nil) )) ;; Restore case-fold-search before calling @@ -1082,7 +1090,7 @@ The following key bindings are currently in effect in the buffer: (Man-build-page-list) (Man-strip-page-headers) (Man-unindent) - (Man-goto-page 1) + (Man-goto-page 1 t) (run-mode-hooks 'Man-mode-hook)) (defsubst Man-build-section-alist () @@ -1342,35 +1350,32 @@ Specify which REFERENCE to use; default is based on word at point." (interactive) (quit-window)) -(defun Man-goto-page (page) +(defun Man-goto-page (page noerror) "Go to the manual page on page PAGE." (interactive (if (not Man-page-list) - (let ((args Man-arguments)) - (kill-buffer (current-buffer)) - (error "Can't find the %s manpage" args)) + (error "Not a man page buffer") (if (= (length Man-page-list) 1) (error "You're looking at the only manpage in the buffer") (list (read-minibuffer (format "Go to manpage [1-%d]: " (length Man-page-list))))))) - (if (not Man-page-list) - (let ((args Man-arguments)) - (kill-buffer (current-buffer)) - (error "Can't find the %s manpage" args))) - (if (or (< page 1) - (> page (length Man-page-list))) - (error "No manpage %d found" page)) - (let* ((page-range (nth (1- page) Man-page-list)) - (page-start (car page-range)) - (page-end (car (cdr page-range)))) - (setq Man-current-page page - Man-page-mode-string (Man-make-page-mode-string)) - (widen) - (goto-char page-start) - (narrow-to-region page-start page-end) - (Man-build-section-alist) - (Man-build-references-alist) - (goto-char (point-min)))) + (if (and (not Man-page-list) (not noerror)) + (error "Not a man page buffer")) + (when Man-page-list + (if (or (< page 1) + (> page (length Man-page-list))) + (error "No manpage %d found" page)) + (let* ((page-range (nth (1- page) Man-page-list)) + (page-start (car page-range)) + (page-end (car (cdr page-range)))) + (setq Man-current-page page + Man-page-mode-string (Man-make-page-mode-string)) + (widen) + (goto-char page-start) + (narrow-to-region page-start page-end) + (Man-build-section-alist) + (Man-build-references-alist) + (goto-char (point-min))))) (defun Man-next-manpage () From 3ac3aabd2cbebef3b4dd5fb0cd290453215d9997 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 24 Jul 2005 01:03:25 +0000 Subject: [PATCH 28/69] (Man-goto-page): Make second argument NOERROR optional. --- lisp/man.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/man.el b/lisp/man.el index 70304d32043..ed6112e1978 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1350,7 +1350,7 @@ Specify which REFERENCE to use; default is based on word at point." (interactive) (quit-window)) -(defun Man-goto-page (page noerror) +(defun Man-goto-page (page &optional noerror) "Go to the manual page on page PAGE." (interactive (if (not Man-page-list) From ac0385c8f13aa76fe602aeb58eb8541e5e943d29 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 24 Jul 2005 01:18:23 +0000 Subject: [PATCH 29/69] *** empty log message *** --- lisp/ChangeLog | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 03c4b8943cf..4d2c6e515c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2005-07-24 Juanma Barranquero + + * man.el (Man-goto-page): Make second argument NOERROR optional. + 2005-07-23 Richard M. Stallman * man.el (Man-bgproc-sentinel): Check here for failure to find @@ -6,8 +10,8 @@ (Man-goto-page): New arg NOERROR. Never kill the current buffer. (Man-mode): Pass t for NOERROR. - * progmodes/grep.el (grep-error-face): Use font-lock-keyword-face - (grep-mode-font-lock-keywords): + * progmodes/grep.el (grep-error-face): Use font-lock-keyword-face. + (grep-mode-font-lock-keywords): Don't use compilation-...-face for messages that are not file names. * progmodes/compile.el (compilation-mode-font-lock-keywords): From 78690f09b148ce22c677684f8ffa77ffe4dab056 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 24 Jul 2005 02:29:14 +0000 Subject: [PATCH 30/69] (reb-with-current-window): Delete. (reb-next-match, reb-show-subexp): Use `with-selected-window' instead of `reb-with-current-window'. (reb-prev-match): Likewise. Also, don't move left if the search was unsuccessful. (reb-initialize-buffer): New function. (re-builder, reb-change-syntax): Use it. --- lisp/emacs-lisp/re-builder.el | 63 +++++++++++++---------------------- 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index bdfe79b3b6a..e0a3c5ed285 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -299,20 +299,6 @@ Except for Lisp syntax this is the same as `reb-regexp'.") (add-hook 'kill-buffer-hook 'reb-kill-buffer) (reb-auto-update nil nil nil)) - -;; Handy macro for doing things in other windows -(defmacro reb-with-current-window (window &rest body) - "With WINDOW selected evaluate BODY forms and reselect previous window." - - (let ((oldwindow (make-symbol "*oldwindow*"))) - `(let ((,oldwindow (selected-window))) - (select-window ,window) - (unwind-protect - (progn - ,@body) - (select-window ,oldwindow))))) -(put 'reb-with-current-window 'lisp-indent-function 0) - (defun reb-color-display-p () "Return t if display is capable of displaying colors." (eq 'color @@ -330,6 +316,15 @@ Except for Lisp syntax this is the same as `reb-regexp'.") "Return binding for SYMBOL in the RE Builder target buffer." `(with-current-buffer reb-target-buffer ,symbol)) +(defun reb-initialize-buffer () + "Initialize the current buffer as a RE Builder buffer." + (erase-buffer) + (reb-insert-regexp) + (goto-char (+ 2 (point-min))) + (cond ((reb-lisp-syntax-p) + (reb-lisp-mode)) + (t (reb-mode)))) + ;;; This is to help people find this in Apropos. ;;;###autoload (defalias 'regexp-builder 're-builder) @@ -349,13 +344,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.") reb-window-config (current-window-configuration)) (select-window (split-window (selected-window) (- (window-height) 4))) (switch-to-buffer (get-buffer-create reb-buffer)) - (erase-buffer) - (reb-insert-regexp) - (goto-char (+ 2 (point-min))) - (cond - ((reb-lisp-syntax-p) - (reb-lisp-mode)) - (t (reb-mode))))) + (reb-initialize-buffer))) (defun reb-change-target-buffer (buf) "Change the target buffer and display it in the target window." @@ -393,8 +382,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.") (interactive) (reb-assert-buffer-in-window) - (reb-with-current-window - reb-target-window + (with-selected-window reb-target-window (if (not (re-search-forward reb-regexp (point-max) t)) (message "No more matches.") (reb-show-subexp @@ -406,13 +394,15 @@ Except for Lisp syntax this is the same as `reb-regexp'.") (interactive) (reb-assert-buffer-in-window) - (reb-with-current-window reb-target-window - (goto-char (1- (point))) - (if (not (re-search-backward reb-regexp (point-min) t)) - (message "No more matches.") - (reb-show-subexp - (or (and reb-subexp-mode reb-subexp-displayed) 0) - t)))) + (with-selected-window reb-target-window + (let ((p (point))) + (goto-char (1- p)) + (if (re-search-backward reb-regexp (point-min) t) + (reb-show-subexp + (or (and reb-subexp-mode reb-subexp-displayed) 0) + t) + (goto-char p) + (message "No more matches."))))) (defun reb-toggle-case () "Toggle case sensitivity of searches for RE Builder target buffer." @@ -449,7 +439,7 @@ On color displays this just puts point to the end of the expression as the match should already be marked by an overlay. On other displays jump to the beginning and the end of it. If the optional PAUSE is non-nil then pause at the end in any case." - (reb-with-current-window reb-target-window + (with-selected-window reb-target-window (if (not (reb-color-display-p)) (progn (goto-char (match-beginning subexp)) (sit-for reb-blink-delay))) @@ -479,14 +469,9 @@ Optional argument SYNTAX must be specified if called non-interactively." (if (memq syntax '(read string lisp-re sregex rx)) (let ((buffer (get-buffer reb-buffer))) (setq reb-re-syntax syntax) - (if buffer - (with-current-buffer buffer - (erase-buffer) - (reb-insert-regexp) - (goto-char (+ 2 (point-min))) - (cond ((reb-lisp-syntax-p) - (reb-lisp-mode)) - (t (reb-mode)))))) + (when buffer + (with-current-buffer buffer + (reb-initialize-buffer)))) (error "Invalid syntax: %s" syntax))) From 48ce962eafbf03fefc045a570da7313a39684641 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 24 Jul 2005 02:44:15 +0000 Subject: [PATCH 31/69] *** empty log message *** --- lisp/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4d2c6e515c3..47c2bceba8d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2005-07-24 Juanma Barranquero + * emacs-lisp/re-builder.el (reb-with-current-window): Delete. + (reb-next-match, reb-show-subexp): Use `with-selected-window' + instead of `reb-with-current-window'. + (reb-prev-match): Likewise. Also, don't move left if the search + was unsuccessful. + (reb-initialize-buffer): New function. + (re-builder, reb-change-syntax): Use it. + * man.el (Man-goto-page): Make second argument NOERROR optional. 2005-07-23 Richard M. Stallman From 5eca5ecd545f54c271e9997907c5fdedda20104c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 25 Jul 2005 03:21:36 +0000 Subject: [PATCH 32/69] (tooltip-mode): Test emacs-basic-display, not emacs-quick-startup. --- lisp/ChangeLog | 5 +++++ lisp/tooltip.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 47c2bceba8d..f0516519ade 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-07-24 Richard M. Stallman + + * tooltip.el (tooltip-mode): Test emacs-basic-display, + not emacs-quick-startup. + 2005-07-24 Juanma Barranquero * emacs-lisp/re-builder.el (reb-with-current-window): Delete. diff --git a/lisp/tooltip.el b/lisp/tooltip.el index 309edde1749..c8991c07e54 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el @@ -159,7 +159,7 @@ This might return nil if the event did not occur over a buffer." With ARG, turn tooltip mode on if and only if ARG is positive." :global t :init-value (not (or noninteractive - emacs-quick-startup + emacs-basic-display (not (display-graphic-p)) (not (fboundp 'x-show-tip)))) :initialize 'custom-initialize-safe-default From 40154d1aeebdcdc4d2559057ed7bbcc1c422d0d5 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 25 Jul 2005 05:12:19 +0000 Subject: [PATCH 33/69] Add arch tagline --- lisp/term/cygwin.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/term/cygwin.el b/lisp/term/cygwin.el index 8330a91f1f9..d604e0207a0 100644 --- a/lisp/term/cygwin.el +++ b/lisp/term/cygwin.el @@ -3,4 +3,5 @@ ;;; The Cygwin terminal can't really display underlines. (tty-no-underline) +;; arch-tag: ca81ce67-3c41-4883-a29b-4c3d64a21191 ;;; cygwin.el ends here From 5e4c97446b3b485605f09e917dd7f319fc1b2fe5 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 25 Jul 2005 14:17:16 +0000 Subject: [PATCH 34/69] *** empty log message *** --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0516519ade..d55e69e2fe7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2005-07-25 Ari Roponen (tiny change) + + * startup.el (command-line): Fix typo. + 2005-07-24 Richard M. Stallman * tooltip.el (tooltip-mode): Test emacs-basic-display, From 51db08ebe0de202fa87befb0b528372b64edc530 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 25 Jul 2005 14:21:04 +0000 Subject: [PATCH 35/69] (command-line): Fix typo. (From Ari Roponen.) --- lisp/startup.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/startup.el b/lisp/startup.el index 9c3a684a840..da05912d92f 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -575,7 +575,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ;; Choose a reasonable location for temporary files. (custom-reevaluate-setting 'temporary-file-directory) - (custom-reevaluate-setting 'small-emporary-file-directory) + (custom-reevaluate-setting 'small-temporary-file-directory) (custom-reevaluate-setting 'auto-save-file-name-transforms) ;; See if we should import version-control from the environment variable. From d8a885817df91b48433c480f630ee4d750fcfc45 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 25 Jul 2005 21:35:55 +0000 Subject: [PATCH 36/69] Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 95) - Update from CVS 2005-07-25 Katsumi Yamaoka * lisp/gnus/gnus-art.el (gnus-article-next-page): Revert. (gnus-article-beginning-of-window): New macro. (gnus-article-next-page-1): Use it. (gnus-article-prev-page): Ditto. (gnus-mime-save-part-and-strip): Use insert-buffer-substring instead of insert-buffer. (gnus-mime-delete-part): Ditto. (gnus-article-edit-exit): Ditto. * lisp/gnus/gnus-util.el (gnus-beginning-of-window): Remove. (gnus-end-of-window): Remove. * lisp/gnus/lpath.el: Don't bind scroll-margin. 2005-07-25 Simon Josefsson * lisp/gnus/pgg.el (pgg-insert-url-with-w3): Don't load w3, it is possible to have the url package without w3. Reported by Daiki Ueno and Luigi Panzeri . --- lisp/gnus/ChangeLog | 22 ++++++++++++++++++++++ lisp/gnus/gnus-art.el | 28 +++++++++++++++++++++------- lisp/gnus/gnus-util.el | 24 ------------------------ lisp/gnus/pgg.el | 1 - 4 files changed, 43 insertions(+), 32 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 33f639380a6..85bf600cf2d 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,25 @@ +2005-07-25 Katsumi Yamaoka + + * gnus-art.el (gnus-article-next-page): Revert. + (gnus-article-beginning-of-window): New macro. + (gnus-article-next-page-1): Use it. + (gnus-article-prev-page): Ditto. + (gnus-mime-save-part-and-strip): Use insert-buffer-substring + instead of insert-buffer. + (gnus-mime-delete-part): Ditto. + (gnus-article-edit-exit): Ditto. + + * gnus-util.el (gnus-beginning-of-window): Remove. + (gnus-end-of-window): Remove. + + * lpath.el: Don't bind scroll-margin. + +2005-07-25 Simon Josefsson + + * pgg.el (pgg-insert-url-with-w3): Don't load w3, it is possible + to have the url package without w3. Reported by Daiki Ueno + and Luigi Panzeri . + 2005-07-21 Stefan Monnier * mml.el (mml-minibuffer-read-disposition): Don't use inline by default diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 2be1afea77d..3b2dd8cb994 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4117,7 +4117,7 @@ Deleting parts may malfunction or destroy the article; continue? ") ',gnus-newsgroup-ignored-charsets)) (mbl mml-buffer-list)) (setq mml-buffer-list nil) - (insert-buffer gnus-original-article-buffer) + (insert-buffer-substring gnus-original-article-buffer) (mime-to-mml ',handles) (setq gnus-article-mime-handles nil) (let ((mbl1 mml-buffer-list)) @@ -4199,7 +4199,7 @@ Deleting parts may malfunction or destroy the article; continue? ") ',gnus-newsgroup-ignored-charsets)) (mbl mml-buffer-list)) (setq mml-buffer-list nil) - (insert-buffer gnus-original-article-buffer) + (insert-buffer-substring gnus-original-article-buffer) (mime-to-mml ',handles) (setq gnus-article-mime-handles nil) (let ((mbl1 mml-buffer-list)) @@ -5160,7 +5160,7 @@ If given a numerical ARG, move forward ARG pages." If end of article, return non-nil. Otherwise return nil. Argument LINES specifies lines to be scrolled up." (interactive "p") - (gnus-end-of-window) + (move-to-window-line -1) (if (save-excursion (end-of-line) (and (pos-visible-in-window-p) ;Not continuation line. @@ -5182,6 +5182,20 @@ Argument LINES specifies lines to be scrolled up." (gnus-article-next-page-1 lines) nil)) +(defmacro gnus-article-beginning-of-window () + "Move point to the beginning of the window. +In Emacs, the point is placed at the line number which `scroll-margin' +specifies." + (if (featurep 'xemacs) + '(move-to-window-line 0) + '(move-to-window-line + (min (max 0 scroll-margin) + (max 1 (- (window-height) + (if mode-line-format 1 0) + (if (and (boundp 'header-line-format) + (symbol-value 'header-line-format)) + 1 0))))))) + (defun gnus-article-next-page-1 (lines) (let ((scroll-in-place nil)) (condition-case () @@ -5189,13 +5203,13 @@ Argument LINES specifies lines to be scrolled up." (end-of-buffer ;; Long lines may cause an end-of-buffer error. (goto-char (point-max))))) - (gnus-beginning-of-window)) + (gnus-article-beginning-of-window)) (defun gnus-article-prev-page (&optional lines) "Show previous page of current article. Argument LINES specifies lines to be scrolled down." (interactive "p") - (gnus-beginning-of-window) + (move-to-window-line 0) (if (and gnus-page-broken (bobp) (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? @@ -5209,7 +5223,7 @@ Argument LINES specifies lines to be scrolled down." (scroll-down lines) (beginning-of-buffer (goto-char (point-min)))) - (gnus-beginning-of-window))))) + (gnus-article-beginning-of-window))))) (defun gnus-article-only-boring-p () "Decide whether there is only boring text remaining in the article. @@ -5818,7 +5832,7 @@ groups." (window-start (window-start))) (erase-buffer) (if (gnus-buffer-live-p gnus-original-article-buffer) - (insert-buffer gnus-original-article-buffer)) + (insert-buffer-substring gnus-original-article-buffer)) (let ((winconf gnus-prev-winconf)) (kill-all-local-variables) (gnus-article-mode) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 363b9c2f4a0..925555e1ff0 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1577,30 +1577,6 @@ empty directories from OLD-PATH." (defalias 'gnus-set-process-query-on-exit-flag 'process-kill-without-query)) -(defun gnus-beginning-of-window () - "Move point to the beginning of the window." - (move-to-window-line - (if (featurep 'xemacs) - 0 - (min scroll-margin - (max 1 (- (window-height) - (if mode-line-format 1 0) - (if (and (boundp 'header-line-format) - (symbol-value 'header-line-format)) - 1 0))))))) - -(defun gnus-end-of-window () - "Move point to the end of the window." - (move-to-window-line - (if (featurep 'xemacs) - -1 - (max (- -1 scroll-margin) - (- -1 (max 1 (- (window-height) - (if mode-line-format 1 0) - (if (and (boundp 'header-line-format) - (symbol-value 'header-line-format)) - 1 0)))))))) - (provide 'gnus-util) ;;; arch-tag: f94991af-d32b-4c97-8c26-ca12a934de49 diff --git a/lisp/gnus/pgg.el b/lisp/gnus/pgg.el index 91b56c57a4f..8d72fd31502 100644 --- a/lisp/gnus/pgg.el +++ b/lisp/gnus/pgg.el @@ -410,7 +410,6 @@ within the region." (defun pgg-insert-url-with-w3 (url) (ignore-errors - (require 'w3) (require 'url) (let (buffer-file-name) (url-insert-file-contents url)))) From 94c7f25790c1cca8337250b31a75b9869d967b1e Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 25 Jul 2005 22:17:02 +0000 Subject: [PATCH 37/69] (w32_menu_display_help): Suppress tooltip when navigating menus with the keyboard. --- src/ChangeLog | 5 +++++ src/w32menu.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c5053161c83..ec3ecb56660 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-07-25 Jason Rumney + + * w32menu.c (w32_menu_display_help): Suppress tooltip when + navigating menus with the keyboard. + 2005-07-23 Richard M. Stallman * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer. diff --git a/src/w32menu.c b/src/w32menu.c index 065355f8755..0e4902b6ce4 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -2418,8 +2418,11 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags) struct frame *f = x_window_to_frame (&one_w32_display_info, owner); Lisp_Object frame, help; - /* No help echo on owner-draw menu items. */ - if (flags & MF_OWNERDRAW || flags & MF_POPUP) + /* No help echo on owner-draw menu items, or when the keyboard is used + to navigate the menus, since tooltips are distracting if they pop + up elsewhere. */ + if (flags & MF_OWNERDRAW || flags & MF_POPUP + || !(flags & MF_MOUSESELECT)) help = Qnil; else { From d32ff76aa26d144f10eeadf1317c83136e67d15c Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 26 Jul 2005 13:56:01 +0000 Subject: [PATCH 38/69] (bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes. (bookmark-save): Improve argument/docstring consistency. (bookmark-get-bookmark, bookmark-get-bookmark-record, bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0, bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format, bookmark-kill-line, bookmark-read-annotation-mode, bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook): Fix typos in docstrings. (bookmark-exit-hooks): Define as obsolete alias. (bookmark-exit-hook-internal): Run `bookmark-exit-hook', not `bookmark-exit-hooks'. Fix docstring. (bookmark-bmenu-select): "?\ " -> "?\s". --- lisp/ChangeLog | 20 +++++++++++++++++++- lisp/bookmark.el | 43 ++++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d55e69e2fe7..ad67e420c78 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,22 @@ -2005-07-25 Ari Roponen (tiny change) +2005-07-26 Juanma Barranquero + + * bookmark.el (bookmark-automatically-show-annotations) + (bookmark-read-annotation-text-func): Doc fixes. + (bookmark-save): Improve argument/docstring consistency. + (bookmark-get-bookmark, bookmark-get-bookmark-record) + (bookmark-alist-from-buffer) + (bookmark-upgrade-file-format-from-0) + (bookmark-grok-file-format-version) + (bookmark-maybe-upgrade-file-format, bookmark-kill-line) + (bookmark-read-annotation-mode) + (bookmark-insert-current-bookmark, bookmark-jump) + (bookmark-exit-hook): Fix typos in docstrings. + (bookmark-exit-hooks): Define as obsolete alias. + (bookmark-exit-hook-internal): Run `bookmark-exit-hook', + not `bookmark-exit-hooks'. Fix docstring. + (bookmark-bmenu-select): "?\ " -> "?\s". + +2005-07-25 Ari Roponen (tiny change) * startup.el (command-line): Fix typo. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 51a5e0469e5..1f0d671afb4 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -169,7 +169,7 @@ recently set ones come first, oldest ones come last)." (defcustom bookmark-automatically-show-annotations t - "*nil means don't show annotations when jumping to a bookmark." + "*Non-nil means show annotations when jumping to a bookmark." :type 'boolean :group 'bookmark) @@ -333,14 +333,14 @@ through a file easier.") (defun bookmark-get-bookmark (bookmark) - "Return the full entry for BOOKMARK in bookmark-alist. + "Return the full entry for BOOKMARK in `bookmark-alist'. If BOOKMARK is not a string, return nil." (when (stringp bookmark) (assoc-string bookmark bookmark-alist bookmark-completion-ignore-case))) (defun bookmark-get-bookmark-record (bookmark) - "Return the guts of the entry for BOOKMARK in bookmark-alist. + "Return the guts of the entry for BOOKMARK in `bookmark-alist'. That is, all information but the name." (car (cdr (bookmark-get-bookmark bookmark)))) @@ -443,8 +443,7 @@ That is, all information but the name." (list (cons 'info-node node))))) (message "%S" (assq 'info-node (bookmark-get-bookmark-record bookmark))) - (sit-for 4) - ) + (sit-for 4)) (defvar bookmark-history nil @@ -619,7 +618,7 @@ You should never need to change this.") (defun bookmark-alist-from-buffer () - "Return a bookmark-alist (in any format) from the current buffer. + "Return a `bookmark-alist' (in any format) from the current buffer. The buffer must of course contain bookmark format information. Does not care from where in the buffer it is called, and does not affect point." @@ -659,7 +658,7 @@ affect point." (defun bookmark-upgrade-file-format-from-0 () "Upgrade a bookmark file of format 0 (the original format) to format 1. -This expects to be called from point-min in a bookmark file." +This expects to be called from `point-min' in a bookmark file." (message "Upgrading bookmark format from 0 to %d..." bookmark-file-format-version) (let* ((old-list (bookmark-alist-from-buffer)) @@ -676,7 +675,7 @@ This expects to be called from point-min in a bookmark file." (defun bookmark-grok-file-format-version () "Return an integer which is the file-format version of this bookmark file. -This expects to be called from point-min in a bookmark file." +This expects to be called from `point-min' in a bookmark file." (if (looking-at "^;;;;") (save-excursion (save-match-data @@ -691,7 +690,7 @@ This expects to be called from point-min in a bookmark file." (defun bookmark-maybe-upgrade-file-format () "Check the file-format version of this bookmark file. If the version is not up-to-date, upgrade it automatically. -This expects to be called from point-min in a bookmark file." +This expects to be called from `point-min' in a bookmark file." (let ((version (bookmark-grok-file-format-version))) (cond ((= version bookmark-file-format-version) @@ -783,7 +782,7 @@ the list of bookmarks.\)" (defun bookmark-kill-line (&optional newline-too) "Kill from point to end of line. If optional arg NEWLINE-TOO is non-nil, delete the newline too. -Does not affect the kill-ring." +Does not affect the kill ring." (let ((eol (save-excursion (end-of-line) (point)))) (delete-region (point) eol) (if (and newline-too (looking-at "\n")) @@ -842,11 +841,11 @@ the bookmark (and file, and point) specified in buffer local variables." (defvar bookmark-read-annotation-text-func 'bookmark-default-annotation-text "Function to return default text to use for a bookmark annotation. -It takes the name of the bookmark, as a string, as an arg.") +It takes one argument, the name of the bookmark, as a string.") (defun bookmark-read-annotation-mode (buf point parg bookmark) "Mode for composing annotations for a bookmark. -Wants BUF POINT PARG and BOOKMARK. +Wants BUF, POINT, PARG, and BOOKMARK. When you have finished composing, type \\[bookmark-send-annotation] to send the annotation. @@ -933,7 +932,7 @@ Lines beginning with `#' are ignored." (defun bookmark-insert-current-bookmark () - "Insert this buffer's value of bookmark-current-bookmark. + "Insert this buffer's value of `bookmark-current-bookmark'. Default to file name if it's nil." (interactive) (let ((str @@ -1044,7 +1043,7 @@ bookmarks. See help on function `bookmark-load' for more about this. If the file pointed to by BOOKMARK no longer exists, you will be asked -if you wish to give the bookmark a new location, and bookmark-jump +if you wish to give the bookmark a new location, and `bookmark-jump' will then jump to the new location, as well as recording it in place of the old one in the permanent bookmark record." (interactive @@ -1304,8 +1303,8 @@ Saves by default in the file defined by the variable `bookmark-default-file'. With a prefix arg, save it in file FILE \(second argument\). -If you are calling this from Lisp, the two arguments are PREFIX-ARG -and FILE, and if you just want it to write to the default file, then +If you are calling this from Lisp, the two arguments are PARG and +FILE, and if you just want it to write to the default file, then pass no arguments. Or pass in nil and FILE, and it will save in FILE instead. If you pass in one argument, and it is non-nil, then the user will be interactively queried for a file to save in. @@ -1804,7 +1803,7 @@ You can mark bookmarks with the \\\\[bookmark-bmenu-mar (setq tem (bookmark-bmenu-bookmark)) (let ((inhibit-read-only t)) (delete-char -1) - (insert ?\ )) + (insert ?\s)) (or (string-equal tem bmrk) (member tem others) (setq others (cons tem others)))) @@ -2093,7 +2092,7 @@ strings returned are not." (format "-*- %s (%d) -*-" name iter) (nreverse lst)) pane-list))) - + ;; Popup the menu and return the string. (x-popup-menu event (cons (concat "-*- " name " -*-") (nreverse pane-list))))) @@ -2141,12 +2140,14 @@ strings returned are not." ;;; Exit Hook, called from kill-emacs-hook (defvar bookmark-exit-hook nil - "Hook run when emacs exits.") + "Hook run when Emacs exits.") + +(define-obsolete-variable-alias 'bookmark-exit-hooks 'bookmark-exit-hook "22.1") (defun bookmark-exit-hook-internal () "Save bookmark state, if necessary, at Emacs exit time. -This also runs `bookmark-exit-hooks'." - (run-hooks 'bookmark-exit-hooks) +This also runs `bookmark-exit-hook'." + (run-hooks 'bookmark-exit-hook) (and bookmark-alist (bookmark-time-to-save-p t) (bookmark-save))) From cbfde7a0798d4218e7638ef756d22f51d1a68a42 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 26 Jul 2005 16:02:09 +0000 Subject: [PATCH 39/69] (describe-char): Handle the case where the list of chars is displayed in a separate frame. Be a bit more discriminating when looking for the char. --- lisp/ChangeLog | 6 ++++++ lisp/descr-text.el | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ad67e420c78..442206319ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-07-26 Stefan Monnier + + * descr-text.el (describe-char): Handle the case where the list of + chars is displayed in a separate frame. + Be a bit more discriminating when looking for the char. + 2005-07-26 Juanma Barranquero * bookmark.el (bookmark-automatically-show-annotations) diff --git a/lisp/descr-text.el b/lisp/descr-text.el index f639b811a45..e206e2c269c 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -491,10 +491,12 @@ as well as widgets, buttons, overlays, and text properties." :notify (lambda (&rest ignore) (list-charset-chars ',charset) (with-selected-window - (get-buffer-window "*Character List*") + (get-buffer-window "*Character List*" 0) (goto-char (point-min)) - (search-forward ,(char-to-string char) - nil t))) + (forward-line 2) ;Skip the header. + (let ((case-fold-search nil)) + (search-forward ,(char-to-string char) + nil t)))) ,(if (= (charset-dimension charset) 1) (format "%d" (nth 1 split)) (format "%d %d" (nth 1 split) (nth 2 split)))))) From a34ed813d1c8fa8305c07dbcb14492c041131c88 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 26 Jul 2005 16:07:55 +0000 Subject: [PATCH 40/69] (smerge-ediff): Use insert-buffer-substring. --- lisp/ChangeLog | 44 +++++++++++++++++++++++--------------------- lisp/smerge-mode.el | 2 +- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 442206319ed..cb7ae71c671 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2005-07-26 Stefan Monnier + * smerge-mode.el (smerge-ediff): Use insert-buffer-substring. + * descr-text.el (describe-char): Handle the case where the list of chars is displayed in a separate frame. Be a bit more discriminating when looking for the char. @@ -79,8 +81,8 @@ 2005-07-22 Kim F. Storm - * image-file.el (insert-image-file, image-file-yank-handler): Fix - last change to maintain a (unique) yank-handler on yanked images. + * image-file.el (insert-image-file, image-file-yank-handler): + Fix last change to maintain a (unique) yank-handler on yanked images. 2005-07-22 Eduardo Mu,Aq(Boz (tiny change) @@ -305,20 +307,20 @@ * textmodes/org.el (org-table-column-names) (org-table-column-name-regexp) - (org-table-named-field-locations): New variables. - (org-archive-subtree): Protect `this-command' when calling + (org-table-named-field-locations): New variables. + (org-archive-subtree): Protect `this-command' when calling `org-copy-subtree' and `org-cut-subtree', to avoid appending to the kill buffer. - (org-complete): Remove fixed-formula completion. - (org-edit-formulas-map): New variable. - (org-table-edit-formulas): New command. - (org-finish-edit-formulas, org-abort-edit-formulas) + (org-complete): Remove fixed-formula completion. + (org-edit-formulas-map): New variable. + (org-table-edit-formulas): New command. + (org-finish-edit-formulas, org-abort-edit-formulas) (org-show-variable, org-table-get-vertical-vector): New functions. - (org-table-maybe-eval-formula): Handle `:=' fields. - (org-table-get-stored-formulas, org-table-store-formulas) - (org-table-get-formula, org-table-modify-formulas) - (org-table-replace-in-formulas): Handle named field formulas. - (org-table-get-specials): Store locations of named fields. + (org-table-maybe-eval-formula): Handle `:=' fields. + (org-table-get-stored-formulas, org-table-store-formulas) + (org-table-get-formula, org-table-modify-formulas) + (org-table-replace-in-formulas): Handle named field formulas. + (org-table-get-specials): Store locations of named fields. 2005-07-19 Juri Linkov @@ -380,8 +382,8 @@ more than 88 colors. Use green for light backgrounds with 8 colors, and yellow for dark backgrounds with 8 colors. - * font-lock.el (font-lock-regexp-grouping-backslash): Don't - inherit from escape-glyph (use bold for all cases). + * font-lock.el (font-lock-regexp-grouping-backslash): + Don't inherit from escape-glyph (use bold for all cases). * info.el (info-xref-visited): Use light foreground color `violet' for dark backgrounds instead of dark color `magenta3'. @@ -478,8 +480,8 @@ `insert-buffer'. * calendar/icalendar.el (icalendar--get-unfolded-buffer): - * progmodes/ada-mode.el (ada-make-body): Use - `insert-buffer-substring' and `goto-char', not `insert-buffer'. + * progmodes/ada-mode.el (ada-make-body): + Use `insert-buffer-substring' and `goto-char', not `insert-buffer'. * dired.el (dired-log): * tar-mode.el (tar-subfile-save-buffer): @@ -573,8 +575,8 @@ * emulation/viper-init.el (viper-activate-input-method): Avoid warning. - * emacs-lisp/re-builder.el (reb-cook-regexp): Avoid - warning calling lre-compile-string. + * emacs-lisp/re-builder.el (reb-cook-regexp): + Avoid warning calling lre-compile-string. (reb-color-display-p): Avoid warning. * calculator.el (calculator-last-input): Guard uses @@ -591,8 +593,8 @@ (checkdoc-overlay-start, checkdoc-overlay-end) (checkdoc-mode-line-update, checkdoc-char=): Define such that compiler knows they are defined. - (checkdoc-call-eval-buffer): Deleted. Use eval-buffer directly. - (checkdoc-read-event): Deleted. Use read-event directly. + (checkdoc-call-eval-buffer): Delete. Use eval-buffer directly. + (checkdoc-read-event): Delete. Use read-event directly. * whitespace.el (whitespace-make-overlay) (whitespace-overlay-put, whitespace-delete-overlay) diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index 45e68750cb3..a40486ffd07 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el @@ -670,7 +670,7 @@ buffer names." (ediff-cleanup-mess) (with-current-buffer buf (erase-buffer) - (insert-buffer buffer-C) + (insert-buffer-substring buffer-C) (kill-buffer buffer-A) (kill-buffer buffer-B) (kill-buffer buffer-C) From 1c9916a1f9dc944ee733f5c77db39013123da8da Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 26 Jul 2005 16:28:44 +0000 Subject: [PATCH 41/69] (Fdefvar): Allow (defvar enable-multibyte-characters). --- src/ChangeLog | 6 +++++- src/eval.c | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ec3ecb56660..e352ada73a3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-07-26 Stefan Monnier + + * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters). + 2005-07-25 Jason Rumney * w32menu.c (w32_menu_display_help): Suppress tooltip when @@ -22,7 +26,7 @@ (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold instead of gc_cons_combined_threshold. - * lisp.h (gc_cons_threshold, gc_relative_threshold): Declared. + * lisp.h (gc_cons_threshold, gc_relative_threshold): Declare. (gc_cons_combined_threshold): Declaration deleted. 2005-07-23 YAMAMOTO Mitsuharu diff --git a/src/eval.c b/src/eval.c index d118a30804c..56fe670f1b1 100644 --- a/src/eval.c +++ b/src/eval.c @@ -807,18 +807,6 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) register Lisp_Object sym, tem, tail; sym = Fcar (args); - if (SYMBOL_CONSTANT_P (sym)) - { - /* For updward compatibility, allow (defvar :foo (quote :foo)). */ - tem = Fcar (Fcdr (args)); - if (! (CONSP (tem) - && EQ (XCAR (tem), Qquote) - && CONSP (XCDR (tem)) - && EQ (XCAR (XCDR (tem)), sym))) - error ("Constant symbol `%s' specified in defvar", - SDATA (SYMBOL_NAME (sym))); - } - tail = Fcdr (args); if (!NILP (Fcdr (Fcdr (tail)))) error ("Too many arguments"); @@ -826,6 +814,18 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) tem = Fdefault_boundp (sym); if (!NILP (tail)) { + if (SYMBOL_CONSTANT_P (sym)) + { + /* For upward compatibility, allow (defvar :foo (quote :foo)). */ + Lisp_Object tem = Fcar (tail); + if (! (CONSP (tem) + && EQ (XCAR (tem), Qquote) + && CONSP (XCDR (tem)) + && EQ (XCAR (XCDR (tem)), sym))) + error ("Constant symbol `%s' specified in defvar", + SDATA (SYMBOL_NAME (sym))); + } + if (NILP (tem)) Fset_default (sym, Feval (Fcar (tail))); else From 9eff9fe3e8ab53b7a8ad2c1633b0681beb3b655c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 26 Jul 2005 21:43:13 +0000 Subject: [PATCH 42/69] Merge gnulib getopt implementation into Emacs. * Makefile.in (AUTOCONF_INPUTS): New macro. ($(srcdir)/configure, $(srcdir)/src/stamp-h.in): Depend on it, so that these files also depend on m4/getopt.m4. * configure.in: Configure getopt by including m4/getopt.m4, and configuring a getopt replacement if necessary. * make-dist: Add m4 subdirectory. Unlink lib-src/getopt.h. * m4/getopt.m4: New file. * lib-src/Makefile.in (mostlyclean): Remove getopt.h, getopt.h-t. (GETOPT_H): New macro, from gnulib. (getopt.h): New rule, from gnulib. (GETOPTOBJS): Now autoconfigured. (GETOPTDEPS): getopt.h is now autoconfigured. (getopt.o, getopt1.o): Depend on $(GETOPT_H), not ${srcdir}/getopt.h. (getopt.o): Depend on ${srcdir}/gettext.h. (movemail.o): Depend on $(GETOPT_H). * lib-src/getopt.c, lib-src/getopt1.c: Sync from gnulib. * lib-src/getopt_.h, lib-src/getopt_int.h, lib-src/gettext.h: New files, from gnulib. * lib-src/getopt.h: Removed (now is getopt_.h). * nt/inc/gettext.h: Remove; no longer needed now that lib-src/gettext.h exists. * src/s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is now part of lib-src. --- ChangeLog | 12 + Makefile.in | 8 +- configure.in | 11 +- lib-src/ChangeLog | 16 ++ lib-src/Makefile.in | 21 +- lib-src/getopt.c | 635 ++++++++++++++++++++----------------------- lib-src/getopt1.c | 82 ++---- lib-src/getopt_.h | 227 ++++++++++++++++ lib-src/getopt_int.h | 131 +++++++++ lib-src/gettext.h | 78 ++++++ m4/getopt.m4 | 78 ++++++ make-dist | 9 +- nt/ChangeLog | 7 + src/ChangeLog | 7 + src/s/cygwin.h | 4 +- 15 files changed, 916 insertions(+), 410 deletions(-) create mode 100644 lib-src/getopt_.h create mode 100644 lib-src/getopt_int.h create mode 100644 lib-src/gettext.h create mode 100644 m4/getopt.m4 diff --git a/ChangeLog b/ChangeLog index c44bcfbbf38..bfd7e4602b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-07-26 Paul Eggert + + Merge gnulib getopt implementation into Emacs. + + * Makefile.in (AUTOCONF_INPUTS): New macro. + ($(srcdir)/configure, $(srcdir)/src/stamp-h.in): Depend on it, + so that these files also depend on m4/getopt.m4. + * configure.in: Configure getopt by including m4/getopt.m4, + and configuring a getopt replacement if necessary. + * make-dist: Add m4 subdirectory. Unlink lib-src/getopt.h. + * m4/getopt.m4: New file. + 2005-07-06 Lute Kamstra * configure.in: Fix capitalization. diff --git a/Makefile.in b/Makefile.in index 811a8205c45..c8fa29b3439 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # DIST: make most of the changes to this file you might want, so try # DIST: that first. -# Copyright (C) 1992,93,94,95,96,97,98,1999,2000,01,02,03,2004 +# Copyright (C) 1992,93,94,95,96,97,98,1999,2000,01,02,03,04,2005 # Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -302,12 +302,14 @@ Makefile: $(srcdir)/Makefile.in config.status config.status: ${srcdir}/configure ./config.status --recheck -${srcdir}/configure: @MAINT@ ${srcdir}/configure.in +AUTOCONF_INPUTS = @MAINT@ $(srcdir)/configure.in $(srcdir)/m4/getopt.m4 + +$(srcdir)/configure: $(AUTOCONF_INPUTS) cd ${srcdir} && autoconf $(srcdir)/src/config.in: $(srcdir)/src/stamp-h.in @true -$(srcdir)/src/stamp-h.in: @MAINT@ ${srcdir}/configure.in +$(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS) cd ${srcdir} && autoheader rm -f $(srcdir)/src/stamp-h.in echo timestamp > $(srcdir)/src/stamp-h.in diff --git a/configure.in b/configure.in index f8e97eb7d14..e4fa9db6453 100644 --- a/configure.in +++ b/configure.in @@ -2353,7 +2353,7 @@ if test "${HAVE_CARBON}" = "yes"; then CFLAGS="$CFLAGS -framework Carbon" AC_CHECK_FUNC(CancelMenuTracking, have_cmt=yes, have_cmt=no) if test "$have_cmt" = yes; then - AC_DEFINE(HAVE_CANCELMENUTRACKING, 1, + AC_DEFINE(HAVE_CANCELMENUTRACKING, 1, [Define to 1 if CancelMenuTracking is available (Mac OSX).]) fi CFLAGS="$tmp_CFLAGS" @@ -2434,6 +2434,15 @@ AC_FUNC_GETLOADAVG AC_FUNC_FSEEKO +# Configure getopt. +m4_include([m4/getopt.m4]) +gl_GETOPT_IFELSE([ + gl_GETOPT_SUBSTITUTE_HEADER + gl_PREREQ_GETOPT + GETOPTOBJS='getopt.o getopt1.o' +]) +AC_SUBST(GETOPTOBJS) + AC_FUNC_GETPGRP AC_FUNC_STRFTIME diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index dd4dc62a562..33a39fb68e1 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,19 @@ +2005-07-26 Paul Eggert + + Merge gnulib getopt implementation into Emacs. + + * Makefile.in (mostlyclean): Remove getopt.h, getopt.h-t. + (GETOPT_H): New macro, from gnulib. + (getopt.h): New rule, from gnulib. + (GETOPTOBJS): Now autoconfigured. + (GETOPTDEPS): getopt.h is now autoconfigured. + (getopt.o, getopt1.o): Depend on $(GETOPT_H), not ${srcdir}/getopt.h. + (getopt.o): Depend on ${srcdir}/gettext.h. + (movemail.o): Depend on $(GETOPT_H). + * getopt.c, getopt1.c: Sync from gnulib. + * getopt_.h, getopt_int.h, gettext.h: New files, from gnulib. + * getopt.h: Removed (now is getopt_.h). + 2005-07-13 Ken Raeburn * pop.c: Don't include des.h (or variants thereof); krb.h will do diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 372983221a3..6fa89e728c6 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -1,5 +1,5 @@ # Makefile for lib-src subdirectory in GNU Emacs. -# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003, 2004 +# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -344,7 +344,7 @@ uninstall: rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) mostlyclean: - -rm -f core *.o + -rm -f core *.o getopt.h getopt.h-t clean: mostlyclean -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL} @@ -382,11 +382,18 @@ test-distrib${EXEEXT}: ${srcdir}/test-distrib.c $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c ./test-distrib ${srcdir}/testfile -GETOPTOBJS = getopt.o getopt1.o -GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h -getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h +/* We need the following in order to create a when the system + doesn't have one that works with the given compiler. */ +GETOPT_H = @GETOPT_H@ +getopt.h: getopt_.h + cp $(srcdir)/getopt_.h $@-t + mv $@-t $@ + +GETOPTOBJS = @GETOPTOBJS@ +GETOPTDEPS = $(GETOPTOBJS) $(GETOPT_H) +getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c -getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h +getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H) ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c #ifdef REGEXP_IN_LIBC @@ -430,7 +437,7 @@ b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS) movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS) $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail -movemail.o: ${srcdir}/movemail.c ../src/config.h +movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H) $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o: ${srcdir}/pop.c ../src/config.h diff --git a/lib-src/getopt.c b/lib-src/getopt.c index 6799045bde8..bcb81c83fe2 100644 --- a/lib-src/getopt.c +++ b/lib-src/getopt.c @@ -2,8 +2,8 @@ NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002 - Free Software Foundation, Inc. + Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004 + Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify @@ -30,35 +30,8 @@ # include #endif -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -# ifndef const -# define const -# endif -#endif - #include -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#ifndef ELIDE_CODE - - /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ @@ -68,32 +41,18 @@ # include #endif /* GNU C library. */ +#include + #ifdef VMS # include -# if HAVE_STRING_H - 0 -# include -# endif #endif -#if HAVE_LIBINTL_H +#ifdef _LIBC # include -#endif /* HAVE_LIBINTL_H */ - -#if 0 -# ifdef _LIBC -# include -# else /* not #ifdef _LIBC */ -/* This is for other GNU distributions with internationalized messages. */ -# include "gettext.h" -# endif /* end #ifdef _LIBC */ -#endif /* end #if 0 */ - -#if HAVE_LIBINTL_H - /* Should I include libintl.h here as in regex.c ? */ -# define _(msgid) gettext (msgid) -#else /* not #if HAVE_LIBINTL_H */ -# define _(msgid) (msgid) -#endif /* end #if HAVE_LIBINTL_H */ +#else +# include "gettext.h" +# define _(msgid) gettext (msgid) +#endif #if defined _LIBC && defined USE_IN_LIBIO # include @@ -103,21 +62,22 @@ # define attribute_hidden #endif -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. +/* Unlike standard Unix `getopt', functions like `getopt_long' + let the user intersperse the options with the other arguments. - As `getopt' works, it permutes the elements of ARGV so that, + As `getopt_long' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. + Using `getopt' or setting the environment variable POSIXLY_CORRECT + disables permutation. + Then the application's behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" +#include "getopt_int.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, @@ -142,21 +102,6 @@ char *optarg; /* 1003.2 says this must be 1 before any call. */ int optind = 1; -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized attribute_hidden; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - /* Callers store zero here to inhibit the error message for unrecognized options. */ @@ -168,57 +113,12 @@ int opterr = 1; int optopt = '?'; -/* Describe how to deal with options that follow non-option ARGV-elements. +/* Keep a global copy of all internal members of getopt_data. */ - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. +static struct _getopt_data getopt_data; - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -# include -# define my_index strchr -#else - -# if HAVE_STRING_H -# include -# else -# include -# endif +#ifndef __GNU_LIBRARY__ /* Avoid depending on library functions or files whose names are inconsistent. */ @@ -227,43 +127,8 @@ static char *posixly_correct; extern char *getenv (); #endif -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -# if (!defined __STDC__ || !__STDC__) && !defined strlen -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -# endif /* not __STDC__ */ -#endif /* __GNUC__ */ - #endif /* not __GNU_LIBRARY__ */ -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so @@ -277,14 +142,11 @@ extern char **__libc_argv; # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ + if (d->__nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ @@ -306,17 +168,12 @@ static int nonoption_flags_len; `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ -#if defined __STDC__ && __STDC__ -static void exchange (char **); -#endif - static void -exchange (argv) - char **argv; +exchange (char **argv, struct _getopt_data *d) { - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; + int bottom = d->__first_nonopt; + int middle = d->__last_nonopt; + int top = d->optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. @@ -328,19 +185,19 @@ exchange (argv) /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; + d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, - nonoption_flags_max_len), - '\0', top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; + d->__nonoption_flags_max_len), + '\0', top + 1 - d->__nonoption_flags_max_len); + d->__nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } @@ -386,76 +243,71 @@ exchange (argv) /* Update records for the slots the non-options now occupy. */ - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; + d->__first_nonopt += (d->optind - d->__last_nonopt); + d->__last_nonopt = d->optind; } /* Initialize the internal data when the first call is made. */ -#if defined __STDC__ && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; +_getopt_initialize (int argc, char **argv, const char *optstring, + int posixly_correct, struct _getopt_data *d) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ - first_nonopt = last_nonopt = optind; + d->__first_nonopt = d->__last_nonopt = d->optind; - nextchar = NULL; + d->__nextchar = NULL; - posixly_correct = getenv ("POSIXLY_CORRECT"); + d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { - ordering = RETURN_IN_ORDER; + d->__ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { - ordering = REQUIRE_ORDER; + d->__ordering = REQUIRE_ORDER; ++optstring; } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; + else if (d->__posixly_correct) + d->__ordering = REQUIRE_ORDER; else - ordering = PERMUTE; + d->__ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS - if (posixly_correct == NULL + if (!d->__posixly_correct && argc == __libc_argc && argv == __libc_argv) { - if (nonoption_flags_max_len == 0) + if (d->__nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; + d->__nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; + int len = d->__nonoption_flags_max_len = strlen (orig_str); + if (d->__nonoption_flags_max_len < argc) + d->__nonoption_flags_max_len = argc; __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); + (char *) malloc (d->__nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; + d->__nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), - '\0', nonoption_flags_max_len - len); + '\0', d->__nonoption_flags_max_len - len); } } - nonoption_flags_len = nonoption_flags_max_len; + d->__nonoption_flags_len = d->__nonoption_flags_max_len; } else - nonoption_flags_len = 0; + d->__nonoption_flags_len = 0; #endif return optstring; @@ -503,10 +355,6 @@ _getopt_initialize (argc, argv, optstring) `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. @@ -515,32 +363,32 @@ _getopt_initialize (argc, argv, optstring) recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ + long-named options. + + If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT + environment variable were set. */ int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; +_getopt_internal_r (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct, struct _getopt_data *d) { - int print_errors = opterr; + int print_errors = d->opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; - optarg = NULL; + d->optarg = NULL; - if (optind == 0 || !__getopt_initialized) + if (d->optind == 0 || !d->__initialized) { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; + if (d->optind == 0) + d->optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring, + posixly_correct, d); + d->__initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. @@ -548,40 +396,41 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ + || (d->optind < d->__nonoption_flags_len \ + && __getopt_nonoption_flags[d->optind] == '1')) #else -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') #endif - if (nextchar == NULL || *nextchar == '\0') + if (d->__nextchar == NULL || *d->__nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; + if (d->__last_nonopt > d->optind) + d->__last_nonopt = d->optind; + if (d->__first_nonopt > d->optind) + d->__first_nonopt = d->optind; - if (ordering == PERMUTE) + if (d->__ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__last_nonopt != d->optind) + d->__first_nonopt = d->optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; + while (d->optind < argc && NONOPTION_P) + d->optind++; + d->__last_nonopt = d->optind; } /* The special ARGV-element `--' means premature end of options. @@ -589,28 +438,29 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ - if (optind != argc && !strcmp (argv[optind], "--")) + if (d->optind != argc && !strcmp (argv[d->optind], "--")) { - optind++; + d->optind++; - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__first_nonopt == d->__last_nonopt) + d->__first_nonopt = d->optind; + d->__last_nonopt = argc; - optind = argc; + d->optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ - if (optind == argc) + if (d->optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; + if (d->__first_nonopt != d->__last_nonopt) + d->optind = d->__first_nonopt; return -1; } @@ -619,17 +469,17 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) if (NONOPTION_P) { - if (ordering == REQUIRE_ORDER) + if (d->__ordering == REQUIRE_ORDER) return -1; - optarg = argv[optind++]; + d->optarg = argv[d->optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); + d->__nextchar = (argv[d->optind] + 1 + + (longopts != NULL && argv[d->optind][1] == '-')); } /* Decode the current option-ARGV-element. */ @@ -648,8 +498,9 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) This distinction seems to be the most useful approach. */ if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + && (argv[d->optind][1] == '-' + || (long_only && (argv[d->optind][2] + || !strchr (optstring, argv[d->optind][1]))))) { char *nameend; const struct option *p; @@ -659,15 +510,15 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int indfound = -1; int option_index; - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { - if ((unsigned int) (nameend - nextchar) + if ((unsigned int) (nameend - d->__nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ @@ -698,37 +549,44 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) char *buf; if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]) >= 0) + argv[0], argv[d->optind]) >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); + argv[0], argv[d->optind]); #endif } - nextchar += strlen (nextchar); - optind++; - optopt = 0; + d->__nextchar += strlen (d->__nextchar); + d->optind++; + d->optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; - optind++; + d->optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) - optarg = nameend + 1; + d->optarg = nameend + 1; else { if (print_errors) @@ -738,7 +596,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int n; #endif - if (argv[optind - 1][1] == '-') + if (argv[d->optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO @@ -757,38 +615,48 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], + argv[0], argv[d->optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); + argv[0], argv[d->optind - 1][0], + pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #endif } - nextchar += strlen (nextchar); + d->__nextchar += strlen (d->__nextchar); - optopt = pfound->val; + d->optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { - if (optind < argc) - optarg = argv[optind++]; + if (d->optind < argc) + d->optarg = argv[d->optind++]; else { if (print_errors) @@ -798,27 +666,36 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]) >= 0) + argv[0], argv[d->optind - 1]) >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); + argv[0], argv[d->optind - 1]); #endif } - nextchar += strlen (nextchar); - optopt = pfound->val; + d->__nextchar += strlen (d->__nextchar); + d->optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } - nextchar += strlen (nextchar); + d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) @@ -833,8 +710,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) + if (!long_only || argv[d->optind][1] == '-' + || strchr (optstring, *d->__nextchar) == NULL) { if (print_errors) { @@ -843,15 +720,15 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int n; #endif - if (argv[optind][1] == '-') + if (argv[d->optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); + argv[0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); + argv[0], d->__nextchar); #endif } else @@ -859,28 +736,36 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); + argv[0], argv[d->optind][0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); + argv[0], argv[d->optind][0], d->__nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #endif } - nextchar = (char *) ""; - optind++; - optopt = 0; + d->__nextchar = (char *) ""; + d->optind++; + d->optopt = 0; return '?'; } } @@ -888,12 +773,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) /* Look at and handle the next short option-character. */ { - char c = *nextchar++; - char *temp = my_index (optstring, c); + char c = *d->__nextchar++; + char *temp = strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; + if (*d->__nextchar == '\0') + ++d->optind; if (temp == NULL || c == ':') { @@ -904,7 +789,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int n; #endif - if (posixly_correct) + if (d->__posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO @@ -927,16 +812,24 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #endif } - optopt = c; + d->optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ @@ -951,14 +844,14 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int option_index; /* This is an option that requires an argument. */ - if (*nextchar != '\0') + if (*d->__nextchar != '\0') { - optarg = nextchar; + d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ - optind++; + d->optind++; } - else if (optind == argc) + else if (d->optind == argc) { if (print_errors) { @@ -970,11 +863,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) _("%s: option requires an argument -- %c\n"), argv[0], c) >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #else @@ -982,7 +883,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) argv[0], c); #endif } - optopt = c; + d->optopt = c; if (optstring[0] == ':') c = ':'; else @@ -990,22 +891,23 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) return c; } else - /* We already incremented `optind' once; + /* We already incremented `d->optind' once; increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; + d->optarg = argv[d->optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; + nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; @@ -1031,22 +933,30 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) char *buf; if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]) >= 0) + argv[0], argv[d->optind]) >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); + argv[0], argv[d->optind]); #endif } - nextchar += strlen (nextchar); - optind++; + d->__nextchar += strlen (d->__nextchar); + d->optind++; return '?'; } if (pfound != NULL) @@ -1057,7 +967,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) - optarg = nameend + 1; + d->optarg = nameend + 1; else { if (print_errors) @@ -1069,11 +979,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #else @@ -1083,14 +1002,14 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) #endif } - nextchar += strlen (nextchar); + d->__nextchar += strlen (d->__nextchar); return '?'; } } else if (pfound->has_arg == 1) { - if (optind < argc) - optarg = argv[optind++]; + if (d->optind < argc) + d->optarg = argv[d->optind++]; else { if (print_errors) @@ -1100,26 +1019,35 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]) >= 0) + argv[0], argv[d->optind - 1]) >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); + argv[0], argv[d->optind - 1]); #endif } - nextchar += strlen (nextchar); + d->__nextchar += strlen (d->__nextchar); return optstring[0] == ':' ? ':' : '?'; } } - nextchar += strlen (nextchar); + d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) @@ -1129,7 +1057,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) } return pfound->val; } - nextchar = NULL; + d->__nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') @@ -1137,26 +1065,26 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') + if (*d->__nextchar != '\0') { - optarg = nextchar; - optind++; + d->optarg = d->__nextchar; + d->optind++; } else - optarg = NULL; - nextchar = NULL; + d->optarg = NULL; + d->__nextchar = NULL; } else { /* This is an option that requires an argument. */ - if (*nextchar != '\0') + if (*d->__nextchar != '\0') { - optarg = nextchar; + d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ - optind++; + d->optind++; } - else if (optind == argc) + else if (d->optind == argc) { if (print_errors) { @@ -1168,11 +1096,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) %s: option requires an argument -- %c\n"), argv[0], c) >= 0) { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + free (buf); } #else @@ -1181,7 +1117,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) argv[0], c); #endif } - optopt = c; + d->optopt = c; if (optstring[0] == ':') c = ':'; else @@ -1190,8 +1126,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; + d->optarg = argv[d->optind++]; + d->__nextchar = NULL; } } return c; @@ -1199,18 +1135,40 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) } int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; +_getopt_internal (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct) { - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); + int result; + + getopt_data.optind = optind; + getopt_data.opterr = opterr; + + result = _getopt_internal_r (argc, argv, optstring, longopts, longind, + long_only, posixly_correct, &getopt_data); + + optind = getopt_data.optind; + optarg = getopt_data.optarg; + optopt = getopt_data.optopt; + + return result; +} + +/* glibc gets a LSB-compliant getopt. + Standalone applications get a POSIX-compliant getopt. */ +#if _LIBC +enum { POSIXLY_CORRECT = 0 }; +#else +enum { POSIXLY_CORRECT = 1 }; +#endif + +int +getopt (int argc, char *const *argv, const char *optstring) +{ + return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, + POSIXLY_CORRECT); } -#endif /* Not ELIDE_CODE. */ #ifdef TEST @@ -1218,9 +1176,7 @@ getopt (argc, argv, optstring) the above definition of `getopt'. */ int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int c; int digit_optind = 0; @@ -1283,6 +1239,3 @@ main (argc, argv) } #endif /* TEST */ - -/* arch-tag: 0e6da124-7269-4785-a9de-094c263d20dc - (do not change this comment) */ diff --git a/lib-src/getopt1.c b/lib-src/getopt1.c index 4ec1e50b830..5acd2245af0 100644 --- a/lib-src/getopt1.c +++ b/lib-src/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -26,36 +26,10 @@ #else # include "getopt.h" #endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif +#include "getopt_int.h" #include -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ @@ -67,14 +41,20 @@ #endif int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; +getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, + const struct option *long_options, int *opt_index) { - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 0, 0); +} + +int +_getopt_long_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 0, 0, d); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. @@ -83,31 +63,30 @@ getopt_long (argc, argv, options, long_options, opt_index) instead. */ int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; +getopt_long_only (int argc, char *__getopt_argv_const *argv, + const char *options, + const struct option *long_options, int *opt_index) { - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 1, 0); } -# ifdef _LIBC -libc_hidden_def (getopt_long) -libc_hidden_def (getopt_long_only) -# endif +int +_getopt_long_only_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 1, 0, d); +} -#endif /* Not ELIDE_CODE. */ #ifdef TEST #include int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int c; int digit_optind = 0; @@ -193,6 +172,3 @@ main (argc, argv) } #endif /* TEST */ - -/* arch-tag: 28a5c558-b0c0-4bff-b5bc-e2e20291d4b6 - (do not change this comment) */ diff --git a/lib-src/getopt_.h b/lib-src/getopt_.h new file mode 100644 index 00000000000..a4e78cb06bf --- /dev/null +++ b/lib-src/getopt_.h @@ -0,0 +1,227 @@ +/* Declarations for getopt. + Copyright (C) 1989-1994,1996-1999,2001,2003,2004 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +/* Standalone applications should #define __GETOPT_PREFIX to an + identifier that prefixes the external functions and variables + defined in this header. When this happens, include the + headers that might declare getopt so that they will not cause + confusion if included after this file. Then systematically rename + identifiers so that they do not collide with the system functions + and variables. Renaming avoids problems with some compilers and + linkers. */ +#if defined __GETOPT_PREFIX && !defined __need_getopt +# include +# include +# if HAVE_UNISTD_H +# include +# endif +# undef __need_getopt +# undef getopt +# undef getopt_long +# undef getopt_long_only +# undef optarg +# undef opterr +# undef optind +# undef optopt +# define __GETOPT_CONCAT(x, y) x ## y +# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) +# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) +# define getopt __GETOPT_ID (getopt) +# define getopt_long __GETOPT_ID (getopt_long) +# define getopt_long_only __GETOPT_ID (getopt_long_only) +# define optarg __GETOPT_ID (optarg) +# define opterr __GETOPT_ID (opterr) +# define optind __GETOPT_ID (optind) +# define optopt __GETOPT_ID (optopt) +#endif + +/* Standalone applications get correct prototypes for getopt_long and + getopt_long_only; they declare "char **argv". libc uses prototypes + with "char *const *argv" that are incorrect because getopt_long and + getopt_long_only can permute argv; this is required for backward + compatibility (e.g., for LSB 2.0.1). + + This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt', + but it caused redefinition warnings if both unistd.h and getopt.h were + included, since unistd.h includes getopt.h having previously defined + __need_getopt. + + The only place where __getopt_argv_const is used is in definitions + of getopt_long and getopt_long_only below, but these are visible + only if __need_getopt is not defined, so it is quite safe to rewrite + the conditional as follows: +*/ +#if !defined __need_getopt +# if defined __GETOPT_PREFIX +# define __getopt_argv_const /* empty */ +# else +# define __getopt_argv_const const +# endif +#endif + +/* If __GNU_LIBRARY__ is not already defined, either we are being used + standalone, or this is the first header included in the source file. + If we are being used with glibc, we need to include , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in for us + if it's from glibc. (Why ctype.h? It's guaranteed to exist and it + doesn't flood the namespace with stuff the way some other headers do.) */ +#if !defined __GNU_LIBRARY__ +# include +#endif + +#ifndef __THROW +# ifndef __GNUC_PREREQ +# define __GNUC_PREREQ(maj, min) (0) +# endif +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# else +# define __THROW +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ + const char *name; + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) + __THROW; + +#ifndef __need_getopt +extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW; +extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW; + +#endif + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/lib-src/getopt_int.h b/lib-src/getopt_int.h new file mode 100644 index 00000000000..401579fd289 --- /dev/null +++ b/lib-src/getopt_int.h @@ -0,0 +1,131 @@ +/* Internal declarations for getopt. + Copyright (C) 1989-1994,1996-1999,2001,2003,2004 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GETOPT_INT_H +#define _GETOPT_INT_H 1 + +extern int _getopt_internal (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct); + + +/* Reentrant versions which can handle parsing multiple argument + vectors at the same time. */ + +/* Data type for reentrant functions. */ +struct _getopt_data +{ + /* These have exactly the same meaning as the corresponding global + variables, except that they are used for the reentrant + versions of getopt. */ + int optind; + int opterr; + int optopt; + char *optarg; + + /* Internal members. */ + + /* True if the internal members have been initialized. */ + int __initialized; + + /* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + char *__nextchar; + + /* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters, or by calling getopt. + + PERMUTE is the default. We permute the contents of ARGV as we + scan, so that eventually all the non-options are at the end. + This allows options to be given in any order, even with programs + that were not written to expect this. + + RETURN_IN_ORDER is an option available to programs that were + written to expect options and other ARGV-elements in any order + and that care about the ordering of the two. We describe each + non-option ARGV-element as if it were the argument of an option + with character code 1. Using `-' as the first character of the + list of option characters selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + + enum + { + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER + } __ordering; + + /* If the POSIXLY_CORRECT environment variable is set + or getopt was called. */ + int __posixly_correct; + + + /* Handle permutation of arguments. */ + + /* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first + of them; `last_nonopt' is the index after the last of them. */ + + int __first_nonopt; + int __last_nonopt; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + int __nonoption_flags_max_len; + int __nonoption_flags_len; +# endif +}; + +/* The initializer is necessary to set OPTIND and OPTERR to their + default values and to clear the initialization flag. */ +#define _GETOPT_DATA_INITIALIZER { 1, 1 } + +extern int _getopt_internal_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct, + struct _getopt_data *__data); + +extern int _getopt_long_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + struct _getopt_data *__data); + +extern int _getopt_long_only_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, + int *__longind, + struct _getopt_data *__data); + +#endif /* getopt_int.h */ diff --git a/lib-src/gettext.h b/lib-src/gettext.h new file mode 100644 index 00000000000..285cb314ce9 --- /dev/null +++ b/lib-src/gettext.h @@ -0,0 +1,78 @@ +/* Convenience header for conditional use of GNU . + Copyright (C) 1995-1998, 2000-2002, 2004 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option. */ +#if ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of a NOP. We don't include + as well because people using "gettext.h" will not include , + and also including would fail on SunOS 4, whereas + is OK. */ +#if defined(__sun) +# include +#endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + , which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of a NOP. */ +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include +# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +# include +# endif +#endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +# define gettext(Msgid) ((const char *) (Msgid)) +# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) +# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define textdomain(Domainname) ((const char *) (Domainname)) +# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) +# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) + +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +#endif /* _LIBGETTEXT_H */ diff --git a/m4/getopt.m4 b/m4/getopt.m4 new file mode 100644 index 00000000000..051c64905b0 --- /dev/null +++ b/m4/getopt.m4 @@ -0,0 +1,78 @@ +# getopt.m4 serial 10 +dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# The getopt module assume you want GNU getopt, with getopt_long etc, +# rather than vanilla POSIX getopt. This means your your code should +# always include for the getopt prototypes. + +AC_DEFUN([gl_GETOPT_SUBSTITUTE], +[ + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_GETOPT_SUBSTITUTE_HEADER + gl_PREREQ_GETOPT +]) + +AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], +[ + GETOPT_H=getopt.h + AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], + [Define to rpl_ if the getopt replacement functions and variables + should be used.]) + AC_SUBST([GETOPT_H]) +]) + +AC_DEFUN([gl_GETOPT_CHECK_HEADERS], +[ + GETOPT_H= + AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h]) + if test -z "$GETOPT_H"; then + AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h]) + fi + + dnl BSD getopt_long uses an incompatible method to reset option processing, + dnl and (as of 2004-10-15) mishandles optional option-arguments. + if test -z "$GETOPT_H"; then + AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include ]) + fi + + dnl Solaris 10 getopt doesn't handle `+' as a leading character in an + dnl option string (as of 2005-05-05). + if test -z "$GETOPT_H"; then + AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([#include ], + [[ + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; + ]])], + [gl_cv_func_gnu_getopt=yes], + [gl_cv_func_gnu_getopt=no], + [dnl cross compiling - pessimistically guess based on decls + dnl Solaris 10 getopt doesn't handle `+' as a leading character in an + dnl option string (as of 2005-05-05). + AC_CHECK_DECL([getopt_clip], + [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes], + [#include ])])]) + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi +]) + +AC_DEFUN([gl_GETOPT_IFELSE], +[ + AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) + AS_IF([test -n "$GETOPT_H"], [$1], [$2]) +]) + +AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])]) + +# Prerequisites of lib/getopt*. +AC_DEFUN([gl_PREREQ_GETOPT], [:]) diff --git a/make-dist b/make-dist index 9f2c4bb1280..3381ee770eb 100755 --- a/make-dist +++ b/make-dist @@ -6,7 +6,7 @@ #### be distributed. This means that if you add a file with an odd name, #### you should make sure that this script will include it. -# Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2005 +# Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2005 # Free Software Foundation, Inc. # # This file is part of GNU Emacs. @@ -323,7 +323,7 @@ for subdir in lisp site-lisp lispref lispintro \ nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \ etc etc/e etc/images etc/images/gnus etc/images/smilies \ etc/tree-widget etc/tree-widget/default etc/tree-widget/folder \ - info man msdos vms mac mac/inc mac/inc/sys \ + info man m4 msdos vms mac mac/inc mac/inc/sys \ mac/src mac/Emacs.app mac/Emacs.app/Contents \ mac/Emacs.app/Contents/MacOS mac/Emacs.app/Contents/Resources \ mac/Emacs.app/Contents/Resources/English.lproj @@ -487,8 +487,13 @@ echo "Making links to \`lib-src'" done cd ../${tempdir}/lib-src rm -f Makefile.c + rm -f getopt.h rm -f =* TAGS) +echo "Making links to \`m4'" +(cd m4 + ln *.m4 ../${tempdir}/m4) + echo "Making links to \`nt'" (cd nt ln emacs.rc config.nt [a-z]*.c ../${tempdir}/nt diff --git a/nt/ChangeLog b/nt/ChangeLog index 3d846d9f837..88f3b02c68c 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,10 @@ +2005-07-26 Paul Eggert + + Merge gnulib getopt implementation into Emacs. + + * inc/gettext.h: Remove; no longer needed now that + lib-src/gettext.h exists. + 2005-07-16 Eli Zaretskii * configure.bat: Finish config.log with a line that indicates that diff --git a/src/ChangeLog b/src/ChangeLog index e352ada73a3..dd46874e679 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2005-07-26 Paul Eggert + + Merge gnulib getopt implementation into Emacs. + + * s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is + now part of lib-src. + 2005-07-26 Stefan Monnier * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters). diff --git a/src/s/cygwin.h b/src/s/cygwin.h index 0094ef793dc..ac977b8cb52 100644 --- a/src/s/cygwin.h +++ b/src/s/cygwin.h @@ -1,7 +1,7 @@ /* Template for system description header files. This file describes the parameters that system description files should define or not. - Copyright (C) 1985, 1986, 1992, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1992, 1999, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -123,8 +123,6 @@ Boston, MA 02110-1301, USA. */ emacs lisp pointers */ #define DATA_SEG_BITS 0x20000000 #define LINKER $(CC) -Wl,--image-base,DATA_SEG_BITS -/* gettext.h is in a strange place */ -#define C_SWITCH_SYSTEM -I/usr/share/gettext /* Use terminfo instead of termcap. Fewer environment variables to go wrong, more terminal types. */ From 52dbaac8bab7858f3bd7e204431e12154309cde8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 26 Jul 2005 21:44:41 +0000 Subject: [PATCH 43/69] Regenerate. --- configure | 488 +++++++++++++++++++++++++++++++++++++++++++++++++- src/config.in | 16 +- 2 files changed, 500 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 04887f10487..f16082beff3 100755 --- a/configure +++ b/configure @@ -310,7 +310,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INSTALL_INFO EGREP LIBSOUND SET_MAKE PKG_CONFIG GTK_CFLAGS GTK_LIBS ALLOCA liblockfile LIBOBJS NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS version configuration canonical srcdir lispdir locallisppath lisppath x_default_search_path etcdir archlibdir docdir bitmapdir gamedir gameuser c_switch_system c_switch_machine LD_SWITCH_X_SITE LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE X_TOOLKIT_TYPE machfile opsysfile carbon_appdir LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INSTALL_INFO EGREP LIBSOUND SET_MAKE PKG_CONFIG GTK_CFLAGS GTK_LIBS ALLOCA liblockfile LIBOBJS NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H GETOPTOBJS version configuration canonical srcdir lispdir locallisppath lisppath x_default_search_path etcdir archlibdir docdir bitmapdir gamedir gameuser c_switch_system c_switch_machine LD_SWITCH_X_SITE LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE X_TOOLKIT_TYPE machfile opsysfile carbon_appdir LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -16828,6 +16828,490 @@ _ACEOF fi +# Configure getopt. +# getopt.m4 serial 10 + +# The getopt module assume you want GNU getopt, with getopt_long etc, +# rather than vanilla POSIX getopt. This means your your code should +# always include for the getopt prototypes. + + + + + + + + + + + +# Prerequisites of lib/getopt*. + + + + GETOPT_H= + +for ac_header in getopt.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + GETOPT_H=getopt.h +fi + +done + + if test -z "$GETOPT_H"; then + +for ac_func in getopt_long_only +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + GETOPT_H=getopt.h +fi +done + + fi + + if test -z "$GETOPT_H"; then + echo "$as_me:$LINENO: checking whether optreset is declared" >&5 +echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_optreset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef optreset + char *p = (char *) optreset; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_optreset=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_optreset=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6 +if test $ac_cv_have_decl_optreset = yes; then + GETOPT_H=getopt.h +fi + + fi + + if test -z "$GETOPT_H"; then + echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 +echo $ECHO_N "checking for working GNU getopt function... $ECHO_C" >&6 +if test "${gl_cv_func_gnu_getopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 +echo $ECHO_N "checking whether getopt_clip is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getopt_clip+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef getopt_clip + char *p = (char *) getopt_clip; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getopt_clip=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getopt_clip=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getopt_clip" >&6 +if test $ac_cv_have_decl_getopt_clip = yes; then + gl_cv_func_gnu_getopt=no +else + gl_cv_func_gnu_getopt=yes +fi + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ + + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_gnu_getopt=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_gnu_getopt=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 +echo "${ECHO_T}$gl_cv_func_gnu_getopt" >&6 + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi + + + + if test -n "$GETOPT_H"; then + + + GETOPT_H=getopt.h + +cat >>confdefs.h <<\_ACEOF +#define __GETOPT_PREFIX rpl_ +_ACEOF + + + + : + GETOPTOBJS='getopt.o getopt1.o' + +fi + + + + echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6 if test "${ac_cv_func_getpgrp_void+set}" = set; then @@ -22646,6 +23130,8 @@ s,@LIBOBJS@,$LIBOBJS,;t t s,@NEED_SETGID@,$NEED_SETGID,;t t s,@KMEM_GROUP@,$KMEM_GROUP,;t t s,@GETLOADAVG_LIBS@,$GETLOADAVG_LIBS,;t t +s,@GETOPT_H@,$GETOPT_H,;t t +s,@GETOPTOBJS@,$GETOPTOBJS,;t t s,@version@,$version,;t t s,@configuration@,$configuration,;t t s,@canonical@,$canonical,;t t diff --git a/src/config.in b/src/config.in index d3369641a8f..f2afed2ecb1 100644 --- a/src/config.in +++ b/src/config.in @@ -191,6 +191,12 @@ Boston, MA 02110-1301, USA. */ /* Define to 1 if you have the `getloadavg' function. */ #undef HAVE_GETLOADAVG +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long_only' function. */ +#undef HAVE_GETOPT_LONG_ONLY + /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE @@ -785,9 +791,9 @@ Boston, MA 02110-1301, USA. */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ @@ -846,6 +852,10 @@ Boston, MA 02110-1301, USA. */ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + /* Define like PROTOTYPES; this can be used by system headers. */ #undef __PROTOTYPES From 0488749139fc79dce965a1fa11b1e3fedc7ba616 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 26 Jul 2005 21:46:50 +0000 Subject: [PATCH 44/69] Merge gnulib getopt implementation into Emacs. --- lib-src/getopt.h | 183 ----------------------------------------------- nt/inc/gettext.h | 72 ------------------- 2 files changed, 255 deletions(-) delete mode 100644 lib-src/getopt.h delete mode 100755 nt/inc/gettext.h diff --git a/lib-src/getopt.h b/lib-src/getopt.h deleted file mode 100644 index 953a7d15252..00000000000 --- a/lib-src/getopt.h +++ /dev/null @@ -1,183 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 -#endif - -/* If __GNU_LIBRARY__ is not already defined, either we are being used - standalone, or this is the first header included in the source file. - If we are being used with glibc, we need to include , but - that does not exist if we are standalone. So: if __GNU_LIBRARY__ is - not defined, include , which will pull in for us - if it's from glibc. (Why ctype.h? It's guaranteed to exist and it - doesn't flood the namespace with stuff the way some other headers do.) */ -#if !defined __GNU_LIBRARY__ -# include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -# if (defined __STDC__ && __STDC__) || defined __cplusplus - const char *name; -# else - char *name; -# endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#if (defined __STDC__ && __STDC__) || defined __cplusplus -# ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); -# else /* not __GNU_LIBRARY__ */ -extern int getopt (); -# endif /* __GNU_LIBRARY__ */ - -# ifndef __need_getopt -extern int getopt_long (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); -extern int getopt_long_only (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind, - int __long_only); -# endif -#else /* not __STDC__ */ -extern int getopt (); -# ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -# endif -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ - -/* arch-tag: 9adb7828-e6a6-40cd-8512-0cdf1f20ddd4 - (do not change this comment) */ diff --git a/nt/inc/gettext.h b/nt/inc/gettext.h deleted file mode 100755 index cd251314cb4..00000000000 --- a/nt/inc/gettext.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ - -#ifndef _LIBGETTEXT_H -#define _LIBGETTEXT_H 1 - -/* NLS can be disabled through the configure --disable-nls option. */ -#if ENABLE_NLS - -/* Get declarations of GNU message catalog functions. */ -# include - -#else - -/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which - chokes if dcgettext is defined as a macro. So include it now, to make - later inclusions of a NOP. We don't include - as well because people using "gettext.h" will not include , - and also including would fail on SunOS 4, whereas - is OK. */ -#if defined(__sun) -# include -#endif - -/* Disabled NLS. - The casts to 'const char *' serve the purpose of producing warnings - for invalid uses of the value returned from these functions. - On pre-ANSI systems without 'const', the config.h file is supposed to - contain "#define const". */ -# define gettext(Msgid) ((const char *) (Msgid)) -# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) -# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) -# define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define textdomain(Domainname) ((const char *) (Domainname)) -# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) -# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) - -#endif - -/* A pseudo function call that serves as a marker for the automated - extraction of messages, but does not call gettext(). The run-time - translation is done at a different place in the code. - The argument, String, should be a literal string. Concatenated strings - and other string expressions won't work. - The macro's expansion is not parenthesized, so that it is suitable as - initializer for static 'char[]' or 'const char[]' variables. */ -#define gettext_noop(String) String - -#endif /* _LIBGETTEXT_H */ - -/* arch-tag: 07b35a70-3531-4cda-9674-2968467143ec - (do not change this comment) */ From d7b7f3c485efff08112a2e9219458d57dff7c372 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 27 Jul 2005 01:31:21 +0000 Subject: [PATCH 45/69] Add arch tagline --- lib-src/getopt.c | 3 +++ lib-src/getopt1.c | 3 +++ lib-src/getopt_.h | 3 +++ lib-src/getopt_int.h | 3 +++ lib-src/gettext.h | 3 +++ m4/getopt.m4 | 4 ++++ 6 files changed, 19 insertions(+) diff --git a/lib-src/getopt.c b/lib-src/getopt.c index bcb81c83fe2..8cbe6e1a1da 100644 --- a/lib-src/getopt.c +++ b/lib-src/getopt.c @@ -1239,3 +1239,6 @@ main (int argc, char **argv) } #endif /* TEST */ + +/* arch-tag: 0e6da124-7269-4785-a9de-094c263d20dc + (do not change this comment) */ diff --git a/lib-src/getopt1.c b/lib-src/getopt1.c index 5acd2245af0..40c1d1695d3 100644 --- a/lib-src/getopt1.c +++ b/lib-src/getopt1.c @@ -172,3 +172,6 @@ main (int argc, char **argv) } #endif /* TEST */ + +/* arch-tag: 28a5c558-b0c0-4bff-b5bc-e2e20291d4b6 + (do not change this comment) */ diff --git a/lib-src/getopt_.h b/lib-src/getopt_.h index a4e78cb06bf..2c2c1d458ef 100644 --- a/lib-src/getopt_.h +++ b/lib-src/getopt_.h @@ -225,3 +225,6 @@ extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, #undef __need_getopt #endif /* getopt.h */ + +/* arch-tag: e36f5607-3ac6-4cdc-9aa7-c26c6525fe9b + (do not change this comment) */ diff --git a/lib-src/getopt_int.h b/lib-src/getopt_int.h index 401579fd289..6d47d2f0b8c 100644 --- a/lib-src/getopt_int.h +++ b/lib-src/getopt_int.h @@ -129,3 +129,6 @@ extern int _getopt_long_only_r (int ___argc, char **___argv, struct _getopt_data *__data); #endif /* getopt_int.h */ + +/* arch-tag: 8bfc548f-23d6-46aa-b5b5-2739b0edaf79 + (do not change this comment) */ diff --git a/lib-src/gettext.h b/lib-src/gettext.h index 285cb314ce9..ba484b3d1d9 100644 --- a/lib-src/gettext.h +++ b/lib-src/gettext.h @@ -76,3 +76,6 @@ #define gettext_noop(String) String #endif /* _LIBGETTEXT_H */ + +/* arch-tag: 3d01bb8e-82e3-4674-9812-de4c4224f7d1 + (do not change this comment) */ diff --git a/m4/getopt.m4 b/m4/getopt.m4 index 051c64905b0..dbcc44d9095 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -76,3 +76,7 @@ AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])]) # Prerequisites of lib/getopt*. AC_DEFUN([gl_PREREQ_GETOPT], [:]) + +ifelse(dnl Do not change this comment + arch-tag: 6c64a021-551c-4a7f-9c63-cd7e1ce54707 +)dnl From c03ac7281cd6cc7fcb4d9bcfa29d3a2b56e7cf10 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 27 Jul 2005 01:46:58 +0000 Subject: [PATCH 46/69] Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 96) - Update from CVS 2005-07-26 Katsumi Yamaoka * lisp/gnus/gnus-art.el (gnus-article-next-page-1): Don't scroll if there're fewer lines than that of scroll-margin. (gnus-article-prev-page): Narrow the range to bind scroll-in-place. --- lisp/gnus/ChangeLog | 6 ++++++ lisp/gnus/gnus-art.el | 26 +++++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 85bf600cf2d..992c351ef31 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2005-07-26 Katsumi Yamaoka + + * gnus-art.el (gnus-article-next-page-1): Don't scroll if there're + fewer lines than that of scroll-margin. + (gnus-article-prev-page): Narrow the range to bind scroll-in-place. + 2005-07-25 Katsumi Yamaoka * gnus-art.el (gnus-article-next-page): Revert. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 3b2dd8cb994..f7e3420e922 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5197,13 +5197,17 @@ specifies." 1 0))))))) (defun gnus-article-next-page-1 (lines) - (let ((scroll-in-place nil)) + (unless (and (not (featurep 'xemacs)) + (> (symbol-value 'scroll-margin) 0) + (<= (count-lines (window-start) (point-max)) + (symbol-value 'scroll-margin))) (condition-case () - (scroll-up lines) + (let ((scroll-in-place nil)) + (scroll-up lines)) (end-of-buffer ;; Long lines may cause an end-of-buffer error. - (goto-char (point-max))))) - (gnus-article-beginning-of-window)) + (goto-char (point-max)))) + (gnus-article-beginning-of-window))) (defun gnus-article-prev-page (&optional lines) "Show previous page of current article. @@ -5217,13 +5221,13 @@ Argument LINES specifies lines to be scrolled down." (gnus-narrow-to-page -1) ;Go to previous page. (goto-char (point-max)) (recenter -1)) - (let ((scroll-in-place nil)) - (prog1 - (condition-case () - (scroll-down lines) - (beginning-of-buffer - (goto-char (point-min)))) - (gnus-article-beginning-of-window))))) + (prog1 + (condition-case () + (let ((scroll-in-place nil)) + (scroll-down lines)) + (beginning-of-buffer + (goto-char (point-min)))) + (gnus-article-beginning-of-window)))) (defun gnus-article-only-boring-p () "Decide whether there is only boring text remaining in the article. From e06fd46505441392eda1773e4c5650efd80be9f7 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 27 Jul 2005 07:59:17 +0000 Subject: [PATCH 47/69] (ps-mule-bitmap-prologue): Fix arguments to setcharwidth. --- lisp/ps-mule.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index 3f28771f3a0..2bae4de7d44 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el @@ -1236,7 +1236,7 @@ NewBitmapDict } ifelse /FirstCode -1 store - bmp 0 get SpaceWidthRatio ratio div mul size div 0 % wx wy + bmp 0 get size div 0 % wx wy setcharwidth % We can't use setcachedevice here. bmp 1 get 0 gt bmp 2 get 0 gt and { From 3509543ca9141609638018dc7fa91ddaf425037d Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 27 Jul 2005 08:00:52 +0000 Subject: [PATCH 48/69] (bdf-read-font-info): Ignore glyphs whose ENCODING is negative. --- lisp/ChangeLog | 8 ++++++++ lisp/ps-bdf.el | 26 ++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cb7ae71c671..9e7f79c2965 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2005-07-27 Kenichi Handa + + * ps-bdf.el (bdf-read-font-info): Ignore glyphs whose ENCODING is + negative. + + * ps-mule.el (ps-mule-bitmap-prologue): Fix arguments to + setcharwidth. + 2005-07-26 Stefan Monnier * smerge-mode.el (smerge-ediff): Use insert-buffer-substring. diff --git a/lisp/ps-bdf.el b/lisp/ps-bdf.el index 056438a2bc5..6cc23f7bf6b 100644 --- a/lisp/ps-bdf.el +++ b/lisp/ps-bdf.el @@ -272,18 +272,20 @@ CODE, where N and CODE are in the following relation: (while (search-forward "\nSTARTCHAR" nil t) (setq offset (line-beginning-position)) (search-forward "\nENCODING") - (setq code (read (current-buffer)) - code0 (lsh code -8) - code1 (logand code 255) - min-code (min min-code code) - max-code (max max-code code) - min-code0 (min min-code0 code0) - max-code0 (max max-code0 code0) - min-code1 (min min-code1 code1) - max-code1 (max max-code1 code1)) - (search-forward "ENDCHAR") - (setq maxlen (max maxlen (- (point) offset)) - glyph-list (cons (cons code offset) glyph-list))) + (setq code (read (current-buffer))) + (if (< code 0) + (search-forward "ENDCHAR") + (setq code0 (lsh code -8) + code1 (logand code 255) + min-code (min min-code code) + max-code (max max-code code) + min-code0 (min min-code0 code0) + max-code0 (max max-code0 code0) + min-code1 (min min-code1 code1) + max-code1 (max max-code1 code1)) + (search-forward "ENDCHAR") + (setq maxlen (max maxlen (- (point) offset)) + glyph-list (cons (cons code offset) glyph-list)))) (setq code-range (vector min-code0 max-code0 min-code1 max-code1 From 2f3a9d50b8e495383a2ee0fc7e95728bc81be7ca Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 27 Jul 2005 12:35:51 +0000 Subject: [PATCH 49/69] (ps-mule-composition-prologue): Fix for the case that RelativeCompose is false. --- lisp/ChangeLog | 2 ++ lisp/ps-mule.el | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9e7f79c2965..0deea9eb612 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,8 @@ * ps-mule.el (ps-mule-bitmap-prologue): Fix arguments to setcharwidth. + (ps-mule-composition-prologue): Fix for the case that + RelativeCompose is false. 2005-07-26 Stefan Monnier diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index 2bae4de7d44..e57e030c40b 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el @@ -1039,9 +1039,12 @@ the sequence." /BOTTOM LLY def currentfont /RelativeCompose known { /relative currentfont /RelativeCompose get def + relative false eq { + %% Disable relative composition by setting sufficiently low + %% and high positions. + /relative [ -100000 100000 ] def + } if } { - %% Disable relative composition by setting sufficiently low - %% and high positions. /relative [ -100000 100000 ] def } ifelse [ elt 0 0 ] From 653aea227f302ac3f9e4bbaaa85bb8b39ea3d8f2 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 27 Jul 2005 15:26:36 +0000 Subject: [PATCH 50/69] *** empty log message *** --- lispref/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index cee4c55eb7d..f6a94881dfd 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2005-07-27 Luc Teirlinck + + * modes.texi (Defining Minor Modes): The keyword for the initial + value is :init-value, not :initial-value. + 2005-07-23 Eli Zaretskii * loading.texi (Autoload): Make the `doctor' example be consistent From e890842c416274d634b715defeab4528cd260373 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 27 Jul 2005 15:30:42 +0000 Subject: [PATCH 51/69] (Defining Minor Modes): The keyword for the initial value is :init-value, not :initial-value. --- lispref/modes.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lispref/modes.texi b/lispref/modes.texi index 132c309cb96..053e7a511e8 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -1472,7 +1472,7 @@ When Hungry mode is enabled, the control delete key gobbles all preceding whitespace except the last. See the command \\[hungry-electric-delete]." ;; The initial value. - :initial-value nil + :init-value nil ;; The indicator for the mode line. :lighter " Hungry" ;; The minor mode bindings. From 4f0c9ba732c47b273fdb409f258570eae51b94e9 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Wed, 27 Jul 2005 18:02:08 +0000 Subject: [PATCH 52/69] * term/apollo.el (terminal-init-apollo): New function containing all former top level forms in the file. * term/bobcat.el (terminal-init-bobcat): * term/cygwin.el (terminal-init-cygwin): * term/iris-ansi.el (terminal-init-iris-ansi): * term/linux.el (terminal-init-linux): * term/news.el (terminal-init-news): * term/rxvt.el (terminal-init-rxvt): * term/sun.el (terminal-init-sun): * term/tvi970.el (terminal-init-tvi970): * term/vt100.el (terminal-init-vt100): * term/vt102.el (terminal-init-vt102): * term/vt125.el (terminal-init-vt125): * term/vt200.el (terminal-init-vt200): * term/vt201.el (terminal-init-vt201): * term/vt220.el (terminal-init-vt220): * term/vt240.el (terminal-init-vt240): * term/vt300.el (terminal-init-vt300): * term/vt320.el (terminal-init-vt320): * term/vt400.el (terminal-init-vt400): * term/vt420.el (terminal-init-vt420): * term/wyse50.el (terminal-init-wyse50): * term/xterm.el (terminal-init-xterm): Likewise. * term/README: Describe the terminal-init-* functionality. * startup.el (command-line): After loading the terminal initialization file call the corresponding terminal initialization function. --- lisp/ChangeLog | 32 +++ lisp/startup.el | 8 +- lisp/term/README | 7 +- lisp/term/apollo.el | 5 +- lisp/term/bobcat.el | 9 +- lisp/term/cygwin.el | 5 +- lisp/term/iris-ansi.el | 588 +++++++++++++++++++++-------------------- lisp/term/linux.el | 22 +- lisp/term/news.el | 80 +++--- lisp/term/rxvt.el | 256 +++++++++--------- lisp/term/sun.el | 216 +++++++-------- lisp/term/tvi970.el | 137 +++++----- lisp/term/vt100.el | 6 +- lisp/term/vt102.el | 4 +- lisp/term/vt125.el | 4 +- lisp/term/vt200.el | 8 +- lisp/term/vt201.el | 9 +- lisp/term/vt220.el | 9 +- lisp/term/vt240.el | 9 +- lisp/term/vt300.el | 9 +- lisp/term/vt320.el | 9 +- lisp/term/vt400.el | 9 +- lisp/term/vt420.el | 9 +- lisp/term/wyse50.el | 167 ++++++------ lisp/term/xterm.el | 417 ++++++++++++++--------------- 25 files changed, 1060 insertions(+), 974 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0deea9eb612..ead88578764 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,35 @@ +2005-07-27 Dan Nicolaescu + + * term/apollo.el (terminal-init-apollo): New function containing + all former top level forms in the file. + * term/bobcat.el (terminal-init-bobcat): + * term/cygwin.el (terminal-init-cygwin): + * term/iris-ansi.el (terminal-init-iris-ansi): + * term/linux.el (terminal-init-linux): + * term/news.el (terminal-init-news): + * term/rxvt.el (terminal-init-rxvt): + * term/sun.el (terminal-init-sun): + * term/tvi970.el (terminal-init-tvi970): + * term/vt100.el (terminal-init-vt100): + * term/vt102.el (terminal-init-vt102): + * term/vt125.el (terminal-init-vt125): + * term/vt200.el (terminal-init-vt200): + * term/vt201.el (terminal-init-vt201): + * term/vt220.el (terminal-init-vt220): + * term/vt240.el (terminal-init-vt240): + * term/vt300.el (terminal-init-vt300): + * term/vt320.el (terminal-init-vt320): + * term/vt400.el (terminal-init-vt400): + * term/vt420.el (terminal-init-vt420): + * term/wyse50.el (terminal-init-wyse50): + * term/xterm.el (terminal-init-xterm): Likewise. + + * term/README: Describe the terminal-init-* functionality. + + * startup.el (command-line): After loading the terminal + initialization file call the corresponding terminal initialization + function. + 2005-07-27 Kenichi Handa * ps-bdf.el (bdf-read-font-info): Ignore glyphs whose ENCODING is diff --git a/lisp/startup.el b/lisp/startup.el index da05912d92f..b2afdb744c1 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -984,7 +984,13 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (setq term (if (setq hyphend (string-match "[-_][^-_]+$" term)) (substring term 0 hyphend) - nil))))) + nil))) + (when term + ;; The terminal file has been loaded, now call the terminal + ;; specific initialization function. + (let ((term-init-func (intern (concat "terminal-init-" term)))) + (when (fboundp term-init-func) + (funcall term-init-func)))))) ;; Update the out-of-memory error message based on user's key bindings ;; for save-some-buffers. diff --git a/lisp/term/README b/lisp/term/README index 76c64435af1..581f321d3ba 100644 --- a/lisp/term/README +++ b/lisp/term/README @@ -8,7 +8,12 @@ that exists, the last hyphen and what follows it is stripped. If that doesn't yield a file that exists, the previous hyphen is stripped, and so on until all hyphens are gone. For example, if the terminal type is `aaa-48-foo', Emacs will try first `term/aaa-48-foo.el', then `term/aaa-48.el' and finally -`term/aaa.el'. +`term/aaa.el'. Each terminal specific file should contain a function +named terminal-init-TERMINALNAME (eg terminal-init-aaa-48 for +term/aaa-48.el) that Emacs will call in order to initialize the +terminal. The terminal files should not contain any top level forms +that are executed when the file is loaded, all the initialization +actions are performed by the terminal-init-TERMINALNAME functions. When writing terminal packages, there are some things it is good to keep in mind. diff --git a/lisp/term/apollo.el b/lisp/term/apollo.el index 1d04fd35245..749ff85a0a6 100644 --- a/lisp/term/apollo.el +++ b/lisp/term/apollo.el @@ -1,6 +1,7 @@ ;; -*- no-byte-compile: t -*- - -(load "term/vt100" nil t) +(defun terminal-init-apollo () + "Terminal initialization function for apollo." + (load "term/vt100" nil t)) ;;; arch-tag: c72f446f-e6b7-4749-90a4-bd68632adacf ;;; apollo.el ends here diff --git a/lisp/term/bobcat.el b/lisp/term/bobcat.el index b11a4ff8309..82401f7bf71 100644 --- a/lisp/term/bobcat.el +++ b/lisp/term/bobcat.el @@ -1,7 +1,10 @@ ;; -*- no-byte-compile: t -*- -;;; HP terminals usually encourage using ^H as the rubout character -(keyboard-translate ?\177 ?\^h) -(keyboard-translate ?\^h ?\177) + +(defun terminal-init-bobcat () + "Terminal initialization function for bobcat." + ;; HP terminals usually encourage using ^H as the rubout character + (keyboard-translate ?\177 ?\^h) + (keyboard-translate ?\^h ?\177)) ;;; arch-tag: 754e4520-0a3e-4e6e-8ca5-9481b1f85cf7 ;;; bobcat.el ends here diff --git a/lisp/term/cygwin.el b/lisp/term/cygwin.el index d604e0207a0..3bdd5d3aa05 100644 --- a/lisp/term/cygwin.el +++ b/lisp/term/cygwin.el @@ -1,7 +1,10 @@ ;;; cygwin.el --- support for the Cygwin terminal -*- no-byte-compile: t -*- ;;; The Cygwin terminal can't really display underlines. -(tty-no-underline) + +(defun terminal-init-cygwin () + "Terminal initialization function for cygwin." + (tty-no-underline)) ;; arch-tag: ca81ce67-3c41-4883-a29b-4c3d64a21191 ;;; cygwin.el ends here diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el index eae2f419378..ef59860b606 100644 --- a/lisp/term/iris-ansi.el +++ b/lisp/term/iris-ansi.el @@ -1,6 +1,6 @@ ;;; iris-ansi.el --- configure Emacs for SGI xwsh and winterm apps -*- no-byte-compile: t -*- -;; Copyright (C) 1997 Free Software Foundation, Inc. +;; Copyright (C) 1997, 2005 Free Software Foundation, Inc. ;; Author: Dan Nicolaescu @@ -25,302 +25,306 @@ ;;; Code: -(define-key function-key-map "\e[120q" [S-escape]) -(define-key function-key-map "\e[121q" [C-escape]) - -(define-key function-key-map "\e[001q" [f1]) -(define-key function-key-map "\e[013q" [S-f1]) -(define-key function-key-map "\e[025q" [C-f1]) - - -(define-key function-key-map "\e[002q" [f2]) -(define-key function-key-map "\e[014q" [S-f2]) -(define-key function-key-map "\e[026q" [C-f2]) -(define-key function-key-map "\e[038q" [M-f2]) - -(define-key function-key-map "\e[003q" [f3]) -(define-key function-key-map "\e[015q" [S-f3]) -(define-key function-key-map "\e[027q" [C-f3]) - - -(define-key function-key-map "\e[004q" [f4]) -(define-key function-key-map "\e[016q" [S-f4]) -(define-key function-key-map "\e[028q" [C-f4]) - - -(define-key function-key-map "\e[005q" [f5]) -(define-key function-key-map "\e[017q" [S-f5]) -(define-key function-key-map "\e[029q" [C-f5]) - - -(define-key function-key-map "\e[006q" [f6]) -(define-key function-key-map "\e[018q" [S-f6]) -(define-key function-key-map "\e[030q" [C-f6]) - - -(define-key function-key-map "\e[007q" [f7]) -(define-key function-key-map "\e[019q" [S-f7]) -(define-key function-key-map "\e[031q" [C-f7]) - - -(define-key function-key-map "\e[008q" [f8]) -(define-key function-key-map "\e[020q" [S-f8]) -(define-key function-key-map "\e[032q" [C-f8]) - - -(define-key function-key-map "\e[009q" [f9]) -(define-key function-key-map "\e[021q" [S-f9]) -(define-key function-key-map "\e[033q" [C-f9]) - - -(define-key function-key-map "\e[010q" [f10]) -(define-key function-key-map "\e[022q" [S-f10]) -(define-key function-key-map "\e[034q" [C-f10]) - - -(define-key function-key-map "\e[011q" [f11]) -(define-key function-key-map "\e[023q" [S-f11]) -(define-key function-key-map "\e[035q" [C-f11]) -(define-key function-key-map "\e[047q" [M-f11]) - -(define-key function-key-map "\e[012q" [f12]) -(define-key function-key-map "\e[024q" [S-f12]) -(define-key function-key-map "\e[036q" [C-f12]) -(define-key function-key-map "\e[048q" [M-f12]) - - -(define-key function-key-map "\e[057q" [C-`]) -(define-key function-key-map "\e[115q" [M-`]) - -(define-key function-key-map "\e[049q" [?\C-1]) -(define-key function-key-map "\e[058q" [?\M-1]) - - -(define-key function-key-map "\e[059q" [?\M-2]) - -(define-key function-key-map "\e[050q" [?\C-3]) -(define-key function-key-map "\e[060q" [?\M-3]) - -(define-key function-key-map "\e[051q" [?\C-4]) -(define-key function-key-map "\e[061q" [?\M-4]) - -(define-key function-key-map "\e[052q" [?\C-5]) -(define-key function-key-map "\e[062q" [?\M-5]) - - -(define-key function-key-map "\e[063q" [?\M-6]) - -(define-key function-key-map "\e[053q" [?\C-7]) -(define-key function-key-map "\e[064q" [?\M-7]) - -(define-key function-key-map "\e[054q" [?\C-8]) -(define-key function-key-map "\e[065q" [?\M-8]) - -(define-key function-key-map "\e[055q" [?\C-9]) -(define-key function-key-map "\e[066q" [?\M-9]) - -(define-key function-key-map "\e[056q" [?\C-0]) -(define-key function-key-map "\e[067q" [?\M-0]) - -(define-key function-key-map "\e[068q" [?\M--]) - -(define-key function-key-map "\e[069q" [?\C-=]) -(define-key function-key-map "\e[070q" [?\M-=]) - -;; I don't know what to do with those. -;(define-key function-key-map "^H" []) -;(define-key function-key-map "^H" [S-]) -;(define-key function-key-map "\177" [C-]) -;(define-key function-key-map "\e[071q" [M-]) - -(define-key function-key-map "\e[Z" [?\S-\t]) -(define-key function-key-map "\e[072q" [?\C-\t]) -;; This only works if you remove the M-TAB keybing from the system.4Dwmrc -;; our your ~/.4Dwmrc, if you use the 4Dwm window manager. -(define-key function-key-map "\e[073q" [?\M-\t]) - -(define-key function-key-map "\e[074q" [?\M-q]) - -(define-key function-key-map "\e[075q" [?\M-w]) - -(define-key function-key-map "\e[076q" [?\M-e]) - -(define-key function-key-map "\e[077q" [?\M-r]) - -(define-key function-key-map "\e[078q" [?\M-t]) - -(define-key function-key-map "\e[079q" [?\M-y]) - -(define-key function-key-map "\e[080q" [?\M-u]) - -(define-key function-key-map "\e[081q" [?\M-i]) - -(define-key function-key-map "\e[082q" [?\M-o]) - -(define-key function-key-map "\e[083q" [?\M-p]) - -(define-key function-key-map "\e[084q" [?\M-\[]) - -(define-key function-key-map "\e[085q" [?\M-\]]) - -(define-key function-key-map "\e[086q" [?\M-\\]) - -(define-key function-key-map "\e[087q" [?\M-a]) - -(define-key function-key-map "\e[088q" [?\M-s]) - -(define-key function-key-map "\e[089q" [?\M-d]) - -(define-key function-key-map "\e[090q" [?\M-f]) - -(define-key function-key-map "\e[091q" [?\M-g]) - -(define-key function-key-map "\e[092q" [?\M-h]) - -(define-key function-key-map "\e[093q" [?\M-j]) - -(define-key function-key-map "\e[094q" [?\M-k]) - -(define-key function-key-map "\e[095q" [?\M-l]) - -(define-key function-key-map "\e[096q" [?\C-\;]) -(define-key function-key-map "\e[097q" [?\M-:]) ;; we are cheating - ;; here, this is realy - ;; M-;, but M-: - ;; generates the same - ;; string and is more - ;; usefull. - -(define-key function-key-map "\e[098q" [?\C-']) -(define-key function-key-map "\e[099q" [?\M-']) - -(define-key function-key-map "\e[100q" [?\M-\n]) - -(define-key function-key-map "\e[101q" [?\M-z]) - -(define-key function-key-map "\e[102q" [?\M-x]) - -(define-key function-key-map "\e[103q" [?\M-c]) - -(define-key function-key-map "\e[104q" [?\M-v]) - -(define-key function-key-map "\e[105q" [?\M-b]) - -(define-key function-key-map "\e[106q" [M-n]) - -(define-key function-key-map "\e[107q" [M-m]) - -(define-key function-key-map "\e[108q" [?\C-,]) -(define-key function-key-map "\e[109q" [?\M-,]) - -(define-key function-key-map "\e[110q" [?\C-.]) -(define-key function-key-map "\e[111q" [?\M-.]) - -(define-key function-key-map "\e[112q" [?\C-/]) -(define-key function-key-map "\e[113q" [?\M-/]) - -(define-key function-key-map "\e[139q" [insert]) -(define-key function-key-map "\e[139q" [S-insert]) -(define-key function-key-map "\e[140q" [C-insert]) -(define-key function-key-map "\e[141q" [M-insert]) - -(define-key function-key-map "\e[H" [home]) -(define-key function-key-map "\e[143q" [S-home]) -(define-key function-key-map "\e[144q" [C-home]) - - -(define-key function-key-map "\e[150q" [prior]) -(define-key function-key-map "\e[151q" [S-prior]) ;; those don't seem +(defun iris-ansi-initialize-terminal () + "Terminal initialization function for iris-ansi." + (define-key function-key-map "\e[120q" [S-escape]) + (define-key function-key-map "\e[121q" [C-escape]) + + (define-key function-key-map "\e[001q" [f1]) + (define-key function-key-map "\e[013q" [S-f1]) + (define-key function-key-map "\e[025q" [C-f1]) + + + (define-key function-key-map "\e[002q" [f2]) + (define-key function-key-map "\e[014q" [S-f2]) + (define-key function-key-map "\e[026q" [C-f2]) + (define-key function-key-map "\e[038q" [M-f2]) + + (define-key function-key-map "\e[003q" [f3]) + (define-key function-key-map "\e[015q" [S-f3]) + (define-key function-key-map "\e[027q" [C-f3]) + + + (define-key function-key-map "\e[004q" [f4]) + (define-key function-key-map "\e[016q" [S-f4]) + (define-key function-key-map "\e[028q" [C-f4]) + + + (define-key function-key-map "\e[005q" [f5]) + (define-key function-key-map "\e[017q" [S-f5]) + (define-key function-key-map "\e[029q" [C-f5]) + + + (define-key function-key-map "\e[006q" [f6]) + (define-key function-key-map "\e[018q" [S-f6]) + (define-key function-key-map "\e[030q" [C-f6]) + + + (define-key function-key-map "\e[007q" [f7]) + (define-key function-key-map "\e[019q" [S-f7]) + (define-key function-key-map "\e[031q" [C-f7]) + + + (define-key function-key-map "\e[008q" [f8]) + (define-key function-key-map "\e[020q" [S-f8]) + (define-key function-key-map "\e[032q" [C-f8]) + + + (define-key function-key-map "\e[009q" [f9]) + (define-key function-key-map "\e[021q" [S-f9]) + (define-key function-key-map "\e[033q" [C-f9]) + + + (define-key function-key-map "\e[010q" [f10]) + (define-key function-key-map "\e[022q" [S-f10]) + (define-key function-key-map "\e[034q" [C-f10]) + + + (define-key function-key-map "\e[011q" [f11]) + (define-key function-key-map "\e[023q" [S-f11]) + (define-key function-key-map "\e[035q" [C-f11]) + (define-key function-key-map "\e[047q" [M-f11]) + + (define-key function-key-map "\e[012q" [f12]) + (define-key function-key-map "\e[024q" [S-f12]) + (define-key function-key-map "\e[036q" [C-f12]) + (define-key function-key-map "\e[048q" [M-f12]) + + + (define-key function-key-map "\e[057q" [?\C-`]) + (define-key function-key-map "\e[115q" [?\M-`]) + + (define-key function-key-map "\e[049q" [?\C-1]) + (define-key function-key-map "\e[058q" [?\M-1]) + + + (define-key function-key-map "\e[059q" [?\M-2]) + + (define-key function-key-map "\e[050q" [?\C-3]) + (define-key function-key-map "\e[060q" [?\M-3]) + + (define-key function-key-map "\e[051q" [?\C-4]) + (define-key function-key-map "\e[061q" [?\M-4]) + + (define-key function-key-map "\e[052q" [?\C-5]) + (define-key function-key-map "\e[062q" [?\M-5]) + + + (define-key function-key-map "\e[063q" [?\M-6]) + + (define-key function-key-map "\e[053q" [?\C-7]) + (define-key function-key-map "\e[064q" [?\M-7]) + + (define-key function-key-map "\e[054q" [?\C-8]) + (define-key function-key-map "\e[065q" [?\M-8]) + + (define-key function-key-map "\e[055q" [?\C-9]) + (define-key function-key-map "\e[066q" [?\M-9]) + + (define-key function-key-map "\e[056q" [?\C-0]) + (define-key function-key-map "\e[067q" [?\M-0]) + + (define-key function-key-map "\e[068q" [?\M--]) + + (define-key function-key-map "\e[069q" [?\C-=]) + (define-key function-key-map "\e[070q" [?\M-=]) + + ;; I don't know what to do with those. + ;;(define-key function-key-map "^H" []) + ;;(define-key function-key-map "^H" [S-]) + ;;(define-key function-key-map "\177" [C-]) + ;;(define-key function-key-map "\e[071q" [M-]) + + (define-key function-key-map "\e[Z" [?\S-\t]) + (define-key function-key-map "\e[072q" [?\C-\t]) + ;; This only works if you remove the M-TAB keybing from the system.4Dwmrc + ;; our your ~/.4Dwmrc, if you use the 4Dwm window manager. + (define-key function-key-map "\e[073q" [?\M-\t]) + + (define-key function-key-map "\e[074q" [?\M-q]) + + (define-key function-key-map "\e[075q" [?\M-w]) + + (define-key function-key-map "\e[076q" [?\M-e]) + + (define-key function-key-map "\e[077q" [?\M-r]) + + (define-key function-key-map "\e[078q" [?\M-t]) + + (define-key function-key-map "\e[079q" [?\M-y]) + + (define-key function-key-map "\e[080q" [?\M-u]) + + (define-key function-key-map "\e[081q" [?\M-i]) + + (define-key function-key-map "\e[082q" [?\M-o]) + + (define-key function-key-map "\e[083q" [?\M-p]) + + (define-key function-key-map "\e[084q" [?\M-\[]) + + (define-key function-key-map "\e[085q" [?\M-\]]) + + (define-key function-key-map "\e[086q" [?\M-\\]) + + (define-key function-key-map "\e[087q" [?\M-a]) + + (define-key function-key-map "\e[088q" [?\M-s]) + + (define-key function-key-map "\e[089q" [?\M-d]) + + (define-key function-key-map "\e[090q" [?\M-f]) + + (define-key function-key-map "\e[091q" [?\M-g]) + + (define-key function-key-map "\e[092q" [?\M-h]) + + (define-key function-key-map "\e[093q" [?\M-j]) + + (define-key function-key-map "\e[094q" [?\M-k]) + + (define-key function-key-map "\e[095q" [?\M-l]) + + (define-key function-key-map "\e[096q" [?\C-\;]) + (define-key function-key-map "\e[097q" [?\M-:]) ;; we are cheating + ;; here, this is + ;; realy M-;, but + ;; M-: generates the + ;; same string and + ;; is more usefull. + + (define-key function-key-map "\e[098q" [?\C-']) + (define-key function-key-map "\e[099q" [?\M-']) + + (define-key function-key-map "\e[100q" [?\M-\n]) + + (define-key function-key-map "\e[101q" [?\M-z]) + + (define-key function-key-map "\e[102q" [?\M-x]) + + (define-key function-key-map "\e[103q" [?\M-c]) + + (define-key function-key-map "\e[104q" [?\M-v]) + + (define-key function-key-map "\e[105q" [?\M-b]) + + (define-key function-key-map "\e[106q" [M-n]) + + (define-key function-key-map "\e[107q" [M-m]) + + (define-key function-key-map "\e[108q" [?\C-,]) + (define-key function-key-map "\e[109q" [?\M-,]) + + (define-key function-key-map "\e[110q" [?\C-.]) + (define-key function-key-map "\e[111q" [?\M-.]) + + (define-key function-key-map "\e[112q" [?\C-/]) + (define-key function-key-map "\e[113q" [?\M-/]) + + (define-key function-key-map "\e[139q" [insert]) + (define-key function-key-map "\e[139q" [S-insert]) + (define-key function-key-map "\e[140q" [C-insert]) + (define-key function-key-map "\e[141q" [M-insert]) + + (define-key function-key-map "\e[H" [home]) + (define-key function-key-map "\e[143q" [S-home]) + (define-key function-key-map "\e[144q" [C-home]) + + + (define-key function-key-map "\e[150q" [prior]) + (define-key function-key-map "\e[151q" [S-prior]) ;; those don't + ;; seem to + ;; generate + ;; anything + (define-key function-key-map "\e[152q" [C-prior]) + + + ;; (define-key function-key-map "^?" [delete]) + (define-key function-key-map "\e[P" [S-delete]) + (define-key function-key-map "\e[142q" [C-delete]) + (define-key function-key-map "\e[M" [M-delete]) + + (define-key function-key-map "\e[146q" [end]) + (define-key function-key-map "\e[147q" [S-end]) ;; those don't seem ;; to generate ;; anything -(define-key function-key-map "\e[152q" [C-prior]) + (define-key function-key-map "\e[148q" [C-end]) + + (define-key function-key-map "\e[154q" [next]) + (define-key function-key-map "\e[155q" [S-next]) + (define-key function-key-map "\e[156q" [C-next]) + + (define-key function-key-map "\e[161q" [S-up]) + (define-key function-key-map "\e[162q" [C-up]) + (define-key function-key-map "\e[163q" [M-up]) + + (define-key function-key-map "\e[158q" [S-left]) + (define-key function-key-map "\e[159q" [C-left]) + (define-key function-key-map "\e[160q" [M-left]) + + (define-key function-key-map "\e[164q" [S-down]) + (define-key function-key-map "\e[165q" [C-down]) + (define-key function-key-map "\e[166q" [M-down]) + + (define-key function-key-map "\e[167q" [S-right]) + (define-key function-key-map "\e[168q" [C-right]) + (define-key function-key-map "\e[169q" [M-right]) + + ;; Keypad functions, most of those are untested. + (define-key function-key-map "\e[179q" [?\C-/]) + (define-key function-key-map "\e[180q" [?\M-/]) + + (define-key function-key-map "\e[187q" [?\C-*]) + (define-key function-key-map "\e[188q" [?\M-*]) + + (define-key function-key-map "\e[198q" [?\C--]) + (define-key function-key-map "\e[199q" [?\M--]) + + ;; Something else takes care of home, up, prior, down, left, right, next + ;;(define-key function-key-map "\e[H" [home]) + (define-key function-key-map "\e[172q" [C-home]) + + ;;(define-key function-key-map "\e[A" [up]) + (define-key function-key-map "\e[182q" [C-up]) + + + ;;(define-key function-key-map "\e[150q" [prior]) + (define-key function-key-map "\e[190q" [C-prior]) + + + (define-key function-key-map "\e[200q" [?\C-+]) + (define-key function-key-map "\e[201q" [?\M-+]) + + ;;(define-key function-key-map "\e[D" [left]) + (define-key function-key-map "\e[174q" [C-left]) -;; (define-key function-key-map "^?" [delete]) ?? something else seems to take care of this. -(define-key function-key-map "\e[P" [S-delete]) -(define-key function-key-map "\e[142q" [C-delete]) -(define-key function-key-map "\e[M" [M-delete]) + + (define-key function-key-map "\e[000q" [begin]) + (define-key function-key-map "\e[184q" [C-begin]) -(define-key function-key-map "\e[146q" [end]) -(define-key function-key-map "\e[147q" [S-end]) ;; those don't seem to - ;; generate anything -(define-key function-key-map "\e[148q" [C-end]) - -(define-key function-key-map "\e[154q" [next]) -(define-key function-key-map "\e[155q" [S-next]) -(define-key function-key-map "\e[156q" [C-next]) - - -(define-key function-key-map "\e[161q" [S-up]) -(define-key function-key-map "\e[162q" [C-up]) -(define-key function-key-map "\e[163q" [M-up]) - -(define-key function-key-map "\e[158q" [S-left]) -(define-key function-key-map "\e[159q" [C-left]) -(define-key function-key-map "\e[160q" [M-left]) - -(define-key function-key-map "\e[164q" [S-down]) -(define-key function-key-map "\e[165q" [C-down]) -(define-key function-key-map "\e[166q" [M-down]) - -(define-key function-key-map "\e[167q" [S-right]) -(define-key function-key-map "\e[168q" [C-right]) -(define-key function-key-map "\e[169q" [M-right]) - -;; Keypad functions, most of those are untested. -(define-key function-key-map "\e[179q" [?\C-/]) -(define-key function-key-map "\e[180q" [?\M-/]) - -(define-key function-key-map "\e[187q" [?\C-*]) -(define-key function-key-map "\e[188q" [?\M-*]) - -(define-key function-key-map "\e[198q" [?\C--]) -(define-key function-key-map "\e[199q" [?\M--]) - -;; Something else takes care of home, up, prior, down, left, right, next -;(define-key function-key-map "\e[H" [home]) -(define-key function-key-map "\e[172q" [C-home]) - -;(define-key function-key-map "\e[A" [up]) -(define-key function-key-map "\e[182q" [C-up]) - - -;(define-key function-key-map "\e[150q" [prior]) -(define-key function-key-map "\e[190q" [C-prior]) - - -(define-key function-key-map "\e[200q" [?\C-+]) -(define-key function-key-map "\e[201q" [?\M-+]) - -;(define-key function-key-map "\e[D" [left]) -(define-key function-key-map "\e[174q" [C-left]) - - -(define-key function-key-map "\e[000q" [begin]) -(define-key function-key-map "\e[184q" [C-begin]) - - -;(define-key function-key-map "\e[C" [right]) -(define-key function-key-map "\e[192q" [C-right]) - -;(define-key function-key-map "\e[146q" [end]) -(define-key function-key-map "\e[176q" [C-end]) - -;(define-key function-key-map "\e[B" [down]) -(define-key function-key-map "\e[186q" [C-down]) - -;(define-key function-key-map "\e[154q" [next]) -(define-key function-key-map "\e[194q" [C-next]) - - -(define-key function-key-map "\e[100q" [M-enter]) - -(define-key function-key-map "\e[139q" [insert]) -(define-key function-key-map "\e[178q" [C-inset]) - -(define-key function-key-map "\e[P" [delete]) -(define-key function-key-map "\e[196q" [C-delete]) -(define-key function-key-map "\e[197q" [M-delete]) + + ;;(define-key function-key-map "\e[C" [right]) + (define-key function-key-map "\e[192q" [C-right]) + + ;;(define-key function-key-map "\e[146q" [end]) + (define-key function-key-map "\e[176q" [C-end]) + + ;;(define-key function-key-map "\e[B" [down]) + (define-key function-key-map "\e[186q" [C-down]) + + ;;(define-key function-key-map "\e[154q" [next]) + (define-key function-key-map "\e[194q" [C-next]) + + + (define-key function-key-map "\e[100q" [M-enter]) + + (define-key function-key-map "\e[139q" [insert]) + (define-key function-key-map "\e[178q" [C-inset]) + + (define-key function-key-map "\e[P" [delete]) + (define-key function-key-map "\e[196q" [C-delete]) + (define-key function-key-map "\e[197q" [M-delete])) ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b ;;; iris-ansi.el ends here diff --git a/lisp/term/linux.el b/lisp/term/linux.el index 71b9e0d4bcf..7fa9a96e9bd 100644 --- a/lisp/term/linux.el +++ b/lisp/term/linux.el @@ -1,19 +1,21 @@ ;; -*- no-byte-compile: t -*- ;; The Linux console handles Latin-1 by default. -(unless (terminal-coding-system) - (set-terminal-coding-system 'iso-latin-1)) +(defun terminal-init-linux () + "Terminal initialization function for linux." + (unless (terminal-coding-system) + (set-terminal-coding-system 'iso-latin-1)) -;; It can't really display underlines. -(tty-no-underline) + ;; It can't really display underlines. + (tty-no-underline) -;; Make Latin-1 input characters work, too. -;; Meta will continue to work, because the kernel -;; turns that into Escape. + ;; Make Latin-1 input characters work, too. + ;; Meta will continue to work, because the kernel + ;; turns that into Escape. -(let ((value (current-input-mode))) - ;; The third arg only matters in that it is not t or nil. - (set-input-mode (nth 0 value) (nth 1 value) 'iso-latin-1 (nth 3 value))) + (let ((value (current-input-mode))) + ;; The third arg only matters in that it is not t or nil. + (set-input-mode (nth 0 value) (nth 1 value) 'iso-latin-1 (nth 3 value)))) ;;; arch-tag: 5d0c4f63-739b-4862-abf3-041fe42adb8f ;;; linux.el ends here diff --git a/lisp/term/news.el b/lisp/term/news.el index 7a24eaf5a0c..f8a4934f8bc 100644 --- a/lisp/term/news.el +++ b/lisp/term/news.el @@ -1,6 +1,6 @@ ;;; news.el --- keypad and function key bindings for the Sony NEWS keyboard -*- no-byte-compile: t -*- -;; Copyright (C) 1989, 1993 Free Software Foundation, Inc. +;; Copyright (C) 1989, 1993, 2005 Free Software Foundation, Inc. ;; Author: FSF ;; Keywords: terminals @@ -28,47 +28,49 @@ ;;; Code: -(if (boundp 'news-fkey-prefix) - nil - ;; The terminal initialization should already have set up some keys - (setq news-fkey-prefix (lookup-key function-key-map "\eO")) - (if (not (keymapp news-fkey-prefix)) - (error "What? Your news termcap/terminfo has no keycaps in it")) +(defun terminal-init-news () + "Terminal initialization function for news." + (if (boundp 'news-fkey-prefix) + nil + ;; The terminal initialization should already have set up some keys + (setq news-fkey-prefix (lookup-key function-key-map "\eO")) + (if (not (keymapp news-fkey-prefix)) + (error "What? Your news termcap/terminfo has no keycaps in it")) - ;; Termcap or terminfo will set these - ;; (define-key news-fkey-prefix "P" [f1]) - ;; (define-key news-fkey-prefix "Q" [f2]) - ;; (define-key news-fkey-prefix "R" [f3]) - ;; (define-key news-fkey-prefix "S" [f4]) - ;; (define-key news-fkey-prefix "T" [f5]) - ;; (define-key news-fkey-prefix "U" [f6]) - ;; (define-key news-fkey-prefix "V" [f7]) - ;; (define-key news-fkey-prefix "W" [f8]) - ;; (define-key news-fkey-prefix "X" [f9]) - ;; (define-key news-fkey-prefix "Y" [f10]) + ;; Termcap or terminfo will set these + ;; (define-key news-fkey-prefix "P" [f1]) + ;; (define-key news-fkey-prefix "Q" [f2]) + ;; (define-key news-fkey-prefix "R" [f3]) + ;; (define-key news-fkey-prefix "S" [f4]) + ;; (define-key news-fkey-prefix "T" [f5]) + ;; (define-key news-fkey-prefix "U" [f6]) + ;; (define-key news-fkey-prefix "V" [f7]) + ;; (define-key news-fkey-prefix "W" [f8]) + ;; (define-key news-fkey-prefix "X" [f9]) + ;; (define-key news-fkey-prefix "Y" [f10]) - ;; Terminfo will set these - (define-key news-fkey-prefix "a" [execute]) - (define-key news-fkey-prefix "b" [select]) - (define-key news-fkey-prefix "c" [cancel]) - (define-key news-fkey-prefix "M" [kp-enter]) - (define-key news-fkey-prefix "q" [kp-1]) - (define-key news-fkey-prefix "s" [kp-3]) - (define-key news-fkey-prefix "u" [kp-5]) - (define-key news-fkey-prefix "w" [kp-7]) - (define-key news-fkey-prefix "y" [kp-9]) + ;; Terminfo will set these + (define-key news-fkey-prefix "a" [execute]) + (define-key news-fkey-prefix "b" [select]) + (define-key news-fkey-prefix "c" [cancel]) + (define-key news-fkey-prefix "M" [kp-enter]) + (define-key news-fkey-prefix "q" [kp-1]) + (define-key news-fkey-prefix "s" [kp-3]) + (define-key news-fkey-prefix "u" [kp-5]) + (define-key news-fkey-prefix "w" [kp-7]) + (define-key news-fkey-prefix "y" [kp-9]) - ;; These aren't in either termcap or terminfo's repertoire - (define-key news-fkey-prefix "m" [kp-subtract]) - (define-key news-fkey-prefix "k" [kp-add]) - (define-key news-fkey-prefix "l" [kp-separator]) - (define-key news-fkey-prefix "n" [kp-decimal]) - (define-key news-fkey-prefix "p" [kp-0]) - (define-key news-fkey-prefix "r" [kp-2]) - (define-key news-fkey-prefix "t" [kp-4]) - (define-key news-fkey-prefix "v" [kp-6]) - (define-key news-fkey-prefix "x" [kp-8]) - ) + ;; These aren't in either termcap or terminfo's repertoire + (define-key news-fkey-prefix "m" [kp-subtract]) + (define-key news-fkey-prefix "k" [kp-add]) + (define-key news-fkey-prefix "l" [kp-separator]) + (define-key news-fkey-prefix "n" [kp-decimal]) + (define-key news-fkey-prefix "p" [kp-0]) + (define-key news-fkey-prefix "r" [kp-2]) + (define-key news-fkey-prefix "t" [kp-4]) + (define-key news-fkey-prefix "v" [kp-6]) + (define-key news-fkey-prefix "x" [kp-8]) + )) ;;; arch-tag: bfe141a0-623b-4b42-b753-5d9353776c5e ;;; news.el ends here diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 95742a1d34e..f0e9dd7b5b1 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -1,6 +1,6 @@ ;;; rxvt.el --- define function key sequences and standard colors for rxvt -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2005 Free Software Foundation, Inc. ;; Author: Eli Zaretskii ;; Keywords: terminals @@ -26,135 +26,143 @@ ;;; Code: -;;; The terminal intialization C code file might have initialized -;;; function keys F11->F42 from the termcap/terminfo information. On -;;; a PC-style keyboard these keys correspond to -;;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The -;;; code here subsitutes the corresponding defintions in -;;; function-key-map. This substitution is needed because if a key -;;; definition if found in function-key-map, there are no further -;;; lookups in other keymaps. -(substitute-key-definition [f11] [S-f1] function-key-map) -(substitute-key-definition [f12] [S-f2] function-key-map) -(substitute-key-definition [f13] [S-f3] function-key-map) -(substitute-key-definition [f14] [S-f4] function-key-map) -(substitute-key-definition [f15] [S-f5] function-key-map) -(substitute-key-definition [f16] [S-f6] function-key-map) -(substitute-key-definition [f17] [S-f7] function-key-map) -(substitute-key-definition [f18] [S-f8] function-key-map) -(substitute-key-definition [f19] [S-f9] function-key-map) -(substitute-key-definition [f20] [S-f10] function-key-map) +(defun terminal-init-rxvt () + "Terminal initialization function for rxvt." + ;; The terminal intialization C code file might have initialized + ;; function keys F11->F42 from the termcap/terminfo information. On + ;; a PC-style keyboard these keys correspond to + ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The + ;; code here subsitutes the corresponding defintions in + ;; function-key-map. This substitution is needed because if a key + ;; definition if found in function-key-map, there are no further + ;; lookups in other keymaps. + (substitute-key-definition [f11] [S-f1] function-key-map) + (substitute-key-definition [f12] [S-f2] function-key-map) + (substitute-key-definition [f13] [S-f3] function-key-map) + (substitute-key-definition [f14] [S-f4] function-key-map) + (substitute-key-definition [f15] [S-f5] function-key-map) + (substitute-key-definition [f16] [S-f6] function-key-map) + (substitute-key-definition [f17] [S-f7] function-key-map) + (substitute-key-definition [f18] [S-f8] function-key-map) + (substitute-key-definition [f19] [S-f9] function-key-map) + (substitute-key-definition [f20] [S-f10] function-key-map) -(substitute-key-definition [f23] [C-f1] function-key-map) -(substitute-key-definition [f24] [C-f2] function-key-map) -(substitute-key-definition [f25] [C-f3] function-key-map) -(substitute-key-definition [f26] [C-f4] function-key-map) -(substitute-key-definition [f27] [C-f5] function-key-map) -(substitute-key-definition [f28] [C-f6] function-key-map) -(substitute-key-definition [f29] [C-f7] function-key-map) -(substitute-key-definition [f30] [C-f8] function-key-map) -(substitute-key-definition [f31] [C-f9] function-key-map) -(substitute-key-definition [f32] [C-f10] function-key-map) + (substitute-key-definition [f23] [C-f1] function-key-map) + (substitute-key-definition [f24] [C-f2] function-key-map) + (substitute-key-definition [f25] [C-f3] function-key-map) + (substitute-key-definition [f26] [C-f4] function-key-map) + (substitute-key-definition [f27] [C-f5] function-key-map) + (substitute-key-definition [f28] [C-f6] function-key-map) + (substitute-key-definition [f29] [C-f7] function-key-map) + (substitute-key-definition [f30] [C-f8] function-key-map) + (substitute-key-definition [f31] [C-f9] function-key-map) + (substitute-key-definition [f32] [C-f10] function-key-map) -(substitute-key-definition [f33] [C-S-f1] function-key-map) -(substitute-key-definition [f34] [C-S-f2] function-key-map) -(substitute-key-definition [f35] [C-S-f3] function-key-map) -(substitute-key-definition [f36] [C-S-f4] function-key-map) -(substitute-key-definition [f37] [C-S-f5] function-key-map) -(substitute-key-definition [f38] [C-S-f6] function-key-map) -(substitute-key-definition [f39] [C-S-f7] function-key-map) -(substitute-key-definition [f40] [C-S-f8] function-key-map) -(substitute-key-definition [f41] [C-S-f9] function-key-map) -(substitute-key-definition [f42] [C-S-f10] function-key-map) + (substitute-key-definition [f33] [C-S-f1] function-key-map) + (substitute-key-definition [f34] [C-S-f2] function-key-map) + (substitute-key-definition [f35] [C-S-f3] function-key-map) + (substitute-key-definition [f36] [C-S-f4] function-key-map) + (substitute-key-definition [f37] [C-S-f5] function-key-map) + (substitute-key-definition [f38] [C-S-f6] function-key-map) + (substitute-key-definition [f39] [C-S-f7] function-key-map) + (substitute-key-definition [f40] [C-S-f8] function-key-map) + (substitute-key-definition [f41] [C-S-f9] function-key-map) + (substitute-key-definition [f42] [C-S-f10] function-key-map) -;; Set up function-key-map entries that termcap and terminfo don't know. -(let ((map (make-sparse-keymap))) - (define-key map "\e[A" [up]) - (define-key map "\e[B" [down]) - (define-key map "\e[C" [right]) - (define-key map "\e[D" [left]) - (define-key map "\e[7~" [home]) - (define-key map "\e[2~" [insert]) - (define-key map "\e[3~" [delete]) - (define-key map "\e[4~" [select]) - (define-key map "\e[5~" [prior]) - (define-key map "\e[6~" [next]) - (define-key map "\e[11~" [f1]) - (define-key map "\e[12~" [f2]) - (define-key map "\e[13~" [f3]) - (define-key map "\e[14~" [f4]) - (define-key map "\e[15~" [f5]) - (define-key map "\e[17~" [f6]) - (define-key map "\e[18~" [f7]) - (define-key map "\e[19~" [f8]) - (define-key map "\e[20~" [f9]) - (define-key map "\e[21~" [f10]) - ;; The strings emitted by f11 and f12 are the same as the strings - ;; emitted by S-f1 and S-f2, so don't define f11 and f12. - ;; (define-key map "\e[23~" [f11]) - ;; (define-key map "\e[24~" [f12]) - (define-key map "\e[29~" [print]) + ;; Set up function-key-map entries that termcap and terminfo don't know. + (let ((map (make-sparse-keymap))) + (define-key map "\e[A" [up]) + (define-key map "\e[B" [down]) + (define-key map "\e[C" [right]) + (define-key map "\e[D" [left]) + (define-key map "\e[7~" [home]) + (define-key map "\e[2~" [insert]) + (define-key map "\e[3~" [delete]) + (define-key map "\e[4~" [select]) + (define-key map "\e[5~" [prior]) + (define-key map "\e[6~" [next]) + (define-key map "\e[11~" [f1]) + (define-key map "\e[12~" [f2]) + (define-key map "\e[13~" [f3]) + (define-key map "\e[14~" [f4]) + (define-key map "\e[15~" [f5]) + (define-key map "\e[17~" [f6]) + (define-key map "\e[18~" [f7]) + (define-key map "\e[19~" [f8]) + (define-key map "\e[20~" [f9]) + (define-key map "\e[21~" [f10]) + ;; The strings emitted by f11 and f12 are the same as the strings + ;; emitted by S-f1 and S-f2, so don't define f11 and f12. + ;; (define-key map "\e[23~" [f11]) + ;; (define-key map "\e[24~" [f12]) + (define-key map "\e[29~" [print]) - (define-key map "\e[11^" [C-f1]) - (define-key map "\e[12^" [C-f2]) - (define-key map "\e[13^" [C-f3]) - (define-key map "\e[14^" [C-f4]) - (define-key map "\e[15^" [C-f5]) - (define-key map "\e[17^" [C-f6]) - (define-key map "\e[18^" [C-f7]) - (define-key map "\e[19^" [C-f8]) - (define-key map "\e[20^" [C-f9]) - (define-key map "\e[21^" [C-f10]) + (define-key map "\e[11^" [C-f1]) + (define-key map "\e[12^" [C-f2]) + (define-key map "\e[13^" [C-f3]) + (define-key map "\e[14^" [C-f4]) + (define-key map "\e[15^" [C-f5]) + (define-key map "\e[17^" [C-f6]) + (define-key map "\e[18^" [C-f7]) + (define-key map "\e[19^" [C-f8]) + (define-key map "\e[20^" [C-f9]) + (define-key map "\e[21^" [C-f10]) - (define-key map "\e[23~" [S-f1]) - (define-key map "\e[24~" [S-f2]) - (define-key map "\e[25~" [S-f3]) - (define-key map "\e[26~" [S-f4]) - (define-key map "\e[28~" [S-f5]) - (define-key map "\e[29~" [S-f6]) - (define-key map "\e[31~" [S-f7]) - (define-key map "\e[32~" [S-f8]) - (define-key map "\e[33~" [S-f9]) - (define-key map "\e[34~" [S-f10]) + (define-key map "\e[23~" [S-f1]) + (define-key map "\e[24~" [S-f2]) + (define-key map "\e[25~" [S-f3]) + (define-key map "\e[26~" [S-f4]) + (define-key map "\e[28~" [S-f5]) + (define-key map "\e[29~" [S-f6]) + (define-key map "\e[31~" [S-f7]) + (define-key map "\e[32~" [S-f8]) + (define-key map "\e[33~" [S-f9]) + (define-key map "\e[34~" [S-f10]) - (define-key map "\e[23^" [C-S-f1]) - (define-key map "\e[24^" [C-S-f2]) - (define-key map "\e[25^" [C-S-f3]) - (define-key map "\e[26^" [C-S-f4]) - (define-key map "\e[28^" [C-S-f5]) - (define-key map "\e[29^" [C-S-f6]) - (define-key map "\e[31^" [C-S-f7]) - (define-key map "\e[32^" [C-S-f8]) - (define-key map "\e[33^" [C-S-f9]) - (define-key map "\e[34^" [C-S-f10]) + (define-key map "\e[23^" [C-S-f1]) + (define-key map "\e[24^" [C-S-f2]) + (define-key map "\e[25^" [C-S-f3]) + (define-key map "\e[26^" [C-S-f4]) + (define-key map "\e[28^" [C-S-f5]) + (define-key map "\e[29^" [C-S-f6]) + (define-key map "\e[31^" [C-S-f7]) + (define-key map "\e[32^" [C-S-f8]) + (define-key map "\e[33^" [C-S-f9]) + (define-key map "\e[34^" [C-S-f10]) - (define-key map "\e[2^" [C-insert]) - (define-key map "\e[3^" [C-delete]) - (define-key map "\e[5^" [C-prior]) - (define-key map "\e[6^" [C-next]) - (define-key map "\e[7^" [C-home]) - (define-key map "\e[8^" [C-end]) - (define-key map "\eOd" [C-left]) - (define-key map "\eOc" [C-right]) - (define-key map "\eOa" [C-up]) - (define-key map "\eOb" [C-down]) + (define-key map "\e[2^" [C-insert]) + (define-key map "\e[3^" [C-delete]) + (define-key map "\e[5^" [C-prior]) + (define-key map "\e[6^" [C-next]) + (define-key map "\e[7^" [C-home]) + (define-key map "\e[8^" [C-end]) + (define-key map "\eOd" [C-left]) + (define-key map "\eOc" [C-right]) + (define-key map "\eOa" [C-up]) + (define-key map "\eOb" [C-down]) - (define-key map "\e[2;2~" [S-insert]) - (define-key map "\e[3$" [S-delete]) - (define-key map "\e[5$" [S-prior]) - (define-key map "\e[6$" [S-next]) - (define-key map "\e[8$" [S-end]) - (define-key map "\e[7$" [S-home]) - (define-key map "\e[d" [S-left]) - (define-key map "\e[c" [S-right]) - (define-key map "\e[a" [S-up]) - (define-key map "\e[b" [S-down]) + (define-key map "\e[2;2~" [S-insert]) + (define-key map "\e[3$" [S-delete]) + (define-key map "\e[5$" [S-prior]) + (define-key map "\e[6$" [S-next]) + (define-key map "\e[8$" [S-end]) + (define-key map "\e[7$" [S-home]) + (define-key map "\e[d" [S-left]) + (define-key map "\e[c" [S-right]) + (define-key map "\e[a" [S-up]) + (define-key map "\e[b" [S-down]) - ;; Use inheritance to let the main keymap override those defaults. - ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. - (set-keymap-parent map (keymap-parent function-key-map)) - (set-keymap-parent function-key-map map)) + ;; Use inheritance to let the main keymap override those defaults. + ;; This way we don't override terminfo-derived settings or settings + ;; made in the .emacs file. + (set-keymap-parent map (keymap-parent function-key-map)) + (set-keymap-parent function-key-map map)) + + ;; Initialize colors and background mode. + (rxvt-register-default-colors) + (rxvt-set-background-mode) + ;; This recomputes all the default faces given the colors we've just set up. + (tty-set-up-initial-frame-faces)) ;; Set up colors, for those versions of rxvt that support it. (defvar rxvt-standard-colors @@ -228,11 +236,5 @@ for the currently selected frame." (setq default-frame-background-mode 'dark))) (frame-set-background-mode (selected-frame)))) -;; Do it! -(rxvt-register-default-colors) -(rxvt-set-background-mode) -;; This recomputes all the default faces given the colors we've just set up. -(tty-set-up-initial-frame-faces) - ;;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257 ;;; rxvt.el ends here diff --git a/lisp/term/sun.el b/lisp/term/sun.el index 18010e0b343..7d857ca1266 100644 --- a/lisp/term/sun.el +++ b/lisp/term/sun.el @@ -1,6 +1,6 @@ ;;; sun.el --- keybinding for standard default sunterm keys -;; Copyright (C) 1987, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1987, 2001, 2005 Free Software Foundation, Inc. ;; Author: Jeff Peck ;; Keywords: terminals @@ -93,58 +93,6 @@ ;; (defvar sun-raw-prefix (make-sparse-keymap)) -(define-key function-key-map "\e[" sun-raw-prefix) - -(define-key sun-raw-prefix "210z" [r3]) -(define-key sun-raw-prefix "213z" [r6]) -(define-key sun-raw-prefix "214z" [r7]) -(define-key sun-raw-prefix "216z" [r9]) -(define-key sun-raw-prefix "218z" [r11]) -(define-key sun-raw-prefix "220z" [r13]) -(define-key sun-raw-prefix "222z" [r15]) -(define-key sun-raw-prefix "193z" [redo]) -(define-key sun-raw-prefix "194z" [props]) -(define-key sun-raw-prefix "195z" [undo]) -;; (define-key sun-raw-prefix "196z" 'ignore) ; Expose-down -;; (define-key sun-raw-prefix "197z" [put]) -;; (define-key sun-raw-prefix "198z" 'ignore) ; Open-down -;; (define-key sun-raw-prefix "199z" [get]) -(define-key sun-raw-prefix "200z" [find]) -;; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark) ; Delete -(define-key sun-raw-prefix "224z" [f1]) -(define-key sun-raw-prefix "225z" [f2]) -(define-key sun-raw-prefix "226z" [f3]) -(define-key sun-raw-prefix "227z" [f4]) -(define-key sun-raw-prefix "228z" [f5]) -(define-key sun-raw-prefix "229z" [f6]) -(define-key sun-raw-prefix "230z" [f7]) -(define-key sun-raw-prefix "231z" [f8]) -(define-key sun-raw-prefix "232z" [f9]) -(define-key sun-raw-prefix "233z" [f10]) -(define-key sun-raw-prefix "234z" [f11]) -(define-key sun-raw-prefix "235z" [f12]) -(define-key sun-raw-prefix "A" [up]) ; R8 -(define-key sun-raw-prefix "B" [down]) ; R14 -(define-key sun-raw-prefix "C" [right]) ; R12 -(define-key sun-raw-prefix "D" [left]) ; R10 - -(global-set-key [r3] 'backward-page) -(global-set-key [r6] 'forward-page) -(global-set-key [r7] 'beginning-of-buffer) -(global-set-key [r9] 'scroll-down) -(global-set-key [r11] 'recenter) -(global-set-key [r13] 'end-of-buffer) -(global-set-key [r15] 'scroll-up) -(global-set-key [redo] 'redraw-display) ;FIXME: collides with default. -(global-set-key [props] 'list-buffers) -(global-set-key [put] 'sun-select-region) -(global-set-key [get] 'sun-yank-selection) -(global-set-key [find] 'exchange-point-and-mark) -(global-set-key [f3] 'scroll-down-in-place) -(global-set-key [f4] 'scroll-up-in-place) -(global-set-key [f6] 'shrink-window) -(global-set-key [f7] 'enlarge-window) - ;; Since .emacs gets loaded before this file, a hook is supplied ;; for you to put your own bindings in. @@ -152,13 +100,6 @@ (defvar sun-raw-prefix-hooks nil "List of forms to evaluate after setting sun-raw-prefix.") -(when sun-raw-prefix-hooks - (message "sun-raw-prefix-hooks is obsolete! Use term-setup-hook instead!") - (let ((hooks sun-raw-prefix-hooks)) - (while hooks - (eval (car hooks)) - (setq hooks (cdr hooks))))) - ;;; This section adds definitions for the emacstool users ;; emacstool event filter converts function keys to C-x*{c}{lrt} @@ -188,44 +129,6 @@ (defvar suntool-map (make-sparse-keymap) "*Keymap for Emacstool bindings.") -(define-key suntool-map "gr" 'beginning-of-buffer) ; r7 -(define-key suntool-map "iR" 'backward-page) ; R9 -(define-key suntool-map "ir" 'scroll-down) ; r9 -(define-key suntool-map "kr" 'recenter) ; r11 -(define-key suntool-map "mr" 'end-of-buffer) ; r13 -(define-key suntool-map "oR" 'forward-page) ; R15 -(define-key suntool-map "or" 'scroll-up) ; r15 -(define-key suntool-map "b\M-L" 'rerun-prev-command) ; M-AGAIN -(define-key suntool-map "b\M-l" 'prev-complex-command) ; M-Again -(define-key suntool-map "bl" 'redraw-display) ; Again -(define-key suntool-map "cl" 'list-buffers) ; Props -(define-key suntool-map "dl" 'undo) ; Undo -(define-key suntool-map "el" 'ignore) ; Expose-Open -(define-key suntool-map "fl" 'sun-select-region) ; Put -(define-key suntool-map "f," 'copy-region-as-kill) ; C-Put -(define-key suntool-map "gl" 'ignore) ; Open-Open -(define-key suntool-map "hl" 'sun-yank-selection) ; Get -(define-key suntool-map "h," 'yank) ; C-Get -(define-key suntool-map "il" 'research-forward) ; Find -(define-key suntool-map "i," 're-search-forward) ; C-Find -(define-key suntool-map "i\M-l" 'research-backward) ; M-Find -(define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find - -(define-key suntool-map "jL" 'yank) ; DELETE -(define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete -(define-key suntool-map "j\M-l" 'exchange-point-and-mark); M-Delete -(define-key suntool-map "j," - (lambda () (interactive) (pop-mark))) ; C-Delete - -(define-key suntool-map "fT" 'shrink-window-horizontally) ; T6 -(define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7 -(define-key suntool-map "ft" 'shrink-window) ; t6 -(define-key suntool-map "gt" 'enlarge-window) ; t7 -(define-key suntool-map "cT" (lambda (n) (interactive "p") (scroll-down n))) -(define-key suntool-map "dT" (lambda (n) (interactive "p") (scroll-up n))) -(define-key suntool-map "ct" 'scroll-down-in-place) ; t3 -(define-key suntool-map "dt" 'scroll-up-in-place) ; t4 -(define-key ctl-x-map "*" suntool-map) ;; Since .emacs gets loaded before this file, a hook is supplied ;; for you to put your own bindings in. @@ -233,13 +136,6 @@ (defvar suntool-map-hooks nil "List of forms to evaluate after setting suntool-map.") -(when suntool-map-hooks - (message "suntool-map-hooks is obsolete! Use term-setup-hook instead!") - (let ((hooks suntool-map-hooks)) - (while hooks - (eval (car hooks)) - (setq hooks (cdr hooks))))) - ;; ;; If running under emacstool, arrange to call suspend-emacstool ;; instead of suspend-emacs. @@ -251,6 +147,115 @@ (autoload 'sun-mouse-handler "sun-mouse" "Sun Emacstool handler for mouse blips (not loaded)." t) +(defun terminal-init-sun () + "Terminal initialization function for sun." + (define-key function-key-map "\e[" sun-raw-prefix) + + (define-key sun-raw-prefix "210z" [r3]) + (define-key sun-raw-prefix "213z" [r6]) + (define-key sun-raw-prefix "214z" [r7]) + (define-key sun-raw-prefix "216z" [r9]) + (define-key sun-raw-prefix "218z" [r11]) + (define-key sun-raw-prefix "220z" [r13]) + (define-key sun-raw-prefix "222z" [r15]) + (define-key sun-raw-prefix "193z" [redo]) + (define-key sun-raw-prefix "194z" [props]) + (define-key sun-raw-prefix "195z" [undo]) + ;; (define-key sun-raw-prefix "196z" 'ignore) ; Expose-down + ;; (define-key sun-raw-prefix "197z" [put]) + ;; (define-key sun-raw-prefix "198z" 'ignore) ; Open-down + ;; (define-key sun-raw-prefix "199z" [get]) + (define-key sun-raw-prefix "200z" [find]) + ;; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark) ; Delete + (define-key sun-raw-prefix "224z" [f1]) + (define-key sun-raw-prefix "225z" [f2]) + (define-key sun-raw-prefix "226z" [f3]) + (define-key sun-raw-prefix "227z" [f4]) + (define-key sun-raw-prefix "228z" [f5]) + (define-key sun-raw-prefix "229z" [f6]) + (define-key sun-raw-prefix "230z" [f7]) + (define-key sun-raw-prefix "231z" [f8]) + (define-key sun-raw-prefix "232z" [f9]) + (define-key sun-raw-prefix "233z" [f10]) + (define-key sun-raw-prefix "234z" [f11]) + (define-key sun-raw-prefix "235z" [f12]) + (define-key sun-raw-prefix "A" [up]) ; R8 + (define-key sun-raw-prefix "B" [down]) ; R14 + (define-key sun-raw-prefix "C" [right]) ; R12 + (define-key sun-raw-prefix "D" [left]) ; R10 + + (global-set-key [r3] 'backward-page) + (global-set-key [r6] 'forward-page) + (global-set-key [r7] 'beginning-of-buffer) + (global-set-key [r9] 'scroll-down) + (global-set-key [r11] 'recenter) + (global-set-key [r13] 'end-of-buffer) + (global-set-key [r15] 'scroll-up) + (global-set-key [redo] 'redraw-display) ;FIXME: collides with default. + (global-set-key [props] 'list-buffers) + (global-set-key [put] 'sun-select-region) + (global-set-key [get] 'sun-yank-selection) + (global-set-key [find] 'exchange-point-and-mark) + (global-set-key [f3] 'scroll-down-in-place) + (global-set-key [f4] 'scroll-up-in-place) + (global-set-key [f6] 'shrink-window) + (global-set-key [f7] 'enlarge-window) + + (when sun-raw-prefix-hooks + (message "sun-raw-prefix-hooks is obsolete! Use term-setup-hook instead!") + (let ((hooks sun-raw-prefix-hooks)) + (while hooks + (eval (car hooks)) + (setq hooks (cdr hooks))))) + + (define-key suntool-map "gr" 'beginning-of-buffer) ; r7 + (define-key suntool-map "iR" 'backward-page) ; R9 + (define-key suntool-map "ir" 'scroll-down) ; r9 + (define-key suntool-map "kr" 'recenter) ; r11 + (define-key suntool-map "mr" 'end-of-buffer) ; r13 + (define-key suntool-map "oR" 'forward-page) ; R15 + (define-key suntool-map "or" 'scroll-up) ; r15 + (define-key suntool-map "b\M-L" 'rerun-prev-command) ; M-AGAIN + (define-key suntool-map "b\M-l" 'prev-complex-command) ; M-Again + (define-key suntool-map "bl" 'redraw-display) ; Again + (define-key suntool-map "cl" 'list-buffers) ; Props + (define-key suntool-map "dl" 'undo) ; Undo + (define-key suntool-map "el" 'ignore) ; Expose-Open + (define-key suntool-map "fl" 'sun-select-region) ; Put + (define-key suntool-map "f," 'copy-region-as-kill) ; C-Put + (define-key suntool-map "gl" 'ignore) ; Open-Open + (define-key suntool-map "hl" 'sun-yank-selection) ; Get + (define-key suntool-map "h," 'yank) ; C-Get + (define-key suntool-map "il" 'research-forward) ; Find + (define-key suntool-map "i," 're-search-forward) ; C-Find + (define-key suntool-map "i\M-l" 'research-backward) ; M-Find + (define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find + + (define-key suntool-map "jL" 'yank) ; DELETE + (define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete + (define-key suntool-map "j\M-l" 'exchange-point-and-mark) ; M-Delete + (define-key suntool-map "j," + (lambda () (interactive) (pop-mark))) ; C-Delete + + (define-key suntool-map "fT" 'shrink-window-horizontally) ; T6 + (define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7 + (define-key suntool-map "ft" 'shrink-window) ; t6 + (define-key suntool-map "gt" 'enlarge-window) ; t7 + (define-key suntool-map "cT" (lambda (n) (interactive "p") (scroll-down n))) + (define-key suntool-map "dT" (lambda (n) (interactive "p") (scroll-up n))) + (define-key suntool-map "ct" 'scroll-down-in-place) ; t3 + (define-key suntool-map "dt" 'scroll-up-in-place) ; t4 + (define-key ctl-x-map "*" suntool-map) + + (when suntool-map-hooks + (message "suntool-map-hooks is obsolete! Use term-setup-hook instead!") + (let ((hooks suntool-map-hooks)) + (while hooks + (eval (car hooks)) + (setq hooks (cdr hooks))))) + + (define-key ctl-x-map "\C-@" 'sun-mouse-once)) + (defun emacstool-init () "Set up Emacstool window, if you know you are in an emacstool." ;; Make sure sun-mouse and sun-fns are loaded. @@ -272,7 +277,6 @@ (interactive) (emacstool-init) (sun-mouse-handler)) ; Now, execute this mouse blip. -(define-key ctl-x-map "\C-@" 'sun-mouse-once) ;;; arch-tag: db761d47-fd7d-42b4-aae1-04fa116b6ba6 ;;; sun.el ends here diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index c24464fbbd5..f7bc8c852a9 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el @@ -3,7 +3,7 @@ ;; Author: Jim Blandy , January 1992 ;; Keywords: terminals -;; Copyright (C) 1992 Free Software Foundation, Inc. +;; Copyright (C) 1992, 2005 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -28,77 +28,80 @@ ;;; Code: -(or (lookup-key function-key-map "\e[") - (define-key function-key-map "\e[" (make-keymap))) -;; (or (lookup-key function-key-map "\eO") -;; (define-key function-key-map "\eO" (make-keymap))) +(defun terminal-init-tvi970 () + "Terminal initialization function for tvi970." + (or (lookup-key function-key-map "\e[") + (define-key function-key-map "\e[" (make-keymap))) + ;; (or (lookup-key function-key-map "\eO") + ;; (define-key function-key-map "\eO" (make-keymap))) -;; Miscellaneous keys -(mapcar (function (lambda (key-binding) - (define-key function-key-map - (car key-binding) (nth 1 key-binding)))) - '( - ;; These are set up by termcap or terminfo - ;; ("\eOP" [kp-f1]) - ;; ("\eOQ" [kp-f2]) - ;; ("\eOR" [kp-f3]) - ;; ("\eOS" [kp-f4]) + ;; Miscellaneous keys + (mapcar (function (lambda (key-binding) + (define-key function-key-map + (car key-binding) (nth 1 key-binding)))) + '( + ;; These are set up by termcap or terminfo + ;; ("\eOP" [kp-f1]) + ;; ("\eOQ" [kp-f2]) + ;; ("\eOR" [kp-f3]) + ;; ("\eOS" [kp-f4]) - ;; These might br set by terminfo - ("\e[H" [home]) - ("\e[Z" [backtab]) - ("\e[i" [print]) - ("\e[@" [insert]) - ("\e[L" [insertline]) - ("\e[M" [deleteline]) - ("\e[U" [next]) ;; actually the `page' key + ;; These might br set by terminfo + ("\e[H" [home]) + ("\e[Z" [backtab]) + ("\e[i" [print]) + ("\e[@" [insert]) + ("\e[L" [insertline]) + ("\e[M" [deleteline]) + ("\e[U" [next]) ;; actually the `page' key - ;; These won't be set up by either - ("\eOm" [kp-subtract]) - ("\eOl" [kp-separator]) - ("\eOn" [kp-decimal]) - ("\eOM" [kp-enter]) + ;; These won't be set up by either + ("\eOm" [kp-subtract]) + ("\eOl" [kp-separator]) + ("\eOn" [kp-decimal]) + ("\eOM" [kp-enter]) - ;; These won't be set up by either either - ("\e[K" [key_eol]) ;; Not an X keysym - ("\e[J" [key_eos]) ;; Not an X keysym - ("\e[2J" [key_clear]) ;; Not an X keysym - ("\e[P" [key_dc]) ;; Not an X keysym - ("\e[g" [S-tab]) ;; Not an X keysym - ("\e[2N" [clearentry]) ;; Not an X keysym - ("\e[2K" [S-clearentry]) ;; Not an X keysym - ("\e[E" [?\C-j]) ;; Not an X keysym - ("\e[g" [S-backtab]) ;; Not an X keysym - ("\e[?1i" [key_sprint]) ;; Not an X keysym - ("\e[4h" [key_sic]) ;; Not an X keysym - ("\e[4l" [S-delete]) ;; Not an X keysym - ("\e[Q" [S-insertline]) ;; Not an X keysym - ("\e[1Q" [key_sdl]) ;; Not an X keysym - ("\e[19l" [key_seol]) ;; Not an X keysym - ("\e[19h" [S-erasepage]) ;; Not an X keysym - ("\e[V" [S-page]) ;; Not an X keysym - ("\eS" [send]) ;; Not an X keysym - ("\e5" [S-send]) ;; Not an X keysym - )) + ;; These won't be set up by either either + ("\e[K" [key_eol]) ;; Not an X keysym + ("\e[J" [key_eos]) ;; Not an X keysym + ("\e[2J" [key_clear]) ;; Not an X keysym + ("\e[P" [key_dc]) ;; Not an X keysym + ("\e[g" [S-tab]) ;; Not an X keysym + ("\e[2N" [clearentry]) ;; Not an X keysym + ("\e[2K" [S-clearentry]) ;; Not an X keysym + ("\e[E" [?\C-j]) ;; Not an X keysym + ("\e[g" [S-backtab]) ;; Not an X keysym + ("\e[?1i" [key_sprint]) ;; Not an X keysym + ("\e[4h" [key_sic]) ;; Not an X keysym + ("\e[4l" [S-delete]) ;; Not an X keysym + ("\e[Q" [S-insertline]) ;; Not an X keysym + ("\e[1Q" [key_sdl]) ;; Not an X keysym + ("\e[19l" [key_seol]) ;; Not an X keysym + ("\e[19h" [S-erasepage]) ;; Not an X keysym + ("\e[V" [S-page]) ;; Not an X keysym + ("\eS" [send]) ;; Not an X keysym + ("\e5" [S-send]) ;; Not an X keysym + )) -;; The numeric keypad keys. -(let ((i 0)) - (while (< i 10) - (define-key function-key-map - (format "\eO%c" (+ i ?p)) - (vector (intern (format "kp-%d" i)))) - (setq i (1+ i)))) -;; The numbered function keys. -(let ((i 0)) - (while (< i 16) - (define-key function-key-map - (format "\e?%c" (+ i ?a)) - (vector (intern (format "f%d" (1+ i))))) - (define-key function-key-map - (format "\e?%c" (+ i ?A)) - (vector (intern (format "S-f%d" (1+ i))))) - (setq i (1+ i)))) + ;; The numeric keypad keys. + (let ((i 0)) + (while (< i 10) + (define-key function-key-map + (format "\eO%c" (+ i ?p)) + (vector (intern (format "kp-%d" i)))) + (setq i (1+ i)))) + ;; The numbered function keys. + (let ((i 0)) + (while (< i 16) + (define-key function-key-map + (format "\e?%c" (+ i ?a)) + (vector (intern (format "f%d" (1+ i))))) + (define-key function-key-map + (format "\e?%c" (+ i ?A)) + (vector (intern (format "S-f%d" (1+ i))))) + (setq i (1+ i)))) + (tvi970-set-keypad-mode 1)) ;;; Should keypad numbers send ordinary digits or distinct escape sequences? (defvar tvi970-keypad-numeric nil @@ -121,7 +124,5 @@ With a negative argument, select numeric keypad mode." (> (prefix-numeric-value arg) 0))) (send-string-to-terminal (if tvi970-keypad-numeric "\e=" "\e>"))) -(tvi970-set-keypad-mode 1) - ;;; arch-tag: c1334cf0-1462-41c3-a963-c077d175f8f0 ;;; tvi970.el ends here diff --git a/lisp/term/vt100.el b/lisp/term/vt100.el index dfe011c0f6e..6b44e941813 100644 --- a/lisp/term/vt100.el +++ b/lisp/term/vt100.el @@ -36,8 +36,12 @@ ;;; Code: ;; Set up function-key-map entries that termcap and terminfo don't know. -(load "term/lk201" nil t) + +(defun terminal-init-vt100 () + "Terminal initialization function for vt100." + (load "term/lk201" nil t)) + ;;; Controlling the screen width. (defvar vt100-wide-mode (= (frame-width) 132) "t if vt100 is in 132-column mode.") diff --git a/lisp/term/vt102.el b/lisp/term/vt102.el index 887f63837eb..ad780ed5081 100644 --- a/lisp/term/vt102.el +++ b/lisp/term/vt102.el @@ -1,6 +1,8 @@ ;; -*- no-byte-compile: t -*- -(load "term/vt100" nil t) +(defun terminal-init-vt102 () + "Terminal initialization function for vt102." + (load "term/vt100" nil t)) ;;; arch-tag: 6e839cfc-125a-4574-82f1-c23a51f7c50f ;;; vt102.el ends here diff --git a/lisp/term/vt125.el b/lisp/term/vt125.el index 458e0dafc22..2221e597aed 100644 --- a/lisp/term/vt125.el +++ b/lisp/term/vt125.el @@ -1,6 +1,8 @@ ;; -*- no-byte-compile: t -*- -(load "term/vt100" nil t) +(defun terminal-init-vt125 () + "Terminal initialization function for vt125." + (load "term/vt100" nil t)) ;;; arch-tag: 1d92d70f-dd55-4a1d-9088-e215a4883801 ;;; vt125.el ends here diff --git a/lisp/term/vt200.el b/lisp/term/vt200.el index 0ff0a30f567..e1215d15023 100644 --- a/lisp/term/vt200.el +++ b/lisp/term/vt200.el @@ -1,10 +1,12 @@ ;; -*- no-byte-compile: t -*- ;; For our purposes we can treat the vt200 and vt100 almost alike. ;; Most differences are handled by the termcap entry. -(load "term/vt100" nil t) -;; Make F11 an escape key. -(define-key function-key-map "\e[23~" [?\e]) +(defun terminal-init-vt200 () + "Terminal initialization function for vt200." + (load "term/vt100" nil t) + ;; Make F11 an escape key. + (define-key function-key-map "\e[23~" [?\e])) ;;; arch-tag: 0f78f583-9f32-4237-b106-28bcfff21d89 ;;; vt200.el ends here diff --git a/lisp/term/vt201.el b/lisp/term/vt201.el index d7deeaf11c7..315030ab687 100644 --- a/lisp/term/vt201.el +++ b/lisp/term/vt201.el @@ -1,10 +1,11 @@ ;; -*- no-byte-compile: t -*- ;; For our purposes we can treat the vt200 and vt100 almost alike. ;; Most differences are handled by the termcap entry. -(load "term/vt100" nil t) - -;; Make F11 an escape key. -(define-key function-key-map "\e[23~" [?\e]) +(defun terminal-init-vt201 () + "Terminal initialization function for vt201." + (load "term/vt100" nil t) + ;; Make F11 an escape key. + (define-key function-key-map "\e[23~" [?\e])) ;;; arch-tag: a6abb38f-60ea-449e-a9e9-3fb8572c52ae ;;; vt201.el ends here diff --git a/lisp/term/vt220.el b/lisp/term/vt220.el index 7ea1e3b57fa..cccd2a6dfb7 100644 --- a/lisp/term/vt220.el +++ b/lisp/term/vt220.el @@ -1,10 +1,11 @@ ;; -*- no-byte-compile: t -*- ;; For our purposes we can treat the vt200 and vt100 almost alike. ;; Most differences are handled by the termcap entry. -(load "term/vt100" nil t) - -;; Make F11 an escape key. -(define-key function-key-map "\e[23~" [?\e]) +(defun terminal-init-vt220 () + "Terminal initialization function for vt220." + (load "term/vt100" nil t) + ;; Make F11 an escape key. + (define-key function-key-map "\e[23~" [?\e])) ;;; arch-tag: 98fc4867-a20d-46a1-a276-d7be31e49871 ;;; vt220.el ends here diff --git a/lisp/term/vt240.el b/lisp/term/vt240.el index 05f0bebe50f..bb3931edac8 100644 --- a/lisp/term/vt240.el +++ b/lisp/term/vt240.el @@ -1,10 +1,11 @@ ;; -*- no-byte-compile: t -*- ;; For our purposes we can treat the vt200 and vt100 almost alike. ;; Most differences are handled by the termcap entry. -(load "term/vt100" nil t) - -;; Make F11 an escape key. -(define-key function-key-map "\e[23~" [?\e]) +(defun terminal-init-vt240 () + "Terminal initialization function for vt240." + (load "term/vt100" nil t) + ;; Make F11 an escape key. + (define-key function-key-map "\e[23~" [?\e])) ;;; arch-tag: d9f88e9c-02dc-49ff-871c-a415f08e4eb7 ;;; vt240.el ends here diff --git a/lisp/term/vt300.el b/lisp/term/vt300.el index 871ed234bc6..ff600f47a1e 100644 --- a/lisp/term/vt300.el +++ b/lisp/term/vt300.el @@ -1,8 +1,9 @@ ;; -*- no-byte-compile: t -*- -(load "term/vt100" nil t) - -;; Make F11 an escape key. -(define-key function-key-map "\e[23~" [?\e]) +(defun terminal-init-vt300 () + "Terminal initialization function for vt300." + (load "term/vt100" nil t) + ;; Make F11 an escape key. + (define-key function-key-map "\e[23~" [?\e])) ;;; arch-tag: 876831c9-a6f2-444a-b033-706e6fbc149f ;;; vt300.el ends here diff --git a/lisp/term/vt320.el b/lisp/term/vt320.el index c99b8672fc1..fb7772c7b5b 100644 --- a/lisp/term/vt320.el +++ b/lisp/term/vt320.el @@ -1,8 +1,9 @@ ;; -*- no-byte-compile: t -*- -(load "term/vt100" nil t) - -;; Make F11 an escape key. -(define-key function-key-map "\e[23~" [?\e]) +(defun terminal-init-vt320 () + "Terminal initialization function for vt320." + (load "term/vt100" nil t) + ;; Make F11 an escape key. + (define-key function-key-map "\e[23~" [?\e])) ;;; arch-tag: f9f4c954-0b9e-45f9-b450-a320d32abd9c ;;; vt320.el ends here diff --git a/lisp/term/vt400.el b/lisp/term/vt400.el index 666266e2bf5..97c0c5d7372 100644 --- a/lisp/term/vt400.el +++ b/lisp/term/vt400.el @@ -1,8 +1,9 @@ ;; -*- no-byte-compile: t -*- -(load "term/vt100" nil t) - -;; Make F11 an escape key. -(define-key function-key-map "\e[23~" [?\e]) +(defun terminal-init-vt400 () + "Terminal initialization function for vt400." + (load "term/vt100" nil t) + ;; Make F11 an escape key. + (define-key function-key-map "\e[23~" [?\e])) ;;; arch-tag: a70809c5-6b21-42cc-ba20-536683e5e7d5 ;;; vt400.el ends here diff --git a/lisp/term/vt420.el b/lisp/term/vt420.el index 9ed5fbe135b..65ffa759c17 100644 --- a/lisp/term/vt420.el +++ b/lisp/term/vt420.el @@ -1,8 +1,9 @@ ;; -*- no-byte-compile: t -*- -(load "term/vt100" nil t) - -;; Make F11 an escape key. -(define-key function-key-map "\e[23~" [?\e]) +(defun terminal-init-vt420 () + "Terminal initialization function for vt420." + (load "term/vt100" nil t) + ;; Make F11 an escape key. + (define-key function-key-map "\e[23~" [?\e])) ;;; arch-tag: df2f897c-3a12-4b3c-9259-df089f96c160 ;;; vt420.el ends here diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el index 562f5c728c0..64c489d7204 100644 --- a/lisp/term/wyse50.el +++ b/lisp/term/wyse50.el @@ -1,6 +1,6 @@ ;;; wyse50.el --- terminal support code for Wyse 50 -*- no-byte-compile: t -*- -;; Copyright (C) 1989, 1993, 1994 Free Software Foundation, Inc. +;; Copyright (C) 1989, 1993, 1994, 2005 Free Software Foundation, Inc. ;; Author: Daniel Pfeiffer , ;; Jim Blandy @@ -37,74 +37,92 @@ ;;; Code: -(define-key function-key-map "\C-a" (make-keymap)) -(mapcar (function (lambda (key-definition) - (define-key function-key-map - (car key-definition) (nth 1 key-definition)))) - '( - ;; These might be set up by termcap and terminfo - ("\C-k" [up]) - ("\C-j" [down]) - ("\C-l" [right]) - ("\C-h" [left]) - ("\^a@\^m" [f1]) - ("\^aA\^m" [f2]) - ("\^aB\^m" [f3]) - ("\^aC\^m" [f4]) - ("\^aD\^m" [f5]) - ("\^aE\^m" [f6]) - ("\^aF\^m" [f7]) - ("\^aG\^m" [f8]) - ("\^aH\^m" [f9]) +(defun terminal-init-wyse50 () + "Terminal initialization function for wyse50." + (define-key function-key-map "\C-a" (make-keymap)) + (mapcar (function (lambda (key-definition) + (define-key function-key-map + (car key-definition) (nth 1 key-definition)))) + '( + ;; These might be set up by termcap and terminfo + ("\C-k" [up]) + ("\C-j" [down]) + ("\C-l" [right]) + ("\C-h" [left]) + ("\^a@\^m" [f1]) + ("\^aA\^m" [f2]) + ("\^aB\^m" [f3]) + ("\^aC\^m" [f4]) + ("\^aD\^m" [f5]) + ("\^aE\^m" [f6]) + ("\^aF\^m" [f7]) + ("\^aG\^m" [f8]) + ("\^aH\^m" [f9]) - ;; These might be set up by terminfo - ("\eK" [next]) - ("\eT" [clearline]) - ("\^^" [home]) - ("\e\^^" [end]) - ("\eQ" [insert]) - ("\eE" [insertline]) - ("\eR" [deleteline]) - ("\eP" [print]) - ("\er" [replace]) - ("\^aI\^m" [f10]) - ("\^aJ\^m" [f11]) - ("\^aK\^m" [f12]) - ("\^aL\^m" [f13]) - ("\^aM\^m" [f14]) - ("\^aN\^m" [f15]) - ("\^aO\^m" [f16]) - ("\^a`\^m" [f17]) - ("\^aa\^m" [f18]) - ("\^ab\^m" [f19]) - ("\^ac\^m" [f20]) - ("\^ad\^m" [f21]) - ("\^ae\^m" [f22]) - ("\^af\^m" [f23]) - ("\^ag\^m" [f24]) - ("\^ah\^m" [f25]) - ("\^ai\^m" [f26]) - ("\^aj\^m" [f27]) - ("\^ak\^m" [f28]) - ("\^al\^m" [f29]) - ("\^am\^m" [f30]) - ("\^an\^m" [f31]) - ("\^ao\^m" [f32]) + ;; These might be set up by terminfo + ("\eK" [next]) + ("\eT" [clearline]) + ("\^^" [home]) + ("\e\^^" [end]) + ("\eQ" [insert]) + ("\eE" [insertline]) + ("\eR" [deleteline]) + ("\eP" [print]) + ("\er" [replace]) + ("\^aI\^m" [f10]) + ("\^aJ\^m" [f11]) + ("\^aK\^m" [f12]) + ("\^aL\^m" [f13]) + ("\^aM\^m" [f14]) + ("\^aN\^m" [f15]) + ("\^aO\^m" [f16]) + ("\^a`\^m" [f17]) + ("\^aa\^m" [f18]) + ("\^ab\^m" [f19]) + ("\^ac\^m" [f20]) + ("\^ad\^m" [f21]) + ("\^ae\^m" [f22]) + ("\^af\^m" [f23]) + ("\^ag\^m" [f24]) + ("\^ah\^m" [f25]) + ("\^ai\^m" [f26]) + ("\^aj\^m" [f27]) + ("\^ak\^m" [f28]) + ("\^al\^m" [f29]) + ("\^am\^m" [f30]) + ("\^an\^m" [f31]) + ("\^ao\^m" [f32]) - ;; Terminfo may know about these, but X won't - ("\eI" [key-stab]) ;; Not an X keysym - ("\eJ" [key-snext]) ;; Not an X keysym - ("\eY" [key-clear]) ;; Not an X keysym + ;; Terminfo may know about these, but X won't + ("\eI" [key-stab]) ;; Not an X keysym + ("\eJ" [key-snext]) ;; Not an X keysym + ("\eY" [key-clear]) ;; Not an X keysym - ;; These are totally strange :-) - ("\eW" [?\C-?]) ;; Not an X keysym - ("\^a\^k\^m" [funct-up]) ;; Not an X keysym - ("\^a\^j\^m" [funct-down]) ;; Not an X keysym - ("\^a\^l\^m" [funct-right]) ;; Not an X keysym - ("\^a\^h\^m" [funct-left]) ;; Not an X keysym - ("\^a\^m\^m" [funct-return]) ;; Not an X keysym - ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym -)) + ;; These are totally strange :-) + ("\eW" [?\C-?]) ;; Not an X keysym + ("\^a\^k\^m" [funct-up]) ;; Not an X keysym + ("\^a\^j\^m" [funct-down]) ;; Not an X keysym + ("\^a\^l\^m" [funct-right]) ;; Not an X keysym + ("\^a\^h\^m" [funct-left]) ;; Not an X keysym + ("\^a\^m\^m" [funct-return]) ;; Not an X keysym + ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym + )) + + ;; Miscellaneous hacks + + ;; This is an ugly hack for a nasty problem: + ;; Wyse 50 takes one character cell to store video attributes (which seems to + ;; explain width 79 rather than 80, column 1 is not used!!!). + ;; On killing (C-x C-c) the end inverse code (on column 1 of line 24) + ;; of the mode line is overwritten AFTER all the y-or-n questions. + ;; This causes the attribute to remain in effect until the mode line has + ;; scrolled of the screen. Suspending (C-z) does not cause this problem. + ;; On such terminals, Emacs should sacrifice the first and last character of + ;; each mode line, rather than a whole screen column! + (add-hook 'kill-emacs-hook + (function (lambda () (interactive) + (send-string-to-terminal + (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))) (defun enable-arrow-keys () "To be called by term-setup-hook. Overrides 6 Emacs standard keys @@ -131,22 +149,5 @@ M-r M-x move-to-window-line, Funct up-arrow or down-arrow are similar ("\er" nil))) (fset 'enable-arrow-keys nil)) - -;;; Miscellaneous hacks - -;;; This is an ugly hack for a nasty problem: -;;; Wyse 50 takes one character cell to store video attributes (which seems to -;;; explain width 79 rather than 80, column 1 is not used!!!). -;;; On killing (C-x C-c) the end inverse code (on column 1 of line 24) -;;; of the mode line is overwritten AFTER all the y-or-n questions. -;;; This causes the attribute to remain in effect until the mode line has -;;; scrolled of the screen. Suspending (C-z) does not cause this problem. -;;; On such terminals, Emacs should sacrifice the first and last character of -;;; each mode line, rather than a whole screen column! -(add-hook 'kill-emacs-hook - (function (lambda () (interactive) - (send-string-to-terminal - (concat "\ea23R" (1+ (frame-width)) "C\eG0"))))) - ;;; arch-tag: b6a05d37-eead-4cf6-b997-0f956c68881c ;;; wyse50.el ends here diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 1d700b727d3..d0c26aa4b94 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -26,229 +26,238 @@ ;;; Code: -;;; rxvt terminals sometimes set the TERM variable to "xterm", but -;;; rxvt's keybindings that are incompatible with xterm's. It is -;;; better in that case to load rxvt's terminal initialization file. -(if (and (getenv "COLORTERM") - (string-match "\\`rxvt" (getenv "COLORTERM"))) - (load "term/rxvt") +(defun terminal-init-xterm () + "Terminal initialization function for xterm." + ;; rxvt terminals sometimes set the TERM variable to "xterm", but + ;; rxvt's keybindings that are incompatible with xterm's. It is + ;; better in that case to use rxvt's initializion function. + (if (and (getenv "COLORTERM") + (string-match "\\`rxvt" (getenv "COLORTERM"))) + (progn + (load "term/rxvt") + (terminal-init-rxvt)) -;;; The terminal intialization C code file might have initialized -;;; function keys F13->F60 from the termcap/terminfo information. On -;;; a PC-style keyboard these keys correspond to -;;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The -;;; code here subsitutes the corresponding defintions in -;;; function-key-map. This substitution is needed because if a key -;;; definition if found in function-key-map, there are no further -;;; lookups in other keymaps. -(substitute-key-definition [f13] [S-f1] function-key-map) -(substitute-key-definition [f14] [S-f2] function-key-map) -(substitute-key-definition [f15] [S-f3] function-key-map) -(substitute-key-definition [f16] [S-f4] function-key-map) -(substitute-key-definition [f17] [S-f5] function-key-map) -(substitute-key-definition [f18] [S-f6] function-key-map) -(substitute-key-definition [f19] [S-f7] function-key-map) -(substitute-key-definition [f20] [S-f8] function-key-map) -(substitute-key-definition [f21] [S-f9] function-key-map) -(substitute-key-definition [f22] [S-f10] function-key-map) -(substitute-key-definition [f23] [S-f11] function-key-map) -(substitute-key-definition [f24] [S-f12] function-key-map) + ;; The terminal intialization C code file might have initialized + ;; function keys F13->F60 from the termcap/terminfo information. On + ;; a PC-style keyboard these keys correspond to + ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The + ;; code here subsitutes the corresponding defintions in + ;; function-key-map. This substitution is needed because if a key + ;; definition if found in function-key-map, there are no further + ;; lookups in other keymaps. + (substitute-key-definition [f13] [S-f1] function-key-map) + (substitute-key-definition [f14] [S-f2] function-key-map) + (substitute-key-definition [f15] [S-f3] function-key-map) + (substitute-key-definition [f16] [S-f4] function-key-map) + (substitute-key-definition [f17] [S-f5] function-key-map) + (substitute-key-definition [f18] [S-f6] function-key-map) + (substitute-key-definition [f19] [S-f7] function-key-map) + (substitute-key-definition [f20] [S-f8] function-key-map) + (substitute-key-definition [f21] [S-f9] function-key-map) + (substitute-key-definition [f22] [S-f10] function-key-map) + (substitute-key-definition [f23] [S-f11] function-key-map) + (substitute-key-definition [f24] [S-f12] function-key-map) -(substitute-key-definition [f25] [C-f1] function-key-map) -(substitute-key-definition [f26] [C-f2] function-key-map) -(substitute-key-definition [f27] [C-f3] function-key-map) -(substitute-key-definition [f28] [C-f4] function-key-map) -(substitute-key-definition [f29] [C-f5] function-key-map) -(substitute-key-definition [f30] [C-f6] function-key-map) -(substitute-key-definition [f31] [C-f7] function-key-map) -(substitute-key-definition [f32] [C-f8] function-key-map) -(substitute-key-definition [f33] [C-f9] function-key-map) -(substitute-key-definition [f34] [C-f10] function-key-map) -(substitute-key-definition [f35] [C-f11] function-key-map) -(substitute-key-definition [f36] [C-f12] function-key-map) + (substitute-key-definition [f25] [C-f1] function-key-map) + (substitute-key-definition [f26] [C-f2] function-key-map) + (substitute-key-definition [f27] [C-f3] function-key-map) + (substitute-key-definition [f28] [C-f4] function-key-map) + (substitute-key-definition [f29] [C-f5] function-key-map) + (substitute-key-definition [f30] [C-f6] function-key-map) + (substitute-key-definition [f31] [C-f7] function-key-map) + (substitute-key-definition [f32] [C-f8] function-key-map) + (substitute-key-definition [f33] [C-f9] function-key-map) + (substitute-key-definition [f34] [C-f10] function-key-map) + (substitute-key-definition [f35] [C-f11] function-key-map) + (substitute-key-definition [f36] [C-f12] function-key-map) -(substitute-key-definition [f37] [C-S-f1] function-key-map) -(substitute-key-definition [f38] [C-S-f2] function-key-map) -(substitute-key-definition [f39] [C-S-f3] function-key-map) -(substitute-key-definition [f40] [C-S-f4] function-key-map) -(substitute-key-definition [f41] [C-S-f5] function-key-map) -(substitute-key-definition [f42] [C-S-f6] function-key-map) -(substitute-key-definition [f43] [C-S-f7] function-key-map) -(substitute-key-definition [f44] [C-S-f8] function-key-map) -(substitute-key-definition [f45] [C-S-f9] function-key-map) -(substitute-key-definition [f46] [C-S-f10] function-key-map) -(substitute-key-definition [f47] [C-S-f11] function-key-map) -(substitute-key-definition [f48] [C-S-f12] function-key-map) + (substitute-key-definition [f37] [C-S-f1] function-key-map) + (substitute-key-definition [f38] [C-S-f2] function-key-map) + (substitute-key-definition [f39] [C-S-f3] function-key-map) + (substitute-key-definition [f40] [C-S-f4] function-key-map) + (substitute-key-definition [f41] [C-S-f5] function-key-map) + (substitute-key-definition [f42] [C-S-f6] function-key-map) + (substitute-key-definition [f43] [C-S-f7] function-key-map) + (substitute-key-definition [f44] [C-S-f8] function-key-map) + (substitute-key-definition [f45] [C-S-f9] function-key-map) + (substitute-key-definition [f46] [C-S-f10] function-key-map) + (substitute-key-definition [f47] [C-S-f11] function-key-map) + (substitute-key-definition [f48] [C-S-f12] function-key-map) -(substitute-key-definition [f49] [A-f1] function-key-map) -(substitute-key-definition [f50] [A-f2] function-key-map) -(substitute-key-definition [f51] [A-f3] function-key-map) -(substitute-key-definition [f52] [A-f4] function-key-map) -(substitute-key-definition [f53] [A-f5] function-key-map) -(substitute-key-definition [f54] [A-f6] function-key-map) -(substitute-key-definition [f55] [A-f7] function-key-map) -(substitute-key-definition [f56] [A-f8] function-key-map) -(substitute-key-definition [f57] [A-f9] function-key-map) -(substitute-key-definition [f58] [A-f10] function-key-map) -(substitute-key-definition [f59] [A-f11] function-key-map) -(substitute-key-definition [f60] [A-f12] function-key-map) + (substitute-key-definition [f49] [A-f1] function-key-map) + (substitute-key-definition [f50] [A-f2] function-key-map) + (substitute-key-definition [f51] [A-f3] function-key-map) + (substitute-key-definition [f52] [A-f4] function-key-map) + (substitute-key-definition [f53] [A-f5] function-key-map) + (substitute-key-definition [f54] [A-f6] function-key-map) + (substitute-key-definition [f55] [A-f7] function-key-map) + (substitute-key-definition [f56] [A-f8] function-key-map) + (substitute-key-definition [f57] [A-f9] function-key-map) + (substitute-key-definition [f58] [A-f10] function-key-map) + (substitute-key-definition [f59] [A-f11] function-key-map) + (substitute-key-definition [f60] [A-f12] function-key-map) -(let ((map (make-sparse-keymap))) - (define-key map "\e[A" [up]) - (define-key map "\e[B" [down]) - (define-key map "\e[C" [right]) - (define-key map "\e[D" [left]) - (define-key map "\e[1~" [home]) - (define-key map "\e[2~" [insert]) - (define-key map "\e[3~" [delete]) - (define-key map "\e[4~" [select]) - (define-key map "\e[5~" [prior]) - (define-key map "\e[6~" [next]) - (define-key map "\e[11~" [f1]) - (define-key map "\e[12~" [f2]) - (define-key map "\e[13~" [f3]) - (define-key map "\e[14~" [f4]) - (define-key map "\e[15~" [f5]) - (define-key map "\e[17~" [f6]) - (define-key map "\e[18~" [f7]) - (define-key map "\e[19~" [f8]) - (define-key map "\e[20~" [f9]) - (define-key map "\e[21~" [f10]) - (define-key map "\e[23~" [f11]) - (define-key map "\e[24~" [f12]) - (define-key map "\e[29~" [print]) + (let ((map (make-sparse-keymap))) + (define-key map "\e[A" [up]) + (define-key map "\e[B" [down]) + (define-key map "\e[C" [right]) + (define-key map "\e[D" [left]) + (define-key map "\e[1~" [home]) + (define-key map "\e[2~" [insert]) + (define-key map "\e[3~" [delete]) + (define-key map "\e[4~" [select]) + (define-key map "\e[5~" [prior]) + (define-key map "\e[6~" [next]) + (define-key map "\e[11~" [f1]) + (define-key map "\e[12~" [f2]) + (define-key map "\e[13~" [f3]) + (define-key map "\e[14~" [f4]) + (define-key map "\e[15~" [f5]) + (define-key map "\e[17~" [f6]) + (define-key map "\e[18~" [f7]) + (define-key map "\e[19~" [f8]) + (define-key map "\e[20~" [f9]) + (define-key map "\e[21~" [f10]) + (define-key map "\e[23~" [f11]) + (define-key map "\e[24~" [f12]) + (define-key map "\e[29~" [print]) - (define-key map "\eOP" [f1]) - (define-key map "\eOQ" [f2]) - (define-key map "\eOR" [f3]) - (define-key map "\eOS" [f4]) + (define-key map "\eOP" [f1]) + (define-key map "\eOQ" [f2]) + (define-key map "\eOR" [f3]) + (define-key map "\eOS" [f4]) - (define-key map "\eO2P" [S-f1]) - (define-key map "\eO2Q" [S-f2]) - (define-key map "\eO2R" [S-f3]) - (define-key map "\eO2S" [S-f4]) - (define-key map "\e[15;2~" [S-f5]) - (define-key map "\e[17;2~" [S-f6]) - (define-key map "\e[18;2~" [S-f7]) - (define-key map "\e[19;2~" [S-f8]) - (define-key map "\e[20;2~" [S-f9]) - (define-key map "\e[21;2~" [S-f10]) - (define-key map "\e[23;2~" [S-f11]) - (define-key map "\e[24;2~" [S-f12]) + (define-key map "\eO2P" [S-f1]) + (define-key map "\eO2Q" [S-f2]) + (define-key map "\eO2R" [S-f3]) + (define-key map "\eO2S" [S-f4]) + (define-key map "\e[15;2~" [S-f5]) + (define-key map "\e[17;2~" [S-f6]) + (define-key map "\e[18;2~" [S-f7]) + (define-key map "\e[19;2~" [S-f8]) + (define-key map "\e[20;2~" [S-f9]) + (define-key map "\e[21;2~" [S-f10]) + (define-key map "\e[23;2~" [S-f11]) + (define-key map "\e[24;2~" [S-f12]) - (define-key map "\eO5P" [C-f1]) - (define-key map "\eO5Q" [C-f2]) - (define-key map "\eO5R" [C-f3]) - (define-key map "\eO5S" [C-f4]) - (define-key map "\e[15;5~" [C-f5]) - (define-key map "\e[17;5~" [C-f6]) - (define-key map "\e[18;5~" [C-f7]) - (define-key map "\e[19;5~" [C-f8]) - (define-key map "\e[20;5~" [C-f9]) - (define-key map "\e[21;5~" [C-f10]) - (define-key map "\e[23;5~" [C-f11]) - (define-key map "\e[24;5~" [C-f12]) + (define-key map "\eO5P" [C-f1]) + (define-key map "\eO5Q" [C-f2]) + (define-key map "\eO5R" [C-f3]) + (define-key map "\eO5S" [C-f4]) + (define-key map "\e[15;5~" [C-f5]) + (define-key map "\e[17;5~" [C-f6]) + (define-key map "\e[18;5~" [C-f7]) + (define-key map "\e[19;5~" [C-f8]) + (define-key map "\e[20;5~" [C-f9]) + (define-key map "\e[21;5~" [C-f10]) + (define-key map "\e[23;5~" [C-f11]) + (define-key map "\e[24;5~" [C-f12]) - (define-key map "\eO6P" [C-S-f1]) - (define-key map "\eO6Q" [C-S-f2]) - (define-key map "\eO6R" [C-S-f3]) - (define-key map "\eO6S" [C-S-f4]) - (define-key map "\e[15;6~" [C-S-f5]) - (define-key map "\e[17;6~" [C-S-f6]) - (define-key map "\e[18;6~" [C-S-f7]) - (define-key map "\e[19;6~" [C-S-f8]) - (define-key map "\e[20;6~" [C-S-f9]) - (define-key map "\e[21;6~" [C-S-f10]) - (define-key map "\e[23;6~" [C-S-f11]) - (define-key map "\e[24;6~" [C-S-f12]) + (define-key map "\eO6P" [C-S-f1]) + (define-key map "\eO6Q" [C-S-f2]) + (define-key map "\eO6R" [C-S-f3]) + (define-key map "\eO6S" [C-S-f4]) + (define-key map "\e[15;6~" [C-S-f5]) + (define-key map "\e[17;6~" [C-S-f6]) + (define-key map "\e[18;6~" [C-S-f7]) + (define-key map "\e[19;6~" [C-S-f8]) + (define-key map "\e[20;6~" [C-S-f9]) + (define-key map "\e[21;6~" [C-S-f10]) + (define-key map "\e[23;6~" [C-S-f11]) + (define-key map "\e[24;6~" [C-S-f12]) - (define-key map "\eO3P" [A-f1]) - (define-key map "\eO3Q" [A-f2]) - (define-key map "\eO3R" [A-f3]) - (define-key map "\eO3S" [A-f4]) - (define-key map "\e[15;3~" [A-f5]) - (define-key map "\e[17;3~" [A-f6]) - (define-key map "\e[18;3~" [A-f7]) - (define-key map "\e[19;3~" [A-f8]) - (define-key map "\e[20;3~" [A-f9]) - (define-key map "\e[21;3~" [A-f10]) - (define-key map "\e[23;3~" [A-f11]) - (define-key map "\e[24;3~" [A-f12]) + (define-key map "\eO3P" [A-f1]) + (define-key map "\eO3Q" [A-f2]) + (define-key map "\eO3R" [A-f3]) + (define-key map "\eO3S" [A-f4]) + (define-key map "\e[15;3~" [A-f5]) + (define-key map "\e[17;3~" [A-f6]) + (define-key map "\e[18;3~" [A-f7]) + (define-key map "\e[19;3~" [A-f8]) + (define-key map "\e[20;3~" [A-f9]) + (define-key map "\e[21;3~" [A-f10]) + (define-key map "\e[23;3~" [A-f11]) + (define-key map "\e[24;3~" [A-f12]) - (define-key map "\e[1;2A" [S-up]) - (define-key map "\e[1;2B" [S-down]) - (define-key map "\e[1;2C" [S-right]) - (define-key map "\e[1;2D" [S-left]) - (define-key map "\e[1;2F" [S-end]) - (define-key map "\e[1;2H" [S-home]) + (define-key map "\e[1;2A" [S-up]) + (define-key map "\e[1;2B" [S-down]) + (define-key map "\e[1;2C" [S-right]) + (define-key map "\e[1;2D" [S-left]) + (define-key map "\e[1;2F" [S-end]) + (define-key map "\e[1;2H" [S-home]) - (define-key map "\e[1;5A" [C-up]) - (define-key map "\e[1;5B" [C-down]) - (define-key map "\e[1;5C" [C-right]) - (define-key map "\e[1;5D" [C-left]) - (define-key map "\e[1;5F" [C-end]) - (define-key map "\e[1;5H" [C-home]) + (define-key map "\e[1;5A" [C-up]) + (define-key map "\e[1;5B" [C-down]) + (define-key map "\e[1;5C" [C-right]) + (define-key map "\e[1;5D" [C-left]) + (define-key map "\e[1;5F" [C-end]) + (define-key map "\e[1;5H" [C-home]) - (define-key map "\e[1;6A" [C-S-up]) - (define-key map "\e[1;6B" [C-S-down]) - (define-key map "\e[1;6C" [C-S-right]) - (define-key map "\e[1;6D" [C-S-left]) - (define-key map "\e[1;6F" [C-S-end]) - (define-key map "\e[1;6H" [C-S-home]) + (define-key map "\e[1;6A" [C-S-up]) + (define-key map "\e[1;6B" [C-S-down]) + (define-key map "\e[1;6C" [C-S-right]) + (define-key map "\e[1;6D" [C-S-left]) + (define-key map "\e[1;6F" [C-S-end]) + (define-key map "\e[1;6H" [C-S-home]) - (define-key map "\e[1;3A" [A-up]) - (define-key map "\e[1;3B" [A-down]) - (define-key map "\e[1;3C" [A-right]) - (define-key map "\e[1;3D" [A-left]) - (define-key map "\e[1;3F" [A-end]) - (define-key map "\e[1;3H" [A-home]) + (define-key map "\e[1;3A" [A-up]) + (define-key map "\e[1;3B" [A-down]) + (define-key map "\e[1;3C" [A-right]) + (define-key map "\e[1;3D" [A-left]) + (define-key map "\e[1;3F" [A-end]) + (define-key map "\e[1;3H" [A-home]) - (define-key map "\e[2;2~" [S-insert]) - (define-key map "\e[3;2~" [S-delete]) - (define-key map "\e[5;2~" [S-prior]) - (define-key map "\e[6;2~" [S-next]) + (define-key map "\e[2;2~" [S-insert]) + (define-key map "\e[3;2~" [S-delete]) + (define-key map "\e[5;2~" [S-prior]) + (define-key map "\e[6;2~" [S-next]) - (define-key map "\e[2;5~" [C-insert]) - (define-key map "\e[3;5~" [C-delete]) - (define-key map "\e[5;5~" [C-prior]) - (define-key map "\e[6;5~" [C-next]) + (define-key map "\e[2;5~" [C-insert]) + (define-key map "\e[3;5~" [C-delete]) + (define-key map "\e[5;5~" [C-prior]) + (define-key map "\e[6;5~" [C-next]) - (define-key map "\e[2;6~" [C-S-insert]) - (define-key map "\e[3;6~" [C-S-delete]) - (define-key map "\e[5;6~" [C-S-prior]) - (define-key map "\e[6;6~" [C-S-next]) + (define-key map "\e[2;6~" [C-S-insert]) + (define-key map "\e[3;6~" [C-S-delete]) + (define-key map "\e[5;6~" [C-S-prior]) + (define-key map "\e[6;6~" [C-S-next]) - (define-key map "\e[2;3~" [A-insert]) - (define-key map "\e[3;3~" [A-delete]) - (define-key map "\e[5;3~" [A-prior]) - (define-key map "\e[6;3~" [A-next]) + (define-key map "\e[2;3~" [A-insert]) + (define-key map "\e[3;3~" [A-delete]) + (define-key map "\e[5;3~" [A-prior]) + (define-key map "\e[6;3~" [A-next]) - (define-key map "\eOA" [up]) - (define-key map "\eOB" [down]) - (define-key map "\eOC" [right]) - (define-key map "\eOD" [left]) - (define-key map "\eOF" [end]) - (define-key map "\eOH" [home]) + (define-key map "\eOA" [up]) + (define-key map "\eOB" [down]) + (define-key map "\eOC" [right]) + (define-key map "\eOD" [left]) + (define-key map "\eOF" [end]) + (define-key map "\eOH" [home]) - (define-key map "\eO2A" [S-up]) - (define-key map "\eO2B" [S-down]) - (define-key map "\eO2C" [S-right]) - (define-key map "\eO2D" [S-left]) - (define-key map "\eO2F" [S-end]) - (define-key map "\eO2H" [S-home]) + (define-key map "\eO2A" [S-up]) + (define-key map "\eO2B" [S-down]) + (define-key map "\eO2C" [S-right]) + (define-key map "\eO2D" [S-left]) + (define-key map "\eO2F" [S-end]) + (define-key map "\eO2H" [S-home]) - (define-key map "\eO5A" [C-up]) - (define-key map "\eO5B" [C-down]) - (define-key map "\eO5C" [C-right]) - (define-key map "\eO5D" [C-left]) - (define-key map "\eO5F" [C-end]) - (define-key map "\eO5H" [C-home]) + (define-key map "\eO5A" [C-up]) + (define-key map "\eO5B" [C-down]) + (define-key map "\eO5C" [C-right]) + (define-key map "\eO5D" [C-left]) + (define-key map "\eO5F" [C-end]) + (define-key map "\eO5H" [C-home]) - ;; Use inheritance to let the main keymap override those defaults. - ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. - (set-keymap-parent map (keymap-parent function-key-map)) - (set-keymap-parent function-key-map map)) + ;; Use inheritance to let the main keymap override those defaults. + ;; This way we don't override terminfo-derived settings or settings + ;; made in the .emacs file. + (set-keymap-parent map (keymap-parent function-key-map)) + (set-keymap-parent function-key-map map)) + + ;; Do it! + (xterm-register-default-colors) + ;; This recomputes all the default faces given the colors we've just set up. + (tty-set-up-initial-frame-faces))) ;; Set up colors, for those versions of xterm that support it. (defvar xterm-standard-colors @@ -366,11 +375,5 @@ versions of xterm." ;; right colors, so clear them. (clear-face-cache))) -;; Do it! -(xterm-register-default-colors) -;; This recomputes all the default faces given the colors we've just set up. -(tty-set-up-initial-frame-faces) - -) ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a ;;; xterm.el ends here From 753f8b0f930d82fc6c5f23144db936129b54d1c6 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 27 Jul 2005 22:20:46 +0000 Subject: [PATCH 53/69] Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-501 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 97) - Update from CVS 2005-07-27 Reiner Steib * man/gnus.texi (Startup Files): Fix name of gnus-site-init-file. Mention that gnus-init-file is not read when Emacs is invoked with --no-init-file or -q. --- man/ChangeLog | 6 ++++++ man/gnus.texi | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 92341ea9a56..5e72353f896 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,9 @@ +2005-07-27 Reiner Steib + + * gnus.texi (Startup Files): Fix name of gnus-site-init-file. + Mention that gnus-init-file is not read when Emacs is invoked with + --no-init-file or -q. + 2005-07-22 Eli Zaretskii * files.texi (Quoted File Names): Add index entry. diff --git a/man/gnus.texi b/man/gnus.texi index b1d5be22651..3317b85e3e3 100644 --- a/man/gnus.texi +++ b/man/gnus.texi @@ -1468,15 +1468,17 @@ startup files. If you want to turn backup creation off, say something like: @vindex gnus-init-file @vindex gnus-site-init-file When Gnus starts, it will read the @code{gnus-site-init-file} -(@file{.../site-lisp/gnus} by default) and @code{gnus-init-file} +(@file{.../site-lisp/gnus-init} by default) and @code{gnus-init-file} (@file{~/.gnus} by default) files. These are normal Emacs Lisp files and can be used to avoid cluttering your @file{~/.emacs} and @file{site-init} files with Gnus stuff. Gnus will also check for files with the same names as these, but with @file{.elc} and @file{.el} suffixes. In other words, if you have set @code{gnus-init-file} to @file{~/.gnus}, it will look for @file{~/.gnus.elc}, @file{~/.gnus.el}, -and finally @file{~/.gnus} (in this order). - +and finally @file{~/.gnus} (in this order). If Emacs was invoked with +the @option{-q} or @option{--no-init-file} options (@pxref{Initial +Options, ,Initial Options, emacs, The Emacs Manual}), Gnus doesn't read +@code{gnus-init-file}. @node Auto Save From 8aa9ad9fbd8d29ff8da893206f7ff1229272dcb6 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Thu, 28 Jul 2005 02:37:13 +0000 Subject: [PATCH 54/69] *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ead88578764..5e05b184172 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-07-28 Nick Roberts + + * progmodes/gdb-ui.el: Smarten comments. + (gdb-info-breakpoints-custom): Use nowarn when finding file. + 2005-07-27 Dan Nicolaescu * term/apollo.el (terminal-init-apollo): New function containing From 0fc895004ba5fd79cd7d9c137d16889cddb33571 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Thu, 28 Jul 2005 02:38:59 +0000 Subject: [PATCH 55/69] Smarten comments. (gdb-info-breakpoints-custom): Use nowarn when finding file. --- lisp/progmodes/gdb-ui.el | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 8a426a37365..8e574e912c6 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -524,9 +524,9 @@ Also display the main routine in the disassembly buffer if present." (setq gdb-pending-triggers (delq 'gdb-var-update gdb-pending-triggers)) (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) - ;; dummy command to update speedbar at right time + ;; Dummy command to update speedbar at right time. (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn)) - ;; keep gdb-pending-triggers non-nil till end + ;; Keep gdb-pending-triggers non-nil till end. (push 'gdb-speedbar-timer gdb-pending-triggers))) (defun gdb-speedbar-timer-fn () @@ -1023,7 +1023,7 @@ happens to be appropriate." (gdb-invalidate-threads) (unless (eq system-type 'darwin) ;Breaks on Darwin's GDB-5.3. ;; FIXME: with GDB-6 on Darwin, this might very well work. - ;; only needed/used with speedbar/watch expressions + ;; Only needed/used with speedbar/watch expressions. (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) (setq gdb-var-changed t) ; force update (dolist (var gdb-var-list) @@ -1043,9 +1043,9 @@ happens to be appropriate." (if gdb-flush-pending-output nil (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log)) - ;; Recall the left over gud-marker-acc from last time + ;; Recall the left over gud-marker-acc from last time. (setq gud-marker-acc (concat gud-marker-acc string)) - ;; Start accumulating output for the GUD buffer + ;; Start accumulating output for the GUD buffer. (let ((output "")) ;; ;; Process all the complete markers in this chunk. @@ -1295,7 +1295,7 @@ static char *magick[] = { :weight bold)) "Face for enabled breakpoint icon in fringe." :group 'gud) -;; compatibility alias for old name +;; Compatibility alias for old name. (put 'breakpoint-enabled-bitmap-face 'face-alias 'breakpoint-enabled) (defface breakpoint-disabled @@ -1306,13 +1306,13 @@ static char *magick[] = { (((background light)) :foreground "grey40")) "Face for disabled breakpoint icon in fringe." :group 'gud) -;; compatibility alias for old name +;; Compatibility alias for old name. (put 'breakpoint-disabled-bitmap-face 'face-alias 'breakpoint-disabled) -;;-put breakpoint icons in relevant margins (even those set in the GUD buffer) +;; Put breakpoint icons in relevant margins (even those set in the GUD buffer). (defun gdb-info-breakpoints-custom () (let ((flag) (bptno)) - ;; remove all breakpoint-icons in source buffers but not assembler buffer + ;; Remove all breakpoint-icons in source buffers but not assembler buffer. (dolist (buffer (buffer-list)) (with-current-buffer buffer (if (and (eq gud-minor-mode 'gdba) @@ -1342,13 +1342,14 @@ static char *magick[] = { (setq file (cdr (assoc bptno gdb-location-alist)))) (if (and file (not (string-equal file "File not found"))) - (with-current-buffer (find-file-noselect file) + (with-current-buffer + (find-file-noselect file 'nowarn) (set (make-local-variable 'gud-minor-mode) 'gdba) (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) - ;; only want one breakpoint icon at each - ;; location + ;; Only want one breakpoint icon at each + ;; location. (save-excursion (goto-line (string-to-number line)) (gdb-put-breakpoint-icon (eq flag ?y) bptno))) @@ -1388,11 +1389,7 @@ static char *magick[] = { (with-selected-window (posn-window posn) (save-excursion (goto-char (posn-point posn)) - (if -; (or - (posn-object posn) -; (eq (car (fringe-bitmaps-at-pos (posn-point posn))) -; 'breakpoint)) + (if (posn-object posn) (gdb-enqueue-input (list (let ((bptno (get-text-property @@ -1980,7 +1977,7 @@ corresponding to the mode line clicked." 'mouse-1 #'(lambda () (interactive) (let ((gdb-memory-address - ;; let GDB do the arithmetic + ;; Let GDB do the arithmetic. (concat gdb-memory-address " - " (number-to-string From d238808abdbc379139ce9908c748ad381f1bf9ce Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 07:58:52 +0000 Subject: [PATCH 56/69] (clean): Delete getopt.h. (getopt.h): New rule. --- lib-src/makefile.w32-in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in index d8e8c205b3b..48ce5a2f80f 100644 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in @@ -286,6 +286,7 @@ install: $(INSTALL_FILES) clean: - $(DEL) *~ DOC* $(COMPILER_TEMP_FILES) - $(DEL) ctags.c + - $(DEL) getopt.h - $(DEL_TREE) $(OBJDIR) cleanall: clean @@ -301,6 +302,8 @@ cleanall: clean $(CP) $(ALL_DEPS) $@ ../src/paths.h: ../nt/paths.h $(CP) $(ALL_DEPS) $@ +getopt.h: getopt_.h + $(CP) $(ALL_DEPS) $@ ### DEPENDENCIES ### From 9927b6c84cb3965060e32468231bb54442ee5991 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 07:59:33 +0000 Subject: [PATCH 57/69] Don't ignore fns-* and fns.el, which are no longer generated. Ignore also ctags.c and getopt.h. --- lib-src/.gitignore | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib-src/.gitignore b/lib-src/.gitignore index 167540307ae..66933a62c36 100644 --- a/lib-src/.gitignore +++ b/lib-src/.gitignore @@ -1,7 +1,7 @@ DOC Makefile.c b2m -ctags +ctags* cvtmail digest-doc ebrowse @@ -9,8 +9,7 @@ emacsclient emacsserver etags fakemail -fns-* -fns.el +getopt.h hexl make-docfile movemail From 1c264a7397bb32dc169f615e5a7bdd1f81d616a3 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 08:07:47 +0000 Subject: [PATCH 58/69] Add `makefile' and `config.log'. --- nt/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nt/.gitignore b/nt/.gitignore index c577a6a341f..e371584228b 100644 --- a/nt/.gitignore +++ b/nt/.gitignore @@ -1,3 +1,5 @@ *-spd *.pdb .arch-inventory +makefile +config.log From 2323af312b331903547aae9d1ac0a0b7e32da1f0 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 08:26:01 +0000 Subject: [PATCH 59/69] Add `data' and `site-lisp' (for in-place installs). --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 0322669fb04..694f74edfac 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ config.cache config.log config.status configure +data emacs*.tar.gz leim*.tar.gz +site-lisp update.log From 483e28ad9993af64603145f183f75f666da16a05 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 08:29:30 +0000 Subject: [PATCH 60/69] Add `icons' (for in-place installs). --- etc/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/.gitignore b/etc/.gitignore index 38c525889bb..15e45da4361 100644 --- a/etc/.gitignore +++ b/etc/.gitignore @@ -1,4 +1,5 @@ fns-* +icons *.ps *.log *.dvi From c638055f54ac85c9c93765c17565e50f513d616d Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 08:29:54 +0000 Subject: [PATCH 61/69] *** empty log message *** --- ChangeLog | 4 ++++ etc/ChangeLog | 6 +++++- lib-src/ChangeLog | 8 ++++++++ nt/ChangeLog | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bfd7e4602b6..2f054186bfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-07-28 Juanma Barranquero + + * .cvsignore: Add `data' and `site-lisp' (for in-place installs). + 2005-07-26 Paul Eggert Merge gnulib getopt implementation into Emacs. diff --git a/etc/ChangeLog b/etc/ChangeLog index 8fdb699c50e..80e01003faa 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,10 +1,14 @@ +2005-07-28 Juanma Barranquero + + * .cvsignore: Add `icons' (for in-place installs). + 2005-07-19 Juri Linkov * grep.txt: New file. 2005-07-19 Jan Dj,Ad(Brv - * PROBLEMS (Fedora Core 4 GNU/Linux: Segfault during dumping): + * PROBLEMS (Fedora Core 4 GNU/Linux: Segfault during dumping): -R comes after i386 in setarch command. 2005-07-12 Juri Linkov diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 33a39fb68e1..5767b49aaed 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,11 @@ +2005-07-27 Juanma Barranquero + + * .cvsignore: Don't ignore fns-* and fns.el, which are no longer + generated. Ignore also ctags.c and getopt.h. + + * makefile.w32-in (clean): Delete getopt.h. + (getopt.h): New rule. + 2005-07-26 Paul Eggert Merge gnulib getopt implementation into Emacs. diff --git a/nt/ChangeLog b/nt/ChangeLog index 88f3b02c68c..cff8987af3b 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2005-07-28 Juanma Barranquero + + * .cvsignore: Add `makefile' and `config.log'. + 2005-07-26 Paul Eggert Merge gnulib getopt implementation into Emacs. From 14d050df8248a066dc2daca648942db79855dd2f Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 09:45:10 +0000 Subject: [PATCH 62/69] (my_show_window, my_set_window_pos, my_set_focus, my_set_foreground_window, my_destroy_window): Make static. --- src/w32term.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/w32term.c b/src/w32term.c index b6cc61df2a5..796a341ae0c 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -272,6 +272,11 @@ static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, enum text_cursor_kinds)); static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, int, HDC)); +static BOOL my_show_window P_ ((struct frame *, HWND, int)); +static void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT)); +static void my_set_focus P_ ((struct frame *, HWND)); +static void my_set_foreground_window P_ ((HWND)); +static void my_destroy_window P_ ((struct frame *, HWND)); static Lisp_Object Qvendor_specific_keysyms; @@ -3632,7 +3637,7 @@ my_create_scrollbar (f, bar) /*#define ATTACH_THREADS*/ -BOOL +static BOOL my_show_window (FRAME_PTR f, HWND hwnd, int how) { #ifndef ATTACH_THREADS @@ -3643,7 +3648,7 @@ my_show_window (FRAME_PTR f, HWND hwnd, int how) #endif } -void +static void my_set_window_pos (HWND hwnd, HWND hwndAfter, int x, int y, int cx, int cy, UINT flags) { @@ -3661,7 +3666,7 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter, #endif } -void +static void my_set_focus (f, hwnd) struct frame * f; HWND hwnd; @@ -3670,14 +3675,15 @@ my_set_focus (f, hwnd) (WPARAM) hwnd, 0); } -void +static void my_set_foreground_window (hwnd) HWND hwnd; { SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0); } -void + +static void my_destroy_window (f, hwnd) struct frame * f; HWND hwnd; From 0962822d9717cac83be675b8a76efae7b17997fe Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 09:48:25 +0000 Subject: [PATCH 63/69] (my_set_window_pos, my_show_window): Don't declare. (my_create_window, my_create_tip_window): Make static. --- src/ChangeLog | 8 ++++++++ src/w32fns.c | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index dd46874e679..947a780534e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-07-28 Juanma Barranquero + + * w32fns.c (my_set_window_pos, my_show_window): Don't declare. + (my_create_window, my_create_tip_window): Make static. + + * w32term.c (my_show_window, my_set_window_pos, my_set_focus) + (my_set_foreground_window, my_destroy_window): Make static. + 2005-07-26 Paul Eggert Merge gnulib getopt implementation into Emacs. diff --git a/src/w32fns.c b/src/w32fns.c index 4565e6a6e24..dc8d5998765 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -395,10 +395,10 @@ x_window_to_frame (dpyinfo, wdesc) } -BOOL my_show_window P_ ((struct frame *, HWND, int)); -void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT)); static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); +static void my_create_window P_ ((struct frame *)); +static void my_create_tip_window P_ ((struct frame *)); /* TODO: Native Input Method support; see x_create_im. */ void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); @@ -3847,7 +3847,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) return 0; } -void +static void my_create_window (f) struct frame * f; { @@ -3863,7 +3863,7 @@ my_create_window (f) indirectly via the Window thread, as we do not need to process Window messages for the tooltip. Creating tooltips indirectly also creates deadlocks when tooltips are created for menu items. */ -void +static void my_create_tip_window (f) struct frame *f; { From 8154a06e94b2c051a72655ee69f6cfd36aa9f528 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 13:00:18 +0000 Subject: [PATCH 64/69] (recentf-menu-append-commands-p): Declare with `define-obsolete-variable-alias'. (recentf-max-saved-items, recentf-menu-filter, recentf-arrange-by-rule-subfilter): Doc fixes. (recentf-menu-append-commands-flag, recentf-initialize-file-name-history, recentf-expand-file-name, recentf-clear-data): Fix typos in docstrings. --- lisp/recentf.el | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/lisp/recentf.el b/lisp/recentf.el index 57280a7b4bc..dcb962c3f19 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -65,7 +65,7 @@ You should define the options of your own filters in this group." (defcustom recentf-max-saved-items 20 "*Maximum number of items of the recent list that will be saved. -nil means to save the whole list. +A nil value means to save the whole list. See the command `recentf-save-list'." :group 'recentf :type 'integer) @@ -145,7 +145,7 @@ The default is to call `find-file' to edit the selected file." (defcustom recentf-menu-filter nil "*Function used to filter files displayed in the recentf menu. -nil means no filter. The following functions are predefined: +A nil value means no filter. The following functions are predefined: - `recentf-sort-ascending' Sort menu items in ascending order. @@ -199,16 +199,14 @@ elements (see `recentf-make-menu-element' for menu element form)." :set 'recentf-menu-customization-changed) (defcustom recentf-menu-append-commands-flag t - "*non-nil means to append command items to the menu." + "*Non-nil means to append command items to the menu." :group 'recentf :type 'boolean :set 'recentf-menu-customization-changed) -(defvaralias 'recentf-menu-append-commands-p - 'recentf-menu-append-commands-flag) -(make-obsolete-variable 'recentf-menu-append-commands-p - 'recentf-menu-append-commands-flag - "22.1") +(define-obsolete-variable-alias 'recentf-menu-append-commands-p + 'recentf-menu-append-commands-flag + "22.1") (defcustom recentf-auto-cleanup 'mode "*Define when to automatically cleanup the recent list. @@ -244,7 +242,7 @@ cleanup the list." (recentf-auto-cleanup)))) (defcustom recentf-initialize-file-name-history t - "*non-nil means to initialize `file-name-history' with the recent list. + "*Non-nil means to initialize `file-name-history' with the recent list. If `file-name-history' is not empty, do nothing." :group 'recentf :type 'boolean) @@ -350,8 +348,8 @@ filenames." (defsubst recentf-expand-file-name (name) "Convert filename NAME to absolute, and canonicalize it. See also the function `expand-file-name'. -If defined, call the function `recentf-filename-handler' to post -process the canonical name." +If defined, call the function `recentf-filename-handler' +to postprocess the canonical name." (let* ((filename (expand-file-name name))) (or (and recentf-filename-handler (funcall recentf-filename-handler filename)) @@ -557,7 +555,7 @@ menu-elements (no sub-menu)." (defun recentf-clear-data () "Clear data used to build the recentf menu. -This force a rebuild of the menu." +This forces a rebuild of the menu." (easy-menu-remove-item (recentf-menu-bar) recentf-menu-path recentf-menu-title) (setq recentf-data-cache nil)) @@ -703,7 +701,7 @@ defined." (defcustom recentf-arrange-by-rule-subfilter nil "*Function called by a rule based filter to filter sub-menu elements. -nil means no filter. See also `recentf-menu-filter'. +A nil value means no filter. See also `recentf-menu-filter'. You can't use another rule based filter here." :group 'recentf-filters :type '(choice (const nil) function) From 6480c508bfebe3bcc39ece65111d4bbc67c1eec4 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 14:00:03 +0000 Subject: [PATCH 65/69] (isearch-mode-map, isearch-other-meta-char, isearch-quote-char, isearch-printing-char, isearch-text-char-description): "?\ " -> "?\s". (isearch-lazy-highlight-cleanup, isearch-lazy-highlight-initial-delay, isearch-lazy-highlight-interval, isearch-lazy-highlight-max-at-a-time, isearch-lazy-highlight-face, isearch-lazy-highlight-cleanup): Declare with define-obsolete-*-alias macros. (isearch-forward): Fix typo in docstring. (search-invisible, search-ring-yank-pointer, regexp-search-ring-yank-pointer): Doc fixes. --- lisp/ChangeLog | 23 ++++++++++++++++++++++ lisp/isearch.el | 52 +++++++++++++++++++++++++++---------------------- 2 files changed, 52 insertions(+), 23 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5e05b184172..1c67f63aa08 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,26 @@ +2005-07-28 Juanma Barranquero + + * isearch.el (isearch-mode-map, isearch-other-meta-char) + (isearch-quote-char, isearch-printing-char) + (isearch-text-char-description): "?\ " -> "?\s". + (isearch-lazy-highlight-cleanup) + (isearch-lazy-highlight-initial-delay) + (isearch-lazy-highlight-interval) + (isearch-lazy-highlight-max-at-a-time) + (isearch-lazy-highlight-face, isearch-lazy-highlight-cleanup): + Declare with define-obsolete-*-alias macros. + (isearch-forward): Fix typo in docstring. + (search-invisible, search-ring-yank-pointer) + (regexp-search-ring-yank-pointer): Doc fixes. + + * recentf.el (recentf-menu-append-commands-p): Declare with + `define-obsolete-variable-alias'. + (recentf-max-saved-items, recentf-menu-filter) + (recentf-arrange-by-rule-subfilter): Doc fixes. + (recentf-menu-append-commands-flag) + (recentf-initialize-file-name-history, recentf-expand-file-name) + (recentf-clear-data): Fix typos in docstrings. + 2005-07-28 Nick Roberts * progmodes/gdb-ui.el: Smarten comments. diff --git a/lisp/isearch.el b/lisp/isearch.el index f63a8dda1d1..7cc641f4328 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -122,8 +122,8 @@ a tab, a carriage return (control-M), a newline, and `]+'." (defcustom search-invisible 'open "If t incremental search can match hidden text. -nil means don't match invisible text. -If the value is `open', if the text matched is made invisible by +A nil value means don't match invisible text. +When the value is `open', if the text matched is made invisible by an overlay having an `invisible' property and that overlay has a property `isearch-open-invisible', then incremental search will show the contents. \(This applies when using `outline.el' and `hideshow.el'.) @@ -188,10 +188,10 @@ to the search status stack.") (defvar search-ring-yank-pointer nil "Index in `search-ring' of last string reused. -nil if none yet.") +It is nil if none yet.") (defvar regexp-search-ring-yank-pointer nil "Index in `regexp-search-ring' of last string reused. -nil if none yet.") +It is nil if none yet.") (defcustom search-ring-update nil "*Non-nil if advancing or retreating in the search ring should cause search. @@ -246,22 +246,25 @@ If this is nil, extra highlighting can be \"manually\" removed with \\[lazy-highlight-cleanup]." :type 'boolean :group 'lazy-highlight) -(defvaralias 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup) -(make-obsolete-variable 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup "22.1") +(define-obsolete-variable-alias 'isearch-lazy-highlight-cleanup + 'lazy-highlight-cleanup + "22.1") (defcustom lazy-highlight-initial-delay 0.25 "*Seconds to wait before beginning to lazily highlight all matches." :type 'number :group 'lazy-highlight) -(defvaralias 'isearch-lazy-highlight-initial-delay 'lazy-highlight-initial-delay) -(make-obsolete-variable 'isearch-lazy-highlight-initial-delay 'lazy-highlight-initial-delay "22.1") +(define-obsolete-variable-alias 'isearch-lazy-highlight-initial-delay + 'lazy-highlight-initial-delay + "22.1") (defcustom lazy-highlight-interval 0 ; 0.0625 "*Seconds between lazily highlighting successive matches." :type 'number :group 'lazy-highlight) -(defvaralias 'isearch-lazy-highlight-interval 'lazy-highlight-interval) -(make-obsolete-variable 'isearch-lazy-highlight-interval 'lazy-highlight-interval "22.1") +(define-obsolete-variable-alias 'isearch-lazy-highlight-interval + 'lazy-highlight-interval + "22.1") (defcustom lazy-highlight-max-at-a-time 20 "*Maximum matches to highlight at a time (for `lazy-highlight'). @@ -271,8 +274,9 @@ A value of nil means highlight all matches." :type '(choice (const :tag "All" nil) (integer :tag "Some")) :group 'lazy-highlight) -(defvaralias 'isearch-lazy-highlight-max-at-a-time 'lazy-highlight-max-at-a-time) -(make-obsolete-variable 'isearch-lazy-highlight-max-at-a-time 'lazy-highlight-max-at-a-time "22.1") +(define-obsolete-variable-alias 'isearch-lazy-highlight-max-at-a-time + 'lazy-highlight-max-at-a-time + "22.1") (defface lazy-highlight '((((class color) (min-colors 88) (background light)) @@ -288,8 +292,9 @@ A value of nil means highlight all matches." :group 'lazy-highlight) (put 'isearch-lazy-highlight-face 'face-alias 'lazy-highlight) (defvar lazy-highlight-face 'lazy-highlight) -(defvaralias 'isearch-lazy-highlight-face 'lazy-highlight-face) -(make-obsolete-variable 'isearch-lazy-highlight-face 'lazy-highlight-face "22.1") +(define-obsolete-variable-alias 'isearch-lazy-highlight-face + 'lazy-highlight-face + "22.1") ;; Define isearch-mode keymap. @@ -312,12 +317,12 @@ A value of nil means highlight all matches." ;; We need these explicit definitions because, in a dense keymap, ;; the binding for t does not affect characters. ;; We use a dense keymap to save space. - (while (< i ?\ ) + (while (< i ?\s) (define-key map (make-string 1 i) 'isearch-other-control-char) (setq i (1+ i))) ;; Single-byte printing chars extend the search string by default. - (setq i ?\ ) + (setq i ?\s) (while (< i 256) (define-key map (vector i) 'isearch-printing-char) (setq i (1+ i))) @@ -531,7 +536,7 @@ Type \\[isearch-quote-char] to quote control character to search for it. Type \\[isearch-query-replace] to start `query-replace' with string to\ replace from last search string. Type \\[isearch-query-replace-regexp] to start `query-replace-regexp'\ - with string to replace from last search string.. + with string to replace from last search string. Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity. Type \\[isearch-toggle-regexp] to toggle regular-expression mode. @@ -1657,7 +1662,7 @@ Isearch mode." ;; directly to avoid the input method and keyboard ;; coding system translating it. (if (and (integerp key) - (>= key ?\ ) (/= key 127) (< key 256)) + (>= key ?\s) (/= key 127) (< key 256)) (progn (isearch-process-search-char key) (setq keylist (cdr keylist))) @@ -1749,7 +1754,7 @@ Isearch mode." ;; Assume character codes 0200 - 0377 stand for characters in some ;; single-byte character set, and convert them to Emacs ;; characters. - (if (and isearch-regexp (= char ?\ )) + (if (and isearch-regexp (= char ?\s)) (if (subregexp-context-p isearch-string (length isearch-string)) (isearch-process-search-string "[ ]" " ") (isearch-process-search-char char)) @@ -1770,7 +1775,7 @@ Isearch mode." (interactive) (let ((char last-command-char)) (if (= char ?\S-\ ) - (setq char ?\ )) + (setq char ?\s)) (if (and enable-multibyte-characters (>= char ?\200) (<= char ?\377)) @@ -2200,7 +2205,7 @@ since they have special meaning in a regexp." (defun isearch-text-char-description (c) (cond - ((< c ?\ ) (format "^%c" (+ c 64))) + ((< c ?\s) (format "^%c" (+ c 64))) ((= c ?\^?) "^?") (t (char-to-string c)))) @@ -2287,8 +2292,9 @@ is nil. This function is called when exiting an incremental search if (cancel-timer isearch-lazy-highlight-timer) (setq isearch-lazy-highlight-timer nil))) -(defalias 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup) -(make-obsolete 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup "22.1") +(define-obsolete-function-alias 'isearch-lazy-highlight-cleanup + 'lazy-highlight-cleanup + "22.1") (defun isearch-lazy-highlight-new-loop (&optional beg end) "Cleanup any previous `lazy-highlight' loop and begin a new one. From 92482d771b8169a550935196557f17913c6d6ecb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 28 Jul 2005 15:28:44 +0000 Subject: [PATCH 66/69] (ange-ftp-gateway-fatal-msgs, ange-ftp-pending-error-line): New vars. (ange-ftp-process-handle-line, ange-ftp-process-filter): Use them to handle the non-fatal no-route-to-host messages. (internal-ange-ftp-mode): Make the no-match regexp more efficient. --- lisp/ChangeLog | 8 ++++++++ lisp/net/ange-ftp.el | 46 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c67f63aa08..3b1de569838 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2005-07-28 Stefan Monnier + + * net/ange-ftp.el (ange-ftp-gateway-fatal-msgs) + (ange-ftp-pending-error-line): New vars. + (ange-ftp-process-handle-line, ange-ftp-process-filter): Use them + to handle the non-fatal no-route-to-host messages. + (internal-ange-ftp-mode): Make the no-match regexp more efficient. + 2005-07-28 Juanma Barranquero * isearch.el (isearch-mode-map, isearch-other-meta-char) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index e8647dfc221..330fead2393 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -743,6 +743,21 @@ These mean that the FTP process should (or already has) been killed." :group 'ange-ftp :type 'regexp) +(defcustom ange-ftp-potential-error-msgs + ;; On Mac OS X we sometimes get things like: + ;; + ;; ftp> open ftp.nluug.nl + ;; Trying 2001:610:1:80aa:192:87:102:36... + ;; ftp: connect to address 2001:610:1:80aa:192:87:102:36: No route to host + ;; Trying 192.87.102.36... + ;; Connected to ftp.nluug.nl. + "^ftp: connect to address .*: No route to host" + "*Regular expression matching ftp messages that can indicate serious errors. +These mean that something went wrong, but they may be followed by more +messages indicating that the error was somehow corrected." + :group 'ange-ftp + :type 'regexp) + (defcustom ange-ftp-gateway-fatal-msgs "No route to host\\|Connection closed\\|No such host\\|Login incorrect" "*Regular expression matching login failure messages from rlogin/telnet." @@ -1071,6 +1086,7 @@ All HOST values should be in lower case.") (defvar ange-ftp-xfer-size nil) (defvar ange-ftp-process-string nil) (defvar ange-ftp-process-result-line nil) +(defvar ange-ftp-pending-error-line nil) (defvar ange-ftp-process-busy nil) (defvar ange-ftp-process-result nil) (defvar ange-ftp-process-multi-skip nil) @@ -1544,6 +1560,7 @@ good, skip, fatal, or unknown." ((string-match ange-ftp-good-msgs line) (setq ange-ftp-process-busy nil ange-ftp-process-result t + ange-ftp-pending-error-line nil ange-ftp-process-result-line line)) ;; Check this before checking for errors. ;; Otherwise the last line of these three seems to be an error: @@ -1552,11 +1569,17 @@ good, skip, fatal, or unknown." ;; 230-"ftp.stsci.edu: unknown host", the new IP address will be... ((string-match ange-ftp-multi-msgs line) (setq ange-ftp-process-multi-skip t)) + ((string-match ange-ftp-potential-error-msgs line) + ;; This looks like an error, but we have to keep reading the output + ;; to see if it was fixed or not. E.g. it may indicate that IPv6 + ;; failed, but maybe a subsequent IPv4 fallback succeeded. + (set (make-local-variable 'ange-ftp-pending-error-line) line) + t) ((string-match ange-ftp-fatal-msgs line) (delete-process proc) (setq ange-ftp-process-busy nil ange-ftp-process-result-line line)) - (ange-ftp-process-multi-skip + (ange-ftp-process-multi-skip t) (t (setq ange-ftp-process-busy nil @@ -1651,12 +1674,21 @@ good, skip, fatal, or unknown." (string-match "\n" ange-ftp-process-string)) (let ((line (substring ange-ftp-process-string 0 - (match-beginning 0)))) + (match-beginning 0))) + (seen-prompt nil)) (setq ange-ftp-process-string (substring ange-ftp-process-string (match-end 0))) (while (string-match "^ftp> *" line) + (setq seen-prompt t) (setq line (substring line (match-end 0)))) - (ange-ftp-process-handle-line line proc))) + (if (not (and seen-prompt ange-ftp-pending-error-line)) + (ange-ftp-process-handle-line line proc) + ;; If we've seen a potential error message and it + ;; hasn't been cancelled by a good message before + ;; seeing a propt, then the error was real. + (delete-process proc) + (setq ange-ftp-process-busy nil + ange-ftp-process-result-line ange-ftp-pending-error-line)))) ;; has the ftp client finished? if so then do some clean-up ;; actions. @@ -1988,7 +2020,7 @@ on the gateway machine to do the ftp instead." (make-local-variable 'comint-password-prompt-regexp) ;; This is a regexp that can't match anything. ;; ange-ftp has its own ways of handling passwords. - (setq comint-password-prompt-regexp "^a\\'z") + (setq comint-password-prompt-regexp "\\`a\\`") (make-local-variable 'paragraph-start) (setq paragraph-start comint-prompt-regexp) (run-mode-hooks 'internal-ange-ftp-mode-hook)) @@ -4543,9 +4575,9 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") (setq ange-ftp-ls-cache-file nil) ;Stop confusing Dired. 0) -;;; This is turned off because it has nothing properly to do -;;; with dired. It could be reasonable to adapt this to -;;; replace ange-ftp-copy-file. +;; This is turned off because it has nothing properly to do +;; with dired. It could be reasonable to adapt this to +;; replace ange-ftp-copy-file. ;;;;; ------------------------------------------------------------ ;;;;; Noddy support for async copy-file within dired. From 94f659bb02e80a5d69b2c3d4c8f9ad1541838a57 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 28 Jul 2005 16:00:12 +0000 Subject: [PATCH 67/69] Fixed ange-ftp problem with IPv6 failure. --- admin/FOR-RELEASE | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 7ef6c4349b7..b701f2509e7 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -79,32 +79,6 @@ The *Tree* is then displayed as The class A seems to be missing. -** Ange-ftp should ignore irrelevant IPv6 errors: - -Message-Id: <4121-Tue23Mar2004165249+0100-piet@cs.uu.nl> -From: "Piet van Oostrum" -To: emacs-pretest-bug@gnu.org -Subject: Ange-ftp can't deal with IPV6/IPV4 fallback - -Symptoms: - -C-x C-f /ftp.nluug.nl:/ - -The problem is that the DNS first gives an IPV6 address. However our -router doesn't do IPV6. Ftp then falls back to IPV4: - -ftp> open ftp.nluug.nl -Trying 2001:610:1:80aa:192:87:102:36... -ftp: connect to address 2001:610:1:80aa:192:87:102:36: No route to host -Trying 192.87.102.36... -Connected to ftp.nluug.nl. - -Ange-ftp chokes on the `No route to host' message and doesn't look any -further. - -I think in the near future we will see more of this problem, so it might be -time to make anfe-ftp more intelligent. - * DOCUMENTATION ** Document Custom Themes. From 5dac561545414aee1af7cbc1f915c0840a44a532 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 28 Jul 2005 22:41:44 +0000 Subject: [PATCH 68/69] Don't create lisp/Makefile.unix. --- nt/ChangeLog | 4 ++++ nt/configure.bat | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index cff8987af3b..c3dec7b121b 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2005-07-29 Juanma Barranquero + + * configure.bat: Don't create lisp/Makefile.unix. + 2005-07-28 Juanma Barranquero * .cvsignore: Add `makefile' and `config.log'. diff --git a/nt/configure.bat b/nt/configure.bat index bf78ed52bbe..b5f78f2ab51 100755 --- a/nt/configure.bat +++ b/nt/configure.bat @@ -1,7 +1,7 @@ @echo off rem ---------------------------------------------------------------------- rem Configuration script for MS Windows 95/98/Me and NT/2000/XP -rem Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +rem Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 rem Free Software Foundation, Inc. rem This file is part of GNU Emacs. @@ -499,7 +499,6 @@ copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile copy /b config.settings+%MAKECMD%.defs+..\man\makefile.w32-in ..\man\makefile copy /b config.settings+%MAKECMD%.defs+..\lispref\makefile.w32-in ..\lispref\makefile copy /b config.settings+%MAKECMD%.defs+..\lispintro\makefile.w32-in ..\lispintro\makefile -if not exist ..\lisp\Makefile.unix rename ..\lisp\Makefile.in Makefile.unix if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile rem Use the default (no-op) Makefile.in if the nt version is not present. From d44e3b453c528446579182d82284abbfd80f8b7d Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 29 Jul 2005 01:44:40 +0000 Subject: [PATCH 69/69] Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-503 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 98) - Update from CVS 2005-07-28 Katsumi Yamaoka * lisp/gnus/rfc2231.el (rfc2231-parse-string): Take care that not only a segmented parameter but also other parameters might be there. --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/rfc2231.el | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 992c351ef31..7bc733ad90f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2005-07-28 Katsumi Yamaoka + + * rfc2231.el (rfc2231-parse-string): Take care that not only a + segmented parameter but also other parameters might be there. + 2005-07-26 Katsumi Yamaoka * gnus-art.el (gnus-article-next-page-1): Don't scroll if there're diff --git a/lisp/gnus/rfc2231.el b/lisp/gnus/rfc2231.el index 0a6cfdb2af1..4c39ba6c7fd 100644 --- a/lisp/gnus/rfc2231.el +++ b/lisp/gnus/rfc2231.el @@ -1,6 +1,6 @@ ;;; rfc2231.el --- Functions for decoding rfc2231 headers -;; Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004 +;; Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen @@ -52,7 +52,7 @@ The list will be on the form (prev-value "") display-name mailbox c display-string parameters attribute value type subtype number encoded - prev-attribute) + prev-attribute prev-encoded) (ietf-drums-init (mail-header-remove-whitespace (mail-header-remove-comments string))) (let ((table (copy-syntax-table ietf-drums-syntax-table))) @@ -106,9 +106,14 @@ The list will be on the form ;; See if we have any previous continuations. (when (and prev-attribute (not (eq prev-attribute attribute))) - (push (cons prev-attribute prev-value) parameters) + (push (cons prev-attribute + (if prev-encoded + (rfc2231-decode-encoded-string prev-value) + prev-value)) + parameters) (setq prev-attribute nil - prev-value "")) + prev-value "" + prev-encoded nil)) (unless (eq c ?=) (error "Invalid header: %s" string)) (forward-char 1) @@ -127,7 +132,8 @@ The list will be on the form (error "Invalid header: %s" string))) (if number (setq prev-attribute attribute - prev-value (concat prev-value value)) + prev-value (concat prev-value value) + prev-encoded encoded) (push (cons attribute (if encoded (rfc2231-decode-encoded-string value) @@ -137,7 +143,7 @@ The list will be on the form ;; Take care of any final continuations. (when prev-attribute (push (cons prev-attribute - (if encoded + (if prev-encoded (rfc2231-decode-encoded-string prev-value) prev-value)) parameters))