Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 100146. ------------------------------------------------------------ revno: 100146 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2010-05-04 23:45:21 -0400 message: Use define-minor-mode in more cases. * term/tvi970.el (tvi970-set-keypad-mode): * simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode) (normal-erase-is-backspace-mode): * scroll-bar.el (scroll-bar-mode): Use it and define-minor-mode. (set-scroll-bar-mode-1): (Re)move to its sole caller. (get-scroll-bar-mode): New function. * emacs-lisp/cl-macs.el (eq): Handle a non-variable first arg. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-05-05 02:08:25 +0000 +++ lisp/ChangeLog 2010-05-05 03:45:21 +0000 @@ -1,5 +1,15 @@ 2010-05-05 Stefan Monnier + Use define-minor-mode in more cases. + * term/tvi970.el (tvi970-set-keypad-mode): + * simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode) + (normal-erase-is-backspace-mode): + * scroll-bar.el (scroll-bar-mode): Use it and define-minor-mode. + (set-scroll-bar-mode-1): (Re)move to its sole caller. + (get-scroll-bar-mode): New function. + * emacs-lisp/cl-macs.el (eq): Handle a non-variable first arg. + + Use define-minor-mode for less obvious cases. * emacs-lisp/easy-mmode.el (define-minor-mode): Add :variable keyword. * emacs-lisp/cl-macs.el (terminal-parameter, eq): Add setf method. * international/iso-ascii.el (iso-ascii-mode): === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2010-04-21 02:05:24 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2010-05-05 03:45:21 +0000 @@ -282,7 +282,7 @@ ;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist ;;;;;; do* do loop return-from return block etypecase typecase ecase ;;;;;; case load-time-value eval-when destructuring-bind function* -;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "7fad7dd60f2f96ba90432f885015d61b") +;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "0faa39d8f21ae59f2cc1baa835e28a5f") ;;; Generated autoloads from cl-macs.el (autoload 'gensym "cl-macs" "\ === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2010-05-05 02:08:25 +0000 +++ lisp/emacs-lisp/cl-macs.el 2010-05-05 03:45:21 +0000 @@ -1826,7 +1826,17 @@ ;; (setq a 7) or (setq a nil) depending on whether B is nil or not. ;; This is useful when you have control over the PLACE but not over ;; the VALUE, as is the case in define-minor-mode's :variable. -(defsetf eq (a b) (v) `(setf ,a (if ,v ,b (not ,b)))) +(define-setf-method eq (place val) + (let ((method (get-setf-method place cl-macro-environment)) + (val-temp (make-symbol "--eq-val--")) + (store-temp (make-symbol "--eq-store--"))) + (list (append (nth 0 method) (list val-temp)) + (append (nth 1 method) (list val)) + (list store-temp) + `(let ((,(car (nth 2 method)) + (if ,store-temp ,val-temp (not ,val-temp)))) + ,(nth 3 method) ,store-temp) + `(eq ,(nth 4 method) ,val-temp)))) ;;; More complex setf-methods. ;; These should take &environment arguments, but since full arglists aren't === modified file 'lisp/scroll-bar.el' --- lisp/scroll-bar.el 2010-02-28 14:36:34 +0000 +++ lisp/scroll-bar.el 2010-05-05 03:45:21 +0000 @@ -29,6 +29,7 @@ ;;; Code: (require 'mouse) +(eval-when-compile (require 'cl)) ;;;; Utilities. @@ -79,9 +80,6 @@ "Non-nil means `set-scroll-bar-mode' should really do something. This is nil while loading `scroll-bar.el', and t afterward.") -(defun set-scroll-bar-mode-1 (ignore value) - (set-scroll-bar-mode value)) - (defun set-scroll-bar-mode (value) "Set `scroll-bar-mode' to VALUE and put the new value into effect." (if scroll-bar-mode @@ -107,27 +105,23 @@ ;; The default value for :initialize would try to use :set ;; when processing the file in cus-dep.el. :initialize 'custom-initialize-default - :set 'set-scroll-bar-mode-1) + :set (lambda (sym val) (set-scroll-bar-mode val))) ;; We just set scroll-bar-mode, but that was the default. ;; If it is set again, that is for real. (setq scroll-bar-mode-explicit t) -(defun scroll-bar-mode (&optional flag) +(defun get-scroll-bar-mode () scroll-bar-mode) +(defsetf get-scroll-bar-mode set-scroll-bar-mode) +(define-minor-mode scroll-bar-mode "Toggle display of vertical scroll bars on all frames. This command applies to all frames that exist and frames to be created in the future. With a numeric argument, if the argument is positive turn on scroll bars; otherwise turn off scroll bars." - (interactive "P") - - ;; Tweedle the variable according to the argument. - (set-scroll-bar-mode (if (if (null flag) - (not scroll-bar-mode) - (setq flag (prefix-numeric-value flag)) - (or (not (numberp flag)) (> flag 0))) - (or previous-scroll-bar-mode - default-frame-scroll-bars)))) + :variable (eq (get-scroll-bar-mode) + (or previous-scroll-bar-mode + default-frame-scroll-bars))) (defun toggle-scroll-bar (arg) "Toggle whether or not the selected frame has vertical scroll bars. === modified file 'lisp/simple.el' --- lisp/simple.el 2010-05-02 05:56:30 +0000 +++ lisp/simple.el 2010-05-05 03:45:21 +0000 @@ -5149,7 +5149,7 @@ (put 'auto-fill-function 'safe-local-variable 'null) ;; FIXME: turn into a proper minor mode. ;; Add a global minor mode version of it. -(defun auto-fill-mode (&optional arg) +(define-minor-mode auto-fill-mode "Toggle Auto Fill mode. With ARG, turn Auto Fill mode on if and only if ARG is positive. In Auto Fill mode, inserting a space at a column beyond `current-fill-column' @@ -5157,14 +5157,7 @@ The value of `normal-auto-fill-function' specifies the function to use for `auto-fill-function' when turning Auto Fill mode on." - (interactive "P") - (prog1 (setq auto-fill-function - (if (if (null arg) - (not auto-fill-function) - (> (prefix-numeric-value arg) 0)) - normal-auto-fill-function - nil)) - (force-mode-line-update))) + :variable (eq auto-fill-function normal-auto-fill-function)) ;; This holds a document string used to document auto-fill-mode. (defun auto-fill-function () @@ -5263,7 +5256,7 @@ (defvar overwrite-mode-binary (purecopy " Bin Ovwrt") "The string displayed in the mode line when in binary overwrite mode.") -(defun overwrite-mode (arg) +(define-minor-mode overwrite-mode "Toggle overwrite mode. With prefix argument ARG, turn overwrite mode on if ARG is positive, otherwise turn it off. In overwrite mode, printing characters typed @@ -5272,14 +5265,9 @@ Before a tab, such characters insert until the tab is filled in. \\[quoted-insert] still inserts characters in overwrite mode; this is supposed to make it easier to insert characters when necessary." - (interactive "P") - (setq overwrite-mode - (if (if (null arg) (not overwrite-mode) - (> (prefix-numeric-value arg) 0)) - 'overwrite-mode-textual)) - (force-mode-line-update)) + :variable (eq overwrite-mode 'overwrite-mode-textual)) -(defun binary-overwrite-mode (arg) +(define-minor-mode binary-overwrite-mode "Toggle binary overwrite mode. With prefix argument ARG, turn binary overwrite mode on if ARG is positive, otherwise turn it off. In binary overwrite mode, printing @@ -5292,13 +5280,7 @@ Note that binary overwrite mode is not its own minor mode; it is a specialization of overwrite mode, entered by setting the `overwrite-mode' variable to `overwrite-mode-binary'." - (interactive "P") - (setq overwrite-mode - (if (if (null arg) - (not (eq overwrite-mode 'overwrite-mode-binary)) - (> (prefix-numeric-value arg) 0)) - 'overwrite-mode-binary)) - (force-mode-line-update)) + :variable (eq overwrite-mode 'overwrite-mode-binary)) (define-minor-mode line-number-mode "Toggle Line Number mode. @@ -6438,7 +6420,7 @@ normal-erase-is-backspace) 1 0))))) -(defun normal-erase-is-backspace-mode (&optional arg) +(define-minor-mode normal-erase-is-backspace-mode "Toggle the Erase and Delete mode of the Backspace and Delete keys. With numeric ARG, turn the mode on if and only if ARG is positive. @@ -6468,13 +6450,10 @@ have both Backspace, Delete and F1 keys. See also `normal-erase-is-backspace'." - (interactive "P") - (let ((enabled (or (and arg (> (prefix-numeric-value arg) 0)) - (not (or arg - (eq 1 (terminal-parameter - nil 'normal-erase-is-backspace))))))) - (set-terminal-parameter nil 'normal-erase-is-backspace - (if enabled 1 0)) + :variable (eq (terminal-parameter + nil 'normal-erase-is-backspace) 1) + (let ((enabled (eq 1 (terminal-parameter + nil 'normal-erase-is-backspace)))) (cond ((or (memq window-system '(x w32 ns pc)) (memq system-type '(ms-dos windows-nt))) @@ -6510,7 +6489,6 @@ (keyboard-translate ?\C-h ?\C-h) (keyboard-translate ?\C-? ?\C-?)))) - (run-hooks 'normal-erase-is-backspace-hook) (if (called-interactively-p 'interactive) (message "Delete key deletes %s" (if (eq 1 (terminal-parameter nil 'normal-erase-is-backspace)) === modified file 'lisp/term/tvi970.el' --- lisp/term/tvi970.el 2010-01-13 08:35:10 +0000 +++ lisp/term/tvi970.el 2010-05-05 03:45:21 +0000 @@ -28,6 +28,8 @@ ;;; Code: +(eval-when-compile (require 'cl)) + (defvar tvi970-terminal-map (let ((map (make-sparse-keymap))) @@ -102,7 +104,7 @@ ;; Should keypad numbers send ordinary digits or distinct escape sequences? -(defun tvi970-set-keypad-mode (&optional arg) +(define-minor-mode tvi970-set-keypad-mode "Set the current mode of the TVI 970 numeric keypad. In ``numeric keypad mode'', the number keys on the keypad act as ordinary digits. In ``alternate keypad mode'', the keys send distinct @@ -111,12 +113,9 @@ With no argument, toggle between the two possible modes. With a positive argument, select alternate keypad mode. With a negative argument, select numeric keypad mode." - (interactive "P") - (let ((newval (if (null arg) - (not (terminal-parameter nil 'tvi970-keypad-numeric)) - (> (prefix-numeric-value arg) 0)))) - (set-terminal-parameter nil 'tvi970-keypad-numeric newval) - (send-string-to-terminal (if newval "\e=" "\e>")))) + :variable (terminal-parameter nil 'tvi970-keypad-numeric) + (send-string-to-terminal + (if (terminal-parameter nil 'tvi970-keypad-numeric) "\e=" "\e>"))) ;; arch-tag: c1334cf0-1462-41c3-a963-c077d175f8f0 ;;; tvi970.el ends here ------------------------------------------------------------ revno: 100145 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2010-05-04 22:08:25 -0400 message: Use define-minor-mode for less obvious cases. * emacs-lisp/easy-mmode.el (define-minor-mode): Add :variable keyword. * emacs-lisp/cl-macs.el (terminal-parameter, eq): Add setf method. * international/iso-ascii.el (iso-ascii-mode): * frame.el (auto-raise-mode, auto-lower-mode): * composite.el (global-auto-composition-mode): Use define-minor-mode. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-05-03 15:01:21 +0000 +++ etc/NEWS 2010-05-05 02:08:25 +0000 @@ -186,6 +186,8 @@ * Lisp changes in Emacs 24.1 +** define-minor-mode accepts a new keyword :variable. + ** delete-file now accepts an optional second arg, FORCE, which says to always delete and ignore the value of delete-by-moving-to-trash. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-05-04 08:44:47 +0000 +++ lisp/ChangeLog 2010-05-05 02:08:25 +0000 @@ -1,3 +1,11 @@ +2010-05-05 Stefan Monnier + + * emacs-lisp/easy-mmode.el (define-minor-mode): Add :variable keyword. + * emacs-lisp/cl-macs.el (terminal-parameter, eq): Add setf method. + * international/iso-ascii.el (iso-ascii-mode): + * frame.el (auto-raise-mode, auto-lower-mode): + * composite.el (global-auto-composition-mode): Use define-minor-mode. + 2010-05-04 Michael Albinus * net/tramp.el (tramp-methods): Remove "-q" from `tramp-login-args' === modified file 'lisp/composite.el' --- lisp/composite.el 2010-05-03 02:29:46 +0000 +++ lisp/composite.el 2010-05-05 02:08:25 +0000 @@ -764,16 +764,13 @@ Auto Composition mode in all buffers (this is the default).") ;;;###autoload -(defun global-auto-composition-mode (&optional arg) +(define-minor-mode global-auto-composition-mode "Toggle Auto-Composition mode in every possible buffer. With prefix arg, turn Global-Auto-Composition mode on if and only if arg is positive. See `auto-composition-mode' for more information on Auto-Composition mode." - (interactive "P") - (setq-default auto-composition-mode - (if arg - (or (not (integerp arg)) (> arg 0)) - (not (default-value 'auto-composition-mode))))) + :variable (default-value 'auto-composition-mode)) + (defalias 'toggle-auto-composition 'auto-composition-mode) === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2010-04-08 19:59:46 +0000 +++ lisp/emacs-lisp/cl-macs.el 2010-05-05 02:08:25 +0000 @@ -1769,6 +1769,7 @@ (defsetf frame-visible-p cl-set-frame-visible-p) (defsetf frame-width set-screen-width t) (defsetf frame-parameter set-frame-parameter t) +(defsetf terminal-parameter set-terminal-parameter) (defsetf getenv setenv t) (defsetf get-register set-register) (defsetf global-key-binding global-set-key) @@ -1821,10 +1822,16 @@ (defsetf x-get-secondary-selection x-own-secondary-selection t) (defsetf x-get-selection x-own-selection t) +;; This is a hack that allows (setf (eq a 7) B) to mean either +;; (setq a 7) or (setq a nil) depending on whether B is nil or not. +;; This is useful when you have control over the PLACE but not over +;; the VALUE, as is the case in define-minor-mode's :variable. +(defsetf eq (a b) (v) `(setf ,a (if ,v ,b (not ,b)))) + ;;; More complex setf-methods. -;;; These should take &environment arguments, but since full arglists aren't -;;; available while compiling cl-macs, we fake it by referring to the global -;;; variable cl-macro-environment directly. +;; These should take &environment arguments, but since full arglists aren't +;; available while compiling cl-macs, we fake it by referring to the global +;; variable cl-macro-environment directly. (define-setf-method apply (func arg1 &rest rest) (or (and (memq (car-safe func) '(quote function function*)) === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2010-04-28 15:18:37 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2010-05-05 02:08:25 +0000 @@ -116,6 +116,8 @@ :lighter SPEC Same as the LIGHTER argument. :keymap MAP Same as the KEYMAP argument. :require SYM Same as in `defcustom'. +:variable PLACE The location (as can be used with `setf') to use instead + of the variable MODE to store the state of the mode. For example, you could write (define-minor-mode foo-mode \"If enabled, foo on you!\" @@ -147,6 +149,8 @@ (type nil) (extra-args nil) (extra-keywords nil) + (variable nil) + (modefun mode) (require t) (hook (intern (concat mode-name "-hook"))) (hook-on (intern (concat mode-name "-on-hook"))) @@ -167,6 +171,7 @@ (:type (setq type (list :type (pop body)))) (:require (setq require (pop body))) (:keymap (setq keymap (pop body))) + (:variable (setq variable (setq mode (pop body)))) (t (push keyw extra-keywords) (push (pop body) extra-keywords)))) (setq keymap-sym (if (and keymap (symbolp keymap)) keymap @@ -187,12 +192,16 @@ `(progn ;; Define the variable to enable or disable the mode. - ,(if (not globalp) - `(progn - (defvar ,mode ,init-value ,(format "Non-nil if %s is enabled. + ,(cond + ;; If :variable is specified, then the var will be + ;; declared elsewhere. + (variable nil) + ((not globalp) + `(progn + (defvar ,mode ,init-value ,(format "Non-nil if %s is enabled. Use the command `%s' to change this variable." pretty-name mode)) - (make-variable-buffer-local ',mode)) - + (make-variable-buffer-local ',mode))) + (t (let ((base-doc-string (concat "Non-nil if %s is enabled. See the command `%s' for a description of this minor mode." @@ -207,10 +216,10 @@ ,@group ,@type ,@(unless (eq require t) `(:require ,require)) - ,@(nreverse extra-keywords)))) + ,@(nreverse extra-keywords))))) ;; The actual function. - (defun ,mode (&optional arg ,@extra-args) + (defun ,modefun (&optional arg ,@extra-args) ,(or doc (format (concat "Toggle %s on or off. Interactively, with no prefix argument, toggle the mode. @@ -221,11 +230,11 @@ ;; repeat-command still does the toggling correctly. (interactive (list (or current-prefix-arg 'toggle))) (let ((,last-message (current-message))) - (setq ,mode - (if (eq arg 'toggle) - (not ,mode) - ;; A nil argument also means ON now. - (> (prefix-numeric-value arg) 0))) + (,(if (symbolp mode) 'setq 'setf) ,mode + (if (eq arg 'toggle) + (not ,mode) + ;; A nil argument also means ON now. + (> (prefix-numeric-value arg) 0))) ,@body ;; The on/off hooks are here for backward compatibility only. (run-hooks ',hook (if ,mode ',hook-on ',hook-off)) @@ -256,9 +265,10 @@ (t (error "Invalid keymap %S" ,keymap)))) ,(format "Keymap for `%s'." mode-name))) - (add-minor-mode ',mode ',lighter - ,(if keymap keymap-sym - `(if (boundp ',keymap-sym) ,keymap-sym)))))) + ,(unless variable + `(add-minor-mode ',mode ',lighter + ,(if keymap keymap-sym + `(if (boundp ',keymap-sym) ,keymap-sym))))))) ;;; ;;; make global minor mode === modified file 'lisp/frame.el' --- lisp/frame.el 2010-01-14 06:13:16 +0000 +++ lisp/frame.el 2010-05-05 02:08:25 +0000 @@ -24,6 +24,7 @@ ;;; Commentary: ;;; Code: +(eval-when-compile (require 'cl)) (defvar frame-creation-function-alist (list (cons nil @@ -1132,37 +1133,26 @@ (modify-frame-parameters (selected-frame) (list (cons 'border-color color-name)))) -(defun auto-raise-mode (arg) +(define-minor-mode auto-raise-mode "Toggle whether or not the selected frame should auto-raise. With ARG, turn auto-raise mode on if and only if ARG is positive. Note that this controls Emacs's own auto-raise feature. Some window managers allow you to enable auto-raise for certain windows. You can use that for Emacs windows if you wish, but if you do, that is beyond the control of Emacs and this command has no effect on it." - (interactive "P") - (if (null arg) - (setq arg - (if (cdr (assq 'auto-raise (frame-parameters (selected-frame)))) - -1 1))) - (if (> arg 0) - (raise-frame (selected-frame))) - (modify-frame-parameters (selected-frame) - (list (cons 'auto-raise (> arg 0))))) + :variable (frame-parameter nil 'auto-raise) + (if (frame-parameter nil 'auto-raise) + (raise-frame))) -(defun auto-lower-mode (arg) +(define-minor-mode auto-lower-mode "Toggle whether or not the selected frame should auto-lower. With ARG, turn auto-lower mode on if and only if ARG is positive. Note that this controls Emacs's own auto-lower feature. Some window managers allow you to enable auto-lower for certain windows. You can use that for Emacs windows if you wish, but if you do, that is beyond the control of Emacs and this command has no effect on it." - (interactive "P") - (if (null arg) - (setq arg - (if (cdr (assq 'auto-lower (frame-parameters (selected-frame)))) - -1 1))) - (modify-frame-parameters (selected-frame) - (list (cons 'auto-lower (> arg 0))))) + :variable (frame-parameter nil 'auto-lower)) + (defun set-frame-name (name) "Set the name of the selected frame to NAME. When called interactively, prompt for the name of the frame. === modified file 'lisp/international/iso-ascii.el' --- lisp/international/iso-ascii.el 2010-01-13 08:35:10 +0000 +++ lisp/international/iso-ascii.el 2010-05-05 02:08:25 +0000 @@ -33,6 +33,7 @@ ;;; Code: (require 'disp-table) +(eval-when-compile (require 'cl)) (defgroup iso-ascii nil "Set up char tables for ISO 8859/1 on ASCII terminals." @@ -162,15 +163,11 @@ (iso-ascii-display 254 "th") ; small thorn, Icelandic (iso-ascii-display 255 "\"y") ; small y with diaeresis or umlaut mark -(defun iso-ascii-mode (arg) +(define-minor-mode iso-ascii-mode "Toggle ISO-ASCII mode." - (interactive "P") - (unless arg - (setq arg (eq standard-display-table iso-ascii-standard-display-table))) - (setq standard-display-table - (if arg - iso-ascii-display-table - iso-ascii-standard-display-table))) + :variable (eq standard-display-table iso-ascii-display-table) + (unless standard-display-table + (setq standard-display-table iso-ascii-standard-display-table))) (provide 'iso-ascii) === modified file 'lisp/progmodes/idlwave.el' --- lisp/progmodes/idlwave.el 2010-01-14 18:37:23 +0000 +++ lisp/progmodes/idlwave.el 2010-05-05 02:08:25 +0000 @@ -1370,6 +1370,7 @@ not possible without parsing. Thus assignment statement become just the leftover unidentified statements containing an equal sign.") +;; FIXME: This var seems to only ever be set, but never actually used! (defvar idlwave-fill-function 'auto-fill-function "IDL mode auto fill function.") ------------------------------------------------------------ revno: 100144 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2010-05-04 20:21:32 +0200 message: * src/ChangeLog: Formatting fixes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-04 17:44:54 +0000 +++ src/ChangeLog 2010-05-04 18:21:32 +0000 @@ -4,7 +4,7 @@ * eval.c (Fdefvaralias): Remove unintended nested if. (internal_condition_case_2, internal_condition_case_n): Use ANSI type. -2010-05-04 Bernhard Herzog (tiny change) +2010-05-04 Bernhard Herzog (tiny change) * xsmfns.c (smc_save_yourself_CB): strlen(client_id) => strlen(cwd). @@ -135,7 +135,8 @@ definition ... * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): ... here. - * sysdep.c (child_setup_tty, init_sys_modes): Remove !IBMR2AIX code, unused. + * sysdep.c (child_setup_tty, init_sys_modes): Remove !IBMR2AIX code, + unused. 2010-05-01 Eli Zaretskii @@ -148,8 +149,8 @@ (wait_for_termination) [WINDOWSNT]: Move MS-Windows specific code from non-POSIX_SIGNALS section to POSIX_SIGNALS section. - * w32.c (sigemptyset, sigaddset, sigfillset, sigprocmask): New - stubs. + * w32.c (sigemptyset, sigaddset, sigfillset, sigprocmask): + New stubs. Miscellaneous fixes of bidi display. @@ -182,8 +183,7 @@ 2010-04-30 Dan Nicolaescu - * s/gnu.h (POSIX_SIGNALS): - (START_FILES): New definitions. + * s/gnu.h (POSIX_SIGNALS, START_FILES): New definitions. 2010-04-30 Glenn Morris ------------------------------------------------------------ revno: 100143 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2010-05-04 13:44:54 -0400 message: Misc tweaks. * eval.c (Fdefvaralias): Remove unintended nested if. (internal_condition_case_2, internal_condition_case_n): Use ANSI type. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-04 16:03:23 +0000 +++ src/ChangeLog 2010-05-04 17:44:54 +0000 @@ -1,3 +1,9 @@ +2010-05-04 Stefan Monnier + + Misc tweaks. + * eval.c (Fdefvaralias): Remove unintended nested if. + (internal_condition_case_2, internal_condition_case_n): Use ANSI type. + 2010-05-04 Bernhard Herzog (tiny change) * xsmfns.c (smc_save_yourself_CB): strlen(client_id) => strlen(cwd). === modified file 'src/eval.c' --- src/eval.c 2010-05-03 15:01:21 +0000 +++ src/eval.c 2010-05-04 17:44:54 +0000 @@ -770,11 +770,8 @@ sym = XSYMBOL (new_alias); if (sym->constant) - if (sym->redirect == SYMBOL_VARALIAS) - sym->constant = 0; /* Reset. */ - else - /* Not sure why. */ - error ("Cannot make a constant an alias"); + /* Not sure why, but why not? */ + error ("Cannot make a constant an alias"); switch (sym->redirect) { @@ -1567,12 +1564,11 @@ its arguments. */ Lisp_Object -internal_condition_case_2 (bfun, arg1, arg2, handlers, hfun) - Lisp_Object (*bfun) (); - Lisp_Object arg1; - Lisp_Object arg2; - Lisp_Object handlers; - Lisp_Object (*hfun) (); +internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object), + Lisp_Object arg1, + Lisp_Object arg2, + Lisp_Object handlers, + Lisp_Object (*hfun) (Lisp_Object)) { Lisp_Object val; struct catchtag c; @@ -1617,12 +1613,11 @@ and ARGS as second argument. */ Lisp_Object -internal_condition_case_n (bfun, nargs, args, handlers, hfun) - Lisp_Object (*bfun) (); - int nargs; - Lisp_Object *args; - Lisp_Object handlers; - Lisp_Object (*hfun) (); +internal_condition_case_n (Lisp_Object (*bfun) (int, Lisp_Object*), + int nargs, + Lisp_Object *args, + Lisp_Object handlers, + Lisp_Object (*hfun) (Lisp_Object)) { Lisp_Object val; struct catchtag c; ------------------------------------------------------------ revno: 100142 committer: Dan Nicolaescu branch nick: trunk timestamp: Tue 2010-05-04 09:53:59 -0700 message: Delete names that have been removed from the tree. diff: === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2010-05-04 03:17:05 +0000 +++ admin/CPP-DEFINES 2010-05-04 16:53:59 +0000 @@ -67,7 +67,6 @@ EXPLICIT_SIGN_EXTEND LOAD_AVE_CVT LOAD_AVE_TYPE -NO_ARG_ARRAY NO_REMAP VIRT_ADDR_VARIES WORDS_BIG_ENDIAN @@ -98,11 +97,9 @@ BROKEN_SIGPTY BSD4_2 BSD4_3 -BSD_PGRPS BSD_SYSTEM CLASH_DETECTION COFF_BSD_SYMBOLS -CRT0_DUMMIES C_SWITCH_X_SYSTEM DATA_SEG_BITS DATA_START @@ -214,7 +211,6 @@ HAVE_WORKING_VFORK HAVE_XRMSETDATABASE HPUX -IBMR2AIX INHIBIT_X11R6_XIM INTERNAL_TERMINAL IS_ANY_SEP @@ -224,7 +220,6 @@ LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp LD_SWITCH_X_DEFAULT -LIBS_MACHINE LIBS_SYSTEM LIBS_TERMCAP LIBXMU @@ -248,7 +243,6 @@ NEED_UNISTD_H NLIST_STRUCT NOT_C_CODE -NOT_USING_MOTIF NO_ABORT NO_DIR_LIBRARY NO_EDITRES @@ -273,7 +267,6 @@ PAGESIZE PENDING_OUTPUT_COUNT POSIX -POSIX_SIGNALS PREFER_VSUSP PTY_ITERATION PTY_NAME_SPRINTF ------------------------------------------------------------ revno: 100141 committer: Jan D. branch nick: trunk timestamp: Tue 2010-05-04 18:03:23 +0200 message: xsmfns.c (smc_save_yourself_CB): strlen(client_id) => strlen(cwd). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-04 07:40:53 +0000 +++ src/ChangeLog 2010-05-04 16:03:23 +0000 @@ -1,3 +1,7 @@ +2010-05-04 Bernhard Herzog (tiny change) + + * xsmfns.c (smc_save_yourself_CB): strlen(client_id) => strlen(cwd). + 2010-05-04 Dan Nicolaescu Remove BSD_PGRPS. === modified file 'src/xsmfns.c' --- src/xsmfns.c 2010-05-02 18:44:04 +0000 +++ src/xsmfns.c 2010-05-04 16:03:23 +0000 @@ -255,7 +255,7 @@ cwd = get_current_dir_name (); if (cwd) { - chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (client_id) + 1); + chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1); strcpy (chdir_opt, CHDIR_OPT); strcat (chdir_opt, cwd); ------------------------------------------------------------ revno: 100140 committer: Michael Albinus branch nick: trunk timestamp: Tue 2010-05-04 10:44:47 +0200 message: * net/tramp.el (tramp-methods): Remove "-q" from `tramp-login-args' in order to see error messages for failed logins. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-05-03 15:01:21 +0000 +++ lisp/ChangeLog 2010-05-04 08:44:47 +0000 @@ -1,3 +1,8 @@ +2010-05-04 Michael Albinus + + * net/tramp.el (tramp-methods): Remove "-q" from `tramp-login-args' + in order to see error messages for failed logins. + 2010-05-03 Chong Yidong * diff.el (diff-sentinel): @@ -98,7 +103,7 @@ (ede-dired-minor-mode): Use define-minor-mode and derived-mode-p. (ede-dired-add-to-target): Use dolist. -2010-05-01 Toru TSUNEYOSHI +2010-05-01 Toru TSUNEYOSHI Michael Albinus Implement compression for inline methods. @@ -109,7 +114,7 @@ (tramp-find-inline-compress, tramp-get-inline-compress) (tramp-get-inline-coding): New defuns. (tramp-get-remote-coding, tramp-get-local-coding): Remove, - replace by `tramp-get-inline-coding'. + replaced by `tramp-get-inline-coding'. (tramp-handle-file-local-copy, tramp-handle-write-region) (tramp-method-out-of-band-p): Use `tramp-get-inline-coding'. === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2010-05-01 09:34:14 +0000 +++ lisp/net/tramp.el 2010-05-04 08:44:47 +0000 @@ -332,7 +332,7 @@ (tramp-copy-recursive t) (tramp-password-end-of-line nil)) ("scp" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-e" "none"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") @@ -347,7 +347,7 @@ ("-o" "StrictHostKeyChecking=no"))) (tramp-default-port 22)) ("scp1" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-1" "-e" "none"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") @@ -362,7 +362,7 @@ ("-o" "StrictHostKeyChecking=no"))) (tramp-default-port 22)) ("scp2" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-2" "-e" "none"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") @@ -447,7 +447,7 @@ (tramp-copy-keep-date nil) (tramp-password-end-of-line nil)) ("ssh" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-e" "none"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program nil) @@ -460,7 +460,7 @@ ("-o" "StrictHostKeyChecking=no"))) (tramp-default-port 22)) ("ssh1" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-1" "-e" "none"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program nil) @@ -473,7 +473,7 @@ ("-o" "StrictHostKeyChecking=no"))) (tramp-default-port 22)) ("ssh2" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-2" "-e" "none"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program nil) @@ -535,7 +535,7 @@ (tramp-copy-keep-date nil) (tramp-password-end-of-line nil)) ("scpc" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-o" "ControlPath=%t.%%r@%%h:%%p") ("-o" "ControlMaster=yes") ("-e" "none"))) @@ -552,7 +552,7 @@ ("-o" "StrictHostKeyChecking=no"))) (tramp-default-port 22)) ("scpx" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-e" "none" "-t" "-t" "/bin/sh"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") @@ -565,7 +565,7 @@ ("-o" "StrictHostKeyChecking=no"))) (tramp-default-port 22)) ("sshx" (tramp-login-program "ssh") - (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q") + (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-e" "none" "-t" "-t" "/bin/sh"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program nil) ------------------------------------------------------------ revno: 100139 committer: Dan Nicolaescu branch nick: trunk timestamp: Tue 2010-05-04 00:40:53 -0700 message: Remove BSD_PGRPS. * s/bsd-common.h (BSD_PGRPS): Remove undef. * s/gnu-linux.h (BSD_PGRPS): Remove. * term.c (dissociate_if_controlling_tty): * sysdep.c (narrow_foreground_group, widen_foreground_group) (init_sys_modes, reset_sys_modes): * emacs.c (main): * callproc.c (Fcall_process, child_setup): Remove code depending on BSD_PGRPS. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-04 04:00:10 +0000 +++ src/ChangeLog 2010-05-04 07:40:53 +0000 @@ -1,5 +1,15 @@ 2010-05-04 Dan Nicolaescu + Remove BSD_PGRPS. + * s/bsd-common.h (BSD_PGRPS): Remove undef. + * s/gnu-linux.h (BSD_PGRPS): Remove. + * term.c (dissociate_if_controlling_tty): + * sysdep.c (narrow_foreground_group, widen_foreground_group) + (init_sys_modes, reset_sys_modes): + * emacs.c (main): + * callproc.c (Fcall_process, child_setup): Remove code depending + on BSD_PGRPS. + Remove POSIX_SIGNALS. * s/usg5-4.h (POSIX_SIGNALS): * s/netbsd.h (POSIX_SIGNALS): === modified file 'src/callproc.c' --- src/callproc.c 2010-05-03 15:01:21 +0000 +++ src/callproc.c 2010-05-04 07:40:53 +0000 @@ -91,7 +91,7 @@ #endif #ifdef HAVE_SETPGID -#if !defined (USG) || defined (BSD_PGRPS) +#if !defined (USG) #undef setpgrp #define setpgrp setpgid #endif @@ -581,7 +581,7 @@ #ifdef HAVE_SETSID setsid (); #endif -#if defined (USG) && !defined (BSD_PGRPS) +#if defined (USG) setpgrp (); #else setpgrp (pid, pid); @@ -1251,7 +1251,7 @@ #endif /* not MSDOS */ #endif /* not WINDOWSNT */ -#if defined(USG) && !defined(BSD_PGRPS) +#if defined(USG) #ifndef SETPGRP_RELEASES_CTTY setpgrp (); /* No arguments but equivalent in this case */ #endif === modified file 'src/emacs.c' --- src/emacs.c 2010-05-02 18:44:04 +0000 +++ src/emacs.c 2010-05-04 07:40:53 +0000 @@ -81,7 +81,7 @@ #endif #ifdef HAVE_SETPGID -#if !defined (USG) || defined (BSD_PGRPS) +#if !defined (USG) #undef setpgrp #define setpgrp setpgid #endif @@ -193,11 +193,6 @@ data on the first attempt to change it inside asynchronous code. */ int running_asynch_code; -#ifdef BSD_PGRPS -/* See sysdep.c. */ -extern int inherited_pgroup; -#endif - #if defined(HAVE_X_WINDOWS) || defined(HAVE_NS) /* If non-zero, -d was specified, meaning we're using some window system. */ int display_arg; @@ -1187,17 +1182,9 @@ if (! noninteractive) { -#ifdef BSD_PGRPS - if (initialized) - { - inherited_pgroup = EMACS_GETPGRP (0); - setpgrp (0, getpid ()); - } -#else #if defined (USG5) && defined (INTERRUPT_INPUT) setpgrp (); #endif -#endif #if defined (HAVE_GTK_AND_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC) { extern void malloc_enable_thread P_ ((void)); === modified file 'src/s/bsd-common.h' --- src/s/bsd-common.h 2010-03-30 02:47:23 +0000 +++ src/s/bsd-common.h 2010-05-04 07:40:53 +0000 @@ -48,9 +48,6 @@ #define SYSV_SYSTEM_DIR -/* POSIX-style pgrp behavior. */ -#undef BSD_PGRPS - #define UNEXEC unexelf.o /* If the system's imake configuration file defines `NeedWidePrototypes' === modified file 'src/s/gnu-linux.h' --- src/s/gnu-linux.h 2010-05-04 04:00:10 +0000 +++ src/s/gnu-linux.h 2010-05-04 07:40:53 +0000 @@ -206,11 +206,6 @@ #define HAVE_XRMSETDATABASE #endif -/* Use BSD process groups, but use setpgid() instead of setpgrp() to - actually set a process group. */ -/* Interesting: only GNU/Linux defines this, but the BSDs do not... */ -/* #define BSD_PGRPS */ - #define NARROWPROTO 1 /* Use mmap directly for allocating larger buffers. */ === modified file 'src/sysdep.c' --- src/sysdep.c 2010-05-04 04:00:10 +0000 +++ src/sysdep.c 2010-05-04 07:40:53 +0000 @@ -73,7 +73,7 @@ #include #ifdef HAVE_SETPGID -#if !defined (USG) || defined (BSD_PGRPS) +#if !defined (USG) #undef setpgrp #define setpgrp setpgid #endif @@ -859,65 +859,7 @@ #endif /* FASYNC */ #endif /* F_SETFL */ #endif /* SIGIO */ - -/* Saving and restoring the process group of Emacs's terminal. */ - -#ifdef BSD_PGRPS - -/* The process group of which Emacs was a member when it initially - started. - - If Emacs was in its own process group (i.e. inherited_pgroup == - getpid ()), then we know we're running under a shell with job - control (Emacs would never be run as part of a pipeline). - Everything is fine. - - If Emacs was not in its own process group, then we know we're - running under a shell (or a caller) that doesn't know how to - separate itself from Emacs (like sh). Emacs must be in its own - process group in order to receive SIGIO correctly. In this - situation, we put ourselves in our own pgroup, forcibly set the - tty's pgroup to our pgroup, and make sure to restore and reinstate - the tty's pgroup just like any other terminal setting. If - inherited_group was not the tty's pgroup, then we'll get a - SIGTTmumble when we try to change the tty's pgroup, and a CONT if - it goes foreground in the future, which is what should happen. - - This variable is initialized in emacs.c. */ -int inherited_pgroup; - -/* Split off the foreground process group to Emacs alone. When we are - in the foreground, but not started in our own process group, - redirect the tty device handle FD to point to our own process - group. We need to be in our own process group to receive SIGIO - properly. */ -static void -narrow_foreground_group (int fd) -{ - int me = getpid (); - - setpgrp (0, inherited_pgroup); -#if 0 - /* XXX inherited_pgroup should not be zero here, but GTK seems to - mess this up. */ - if (! inherited_pgroup) - abort (); /* Should not happen. */ -#endif - if (inherited_pgroup != me) - EMACS_SET_TTY_PGRP (fd, &me); /* XXX This only works on the controlling tty. */ - setpgrp (0, me); -} - -/* Set the tty to our original foreground group. */ -static void -widen_foreground_group (int fd) -{ - if (inherited_pgroup != getpid ()) - EMACS_SET_TTY_PGRP (fd, &inherited_pgroup); - setpgrp (0, inherited_pgroup); -} - -#endif /* BSD_PGRPS */ + /* Getting and setting emacs_tty structures. */ @@ -1102,15 +1044,6 @@ if (!tty_out->output) return; /* The tty is suspended. */ -#ifdef BSD_PGRPS -#if 0 - /* read_socket_hook is not global anymore. I think doing this - unconditionally will not cause any problems. */ - if (! read_socket_hook && EQ (Vinitial_window_system, Qnil)) -#endif - narrow_foreground_group (fileno (tty_out->input)); -#endif - if (! tty_out->old_tty) tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty)); @@ -1560,9 +1493,6 @@ dos_ttcooked (); #endif -#ifdef BSD_PGRPS - widen_foreground_group (fileno (tty_out->input)); -#endif } #ifdef HAVE_PTYS === modified file 'src/term.c' --- src/term.c 2010-04-20 13:31:28 +0000 +++ src/term.c 2010-05-04 07:40:53 +0000 @@ -3379,7 +3379,7 @@ EMACS_GET_TTY_PGRP (fd, &pgid); /* If tcgetpgrp succeeds, fd is the ctty. */ if (pgid != -1) { -#if defined (USG) && !defined (BSD_PGRPS) +#if defined (USG) setpgrp (); no_controlling_tty = 1; #elif defined (CYGWIN) ------------------------------------------------------------ revno: 100138 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-05-03 21:00:10 -0700 message: Remove POSIX_SIGNALS. * s/usg5-4.h (POSIX_SIGNALS): * s/netbsd.h (POSIX_SIGNALS): * s/msdos.h (POSIX_SIGNALS): * s/ms-w32.h (POSIX_SIGNALS): * s/hpux11.h (POSIX_SIGNALS): * s/gnu.h (POSIX_SIGNALS): * s/gnu-linux.h (POSIX_SIGNALS): * s/freebsd.h (POSIX_SIGNALS): * s/darwin.h (POSIX_SIGNALS): * s/cygwin.h (POSIX_SIGNALS): * s/aix4-2.h (POSIX_SIGNALS): Remove definition. * s/unixware.h: * s/sol2-6.h: Remove comments on POSIX_SIGNALS. * process.c (create_process): * syssignal.h: * sysdep.c (wait_for_termination, init_signals): * process.c (create_process): * msdos.c: POSIX_SIGNALS is always defined on all platforms, remove all code that assumes the contrary. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-04 03:13:35 +0000 +++ src/ChangeLog 2010-05-04 04:00:10 +0000 @@ -1,3 +1,26 @@ +2010-05-04 Dan Nicolaescu + + Remove POSIX_SIGNALS. + * s/usg5-4.h (POSIX_SIGNALS): + * s/netbsd.h (POSIX_SIGNALS): + * s/msdos.h (POSIX_SIGNALS): + * s/ms-w32.h (POSIX_SIGNALS): + * s/hpux11.h (POSIX_SIGNALS): + * s/gnu.h (POSIX_SIGNALS): + * s/gnu-linux.h (POSIX_SIGNALS): + * s/freebsd.h (POSIX_SIGNALS): + * s/darwin.h (POSIX_SIGNALS): + * s/cygwin.h (POSIX_SIGNALS): + * s/aix4-2.h (POSIX_SIGNALS): Remove definition. + * s/unixware.h: + * s/sol2-6.h: Remove comments on POSIX_SIGNALS. + * process.c (create_process): + * syssignal.h: + * sysdep.c (wait_for_termination, init_signals): + * process.c (create_process): + * msdos.c: POSIX_SIGNALS is always defined on all platforms, + remove all code that assumes the contrary. + 2010-05-04 Glenn Morris * s/gnu-linux.h (LD_SWITCH_SYSTEM): Use LD_SWITCH_X_SITE_AUX as a shell === modified file 'src/msdos.c' --- src/msdos.c 2010-04-01 15:15:16 +0000 +++ src/msdos.c 2010-05-04 04:00:10 +0000 @@ -4458,8 +4458,6 @@ #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 -#ifdef POSIX_SIGNALS - /* Augment DJGPP library POSIX signal functions. This is needed as of DJGPP v2.01, but might be in the library in later releases. */ @@ -4557,12 +4555,6 @@ return 0; } -#else /* not POSIX_SIGNALS */ - -sigsetmask (x) int x; { return 0; } -sigblock (mask) int mask; { return 0; } - -#endif /* not POSIX_SIGNALS */ #endif /* not __DJGPP_MINOR__ < 2 */ #ifndef HAVE_SELECT === modified file 'src/process.c' --- src/process.c 2010-04-29 14:29:09 +0000 +++ src/process.c 2010-05-04 04:00:10 +0000 @@ -1866,7 +1866,6 @@ #if !defined (WINDOWSNT) && defined (FD_CLOEXEC) int wait_child_setup[2]; #endif -#ifdef POSIX_SIGNALS sigset_t procmask; sigset_t blocked; struct sigaction sigint_action; @@ -1874,7 +1873,6 @@ #ifdef AIX struct sigaction sighup_action; #endif -#endif /* POSIX_SIGNALS */ /* Use volatile to protect variables from being clobbered by longjmp. */ volatile int forkin, forkout; volatile int pty_flag = 0; @@ -1979,7 +1977,6 @@ /* Delay interrupts until we have a chance to store the new fork's pid in its process structure */ -#ifdef POSIX_SIGNALS sigemptyset (&blocked); #ifdef SIGCHLD sigaddset (&blocked, SIGCHLD); @@ -1996,13 +1993,6 @@ #endif #endif /* HAVE_WORKING_VFORK */ sigprocmask (SIG_BLOCK, &blocked, &procmask); -#else /* !POSIX_SIGNALS */ -#ifdef SIGCHLD -#if defined (BSD_SYSTEM) - sigsetmask (sigmask (SIGCHLD)); -#endif /* BSD_SYSTEM */ -#endif /* SIGCHLD */ -#endif /* !POSIX_SIGNALS */ FD_SET (inchannel, &input_wait_mask); FD_SET (inchannel, &non_keyboard_wait_mask); @@ -2153,15 +2143,7 @@ signal (SIGQUIT, SIG_DFL); /* Stop blocking signals in the child. */ -#ifdef POSIX_SIGNALS sigprocmask (SIG_SETMASK, &procmask, 0); -#else /* !POSIX_SIGNALS */ -#ifdef SIGCHLD -#if defined (BSD_SYSTEM) - sigsetmask (SIGEMPTYMASK); -#endif /* BSD_SYSTEM */ -#endif /* SIGCHLD */ -#endif /* !POSIX_SIGNALS */ if (pty_flag) child_setup_tty (xforkout); @@ -2243,7 +2225,6 @@ /* Restore the signal state whether vfork succeeded or not. (We will signal an error, below, if it failed.) */ -#ifdef POSIX_SIGNALS #ifdef HAVE_WORKING_VFORK /* Restore the parent's signal handlers. */ sigaction (SIGINT, &sigint_action, 0); @@ -2254,13 +2235,6 @@ #endif /* HAVE_WORKING_VFORK */ /* Stop blocking signals in the parent. */ sigprocmask (SIG_SETMASK, &procmask, 0); -#else /* !POSIX_SIGNALS */ -#ifdef SIGCHLD -#if defined (BSD_SYSTEM) - sigsetmask (SIGEMPTYMASK); -#endif /* BSD_SYSTEM */ -#endif /* SIGCHLD */ -#endif /* !POSIX_SIGNALS */ /* Now generate the error if vfork failed. */ if (pid < 0) === modified file 'src/s/aix4-2.h' --- src/s/aix4-2.h 2010-05-04 03:06:27 +0000 +++ src/s/aix4-2.h 2010-05-04 04:00:10 +0000 @@ -126,7 +126,6 @@ #define CLASH_DETECTION /* Perry Smith says these are correct. */ -#define POSIX_SIGNALS #undef sigmask #ifndef HAVE_LIBXMU === modified file 'src/s/cygwin.h' --- src/s/cygwin.h 2010-04-26 17:10:09 +0000 +++ src/s/cygwin.h 2010-05-04 04:00:10 +0000 @@ -104,7 +104,6 @@ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) #define SYSV_SYSTEM_DIR 1 #define UNEXEC unexcw.o -#define POSIX_SIGNALS 1 #define LINKER $(CC) /* Use terminfo instead of termcap. Fewer environment variables to === modified file 'src/s/darwin.h' --- src/s/darwin.h 2010-05-04 03:06:27 +0000 +++ src/s/darwin.h 2010-05-04 04:00:10 +0000 @@ -215,10 +215,6 @@ ioctl TIOCSCTTY. */ #define DONT_REOPEN_PTY -/* This makes create_process in process.c save and restore signal - handlers correctly. Suggested by Nozomu Ando.*/ -#define POSIX_SIGNALS - /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */ #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS === modified file 'src/s/freebsd.h' --- src/s/freebsd.h 2010-04-27 03:14:14 +0000 +++ src/s/freebsd.h 2010-05-04 04:00:10 +0000 @@ -101,10 +101,5 @@ #define USE_MMAP_FOR_BUFFERS 1 -/* Use sigprocmask(2) and friends instead of sigblock(2); the man page - of sigblock says it is obsolete. */ - -#define POSIX_SIGNALS 1 - /* arch-tag: 426529ca-b7c4-448f-b10a-d4dcdc9c78eb (do not change this comment) */ === modified file 'src/s/gnu-linux.h' --- src/s/gnu-linux.h 2010-05-04 03:13:35 +0000 +++ src/s/gnu-linux.h 2010-05-04 04:00:10 +0000 @@ -187,7 +187,6 @@ #define SYSV_SYSTEM_DIR /* use dirent.h */ #define POSIX /* affects getpagesize.h and systty.h */ -#define POSIX_SIGNALS #undef LIB_GCC #define LIB_GCC === modified file 'src/s/gnu.h' --- src/s/gnu.h 2010-04-30 20:48:04 +0000 +++ src/s/gnu.h 2010-05-04 04:00:10 +0000 @@ -28,8 +28,6 @@ #define SIGNALS_VIA_CHARACTERS -#define POSIX_SIGNALS - /* Tell Emacs that we are a terminfo based system; disable the use of local termcap. (GNU uses ncurses.) */ #ifdef HAVE_LIBNCURSES === modified file 'src/s/hpux11.h' --- src/s/hpux11.h 2010-01-04 05:35:18 +0000 +++ src/s/hpux11.h 2010-05-04 04:00:10 +0000 @@ -1,10 +1,5 @@ #include "hpux10-20.h" -#ifdef POSIX_SIGNALS -#undef POSIX_SIGNALS -#endif -#define POSIX_SIGNALS 1 - /* SA_RESTART resets the timeout of `select', so don't use it. */ #define BROKEN_SA_RESTART === modified file 'src/s/ms-w32.h' --- src/s/ms-w32.h 2010-05-01 18:28:00 +0000 +++ src/s/ms-w32.h 2010-05-04 04:00:10 +0000 @@ -123,8 +123,6 @@ #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\') #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) -/* Do we have POSIX signals? (We don't, but we don't care, either.) */ -#define POSIX_SIGNALS 1 #include struct sigaction { int sa_flags; === modified file 'src/s/msdos.h' --- src/s/msdos.h 2010-04-21 05:47:56 +0000 +++ src/s/msdos.h 2010-05-04 04:00:10 +0000 @@ -128,9 +128,6 @@ /* Mode line description of a buffer's type. */ #define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B") -/* Do we have POSIX signals? */ -#define POSIX_SIGNALS - /* We have (the code to control) a mouse. */ #define HAVE_MOUSE === modified file 'src/s/netbsd.h' --- src/s/netbsd.h 2010-05-04 03:13:35 +0000 +++ src/s/netbsd.h 2010-05-04 04:00:10 +0000 @@ -80,10 +80,5 @@ #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS -/* Use sigprocmask and friends instead of sigblock; - sigblock is considered obsolete on NetBSD. */ - -#define POSIX_SIGNALS 1 - /* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81 (do not change this comment) */ === modified file 'src/s/sol2-6.h' --- src/s/sol2-6.h 2010-04-23 07:00:38 +0000 +++ src/s/sol2-6.h 2010-05-04 04:00:10 +0000 @@ -49,8 +49,8 @@ #endif /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock - rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't - work if POSIX_SIGNALS is defined. It may also be appropriate for SVR4.x + rather than sighold/sigrelse, which appear to be BSD4.1 specific. + It may also be appropriate for SVR4.x (x<2) but I'm not sure. fnf@cygnus.com */ /* This sets the name of the slave side of the PTY. On SysVr4, grantpt(3) forks a subprocess, so keep sigchld_handler() from === modified file 'src/s/unixware.h' --- src/s/unixware.h 2010-04-27 08:09:01 +0000 +++ src/s/unixware.h 2010-05-04 04:00:10 +0000 @@ -32,8 +32,8 @@ #define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock - rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't - work if POSIX_SIGNALS is defined. It may also be appropriate for SVR4.x + rather than sighold/sigrelse, which appear to be BSD4.1 specific. + It may also be appropriate for SVR4.x (x<2) but I'm not sure. fnf@cygnus.com */ /* This sets the name of the slave side of the PTY. On SysVr4, grantpt(3) forks a subprocess, so keep sigchld_handler() from === modified file 'src/s/usg5-4.h' --- src/s/usg5-4.h 2010-03-30 02:47:23 +0000 +++ src/s/usg5-4.h 2010-05-04 04:00:10 +0000 @@ -61,10 +61,6 @@ #define LDAV_SYMBOL "avenrun" -/* Special hacks needed to make Emacs run on this system. */ - -#define POSIX_SIGNALS - /* setjmp and longjmp can safely replace _setjmp and _longjmp, but they will run slower. */ === modified file 'src/sysdep.c' --- src/sysdep.c 2010-05-01 20:14:10 +0000 +++ src/sysdep.c 2010-05-04 04:00:10 +0000 @@ -419,7 +419,6 @@ else sigpause (SIGEMPTYMASK); #else /* not BSD_SYSTEM, and not HPUX version >= 6 */ -#ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */ #ifdef WINDOWSNT wait (0); break; @@ -434,24 +433,6 @@ sigsuspend (&empty_mask); #endif /* not WINDOWSNT */ -#else /* not POSIX_SIGNALS */ -#ifdef HAVE_SYSV_SIGPAUSE - sighold (SIGCHLD); - if (0 > kill (pid, 0)) - { - sigrelse (SIGCHLD); - break; - } - sigpause (SIGCHLD); -#else /* not HAVE_SYSV_SIGPAUSE */ - if (0 > kill (pid, 0)) - break; - /* Using sleep instead of pause avoids timing error. - If the inferior dies just before the sleep, - we lose just one second. */ - sleep (1); -#endif /* not HAVE_SYSV_SIGPAUSE */ -#endif /* not POSIX_SIGNALS */ #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ #else /* not subprocesses */ break; @@ -2090,8 +2071,6 @@ /* POSIX signals support - DJB */ /* Anyone with POSIX signals should have ANSI C declarations */ -#ifdef POSIX_SIGNALS - sigset_t empty_mask, full_mask; #ifndef WINDOWSNT @@ -2168,7 +2147,6 @@ return (old_mask); } -#endif /* POSIX_SIGNALS */ #if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST static char *my_sys_siglist[NSIG]; @@ -2181,10 +2159,8 @@ void init_signals () { -#ifdef POSIX_SIGNALS sigemptyset (&empty_mask); sigfillset (&full_mask); -#endif #if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST if (! initialized) === modified file 'src/syssignal.h' --- src/syssignal.h 2010-03-22 19:51:59 +0000 +++ src/syssignal.h 2010-05-04 04:00:10 +0000 @@ -30,8 +30,6 @@ extern pthread_t main_thread; #endif -#ifdef POSIX_SIGNALS - /* Don't #include . That header should always be #included before "config.h", because some configuration files (like s/hpux.h) indicate that SIGIO doesn't work by #undef-ing SIGIO. If this file @@ -87,15 +85,6 @@ #define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG) -#else /* ! defined (POSIX_SIGNALS) */ - -#ifndef sigunblock -#define sigunblock(SIG) \ -{ SIGMASKTYPE omask = sigblock (SIGEMPTYMASK); sigsetmask (omask & ~SIG); } -#endif - -#endif /* ! defined (POSIX_SIGNALS) */ - #ifndef SIGMASKTYPE #define SIGMASKTYPE int #endif ------------------------------------------------------------ revno: 100137 committer: Glenn Morris branch nick: trunk timestamp: Mon 2010-05-03 20:33:04 -0700 message: Regenerate configure, src/config.in. diff: === modified file 'configure' --- configure 2010-05-03 02:15:26 +0000 +++ configure 2010-05-04 03:33:04 +0000 @@ -703,6 +703,8 @@ GZIP_PROG MAKEINFO LIB_MATH +C_SWITCH_MACHINE +C_SWITCH_SYSTEM CRT_DIR LIBSOUND PKG_CONFIG @@ -711,6 +713,8 @@ CFLAGS_SOUND SET_MAKE XMKMF +LD_SWITCH_X_SITE_AUX +LD_SWITCH_X_SITE_AUX_RPATH NS_OBJ NS_SUPPORT HAVE_XSERVER @@ -775,11 +779,8 @@ bitmapdir gamedir gameuser -c_switch_system -c_switch_machine unexec LD_SWITCH_X_SITE -LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE C_SWITCH_X_SYSTEM X_TOOLKIT_TYPE @@ -806,6 +807,7 @@ CYGWIN_OBJ PRE_ALLOC_OBJ POST_ALLOC_OBJ +LD_SWITCH_SYSTEM_TEMACS LTLIBOBJS' ac_subst_files='' ac_user_opts=' @@ -5866,15 +5868,7 @@ #ifndef LIBS_SYSTEM #define LIBS_SYSTEM #endif -#ifndef C_SWITCH_SYSTEM -#define C_SWITCH_SYSTEM -#endif -#ifndef C_SWITCH_MACHINE -#define C_SWITCH_MACHINE -#endif configure___ libsrc_libs=LIBS_SYSTEM -configure___ c_switch_system=C_SWITCH_SYSTEM -configure___ c_switch_machine=C_SWITCH_MACHINE configure___ LIBX=-lX11 @@ -5908,10 +5902,6 @@ #define LD_SWITCH_SYSTEM #endif -#ifndef LD_SWITCH_X_SITE_AUX -#define LD_SWITCH_X_SITE_AUX -#endif - configure___ ld_switch_system=LD_SWITCH_SYSTEM #ifdef THIS_IS_CONFIGURE @@ -5952,12 +5942,98 @@ ac_link="$ac_link $ld_switch_system" + +C_SWITCH_MACHINE= +if test "$machine" = "alpha"; then + { $as_echo "$as_me:$LINENO: checking whether __ELF__ is declared" >&5 +$as_echo_n "checking whether __ELF__ is declared... " >&6; } +if test "${ac_cv_have_decl___ELF__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + 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 +int +main () +{ +#ifndef __ELF__ + (void) __ELF__; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl___ELF__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl___ELF__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___ELF__" >&5 +$as_echo "$ac_cv_have_decl___ELF__" >&6; } + + if test "$ac_cv_have_decl___ELF__" = "yes"; then + ## With ELF, make sure that all common symbols get allocated to in the + ## data section. Otherwise, the dump of temacs may miss variables in + ## the shared library that have been initialized. For example, with + ## GNU libc, __malloc_initialized would normally be resolved to the + ## shared library's .bss section, which is fatal. + if test "x$GCC" = "xyes"; then + C_SWITCH_MACHINE="-fno-common" + else + { { $as_echo "$as_me:$LINENO: error: What gives? Fix me if DEC Unix supports ELF now." >&5 +$as_echo "$as_me: error: What gives? Fix me if DEC Unix supports ELF now." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi + + + +C_SWITCH_SYSTEM= +## Some programs in src produce warnings saying certain subprograms +## are too complex and need a MAXMEM value greater than 2000 for +## additional optimization. --nils@exp-math.uni-essen.de +test "$opsys" = "aix4.2" && test "x$GCC" = "xyes" && \ + C_SWITCH_SYSTEM="-ma -qmaxmem=4000" +## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. +## It is redundant in glibc2, since we define _GNU_SOURCE. + + + ### Make sure subsequent tests use flags consistent with the build flags. if test x"${OVERRIDE_CPPFLAGS}" != x; then CPPFLAGS="${OVERRIDE_CPPFLAGS}" else - CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS" + CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS" fi @@ -9728,17 +9804,19 @@ ## Workaround for bug in autoconf <= 2.62. ## http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01551.html ## No need to do anything special for these standard directories. -## This is an experiment, take it out if it causes problems. if test -n "${x_libraries}" && test x"${x_libraries}" != xNONE; then x_libraries=`echo :${x_libraries}: | sed -e 's|:/usr/lib64:|:|g' -e 's|:/lib64:|:|g' -e 's|^:||' -e 's|:$||'` fi +LD_SWITCH_X_SITE_AUX= +LD_SWITCH_X_SITE_AUX_RPATH= if test "${x_libraries}" != NONE; then if test -n "${x_libraries}"; then LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"` + LD_SWITCH_X_SITE_AUX_RPATH=`echo ${LD_SWITCH_X_SITE_AUX} | sed -e 's/-R/-Wl,-rpath,/'` fi x_default_search_path="" x_search_path=${x_libraries} @@ -9761,6 +9839,9 @@ fi done fi + + + if test "${x_includes}" != NONE && test -n "${x_includes}"; then C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"` fi @@ -25991,9 +26072,6 @@ - - - ## Used in lwlib/Makefile.in. @@ -26037,11 +26115,6 @@ cat >>confdefs.h <<_ACEOF -#define LD_SWITCH_X_SITE_AUX ${LD_SWITCH_X_SITE_AUX} -_ACEOF - - -cat >>confdefs.h <<_ACEOF #define C_SWITCH_X_SITE ${C_SWITCH_X_SITE} _ACEOF @@ -26189,6 +26262,30 @@ +case "$opsys" in + aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;; + + darwin) + ## The -headerpad option tells ld (see man page) to leave room at the + ## end of the header for adding load commands. Needed for dumping. + ## 0x690 is the total size of 30 segment load commands (at 56 + ## each); under Cocoa 31 commands are required. + if test "$HAVE_NS" = "yes"; then + libs_nsgui="-framework AppKit" + headerpad_extra=6C8 + else + libs_nsgui= + headerpad_extra=690 + fi + LD_SWITCH_SYSTEM_TEMACS="-prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" + ;; + + *) LD_SWITCH_SYSTEM_TEMACS= ;; +esac + + + + === modified file 'src/config.in' --- src/config.in 2010-04-27 06:20:03 +0000 +++ src/config.in 2010-05-04 03:33:04 +0000 @@ -807,10 +807,6 @@ its own, you might want to add "-L/..." or something similar. */ #undef LD_SWITCH_X_SITE -/* Define LD_SWITCH_X_SITE_AUX with an -R option in case it's needed (for - Solaris, for example). */ -#undef LD_SWITCH_X_SITE_AUX - /* Define to 1 if localtime caches TZ. */ #undef LOCALTIME_CACHE