From 042cabb13b0419d8aa5cfac9e087d78730d1dbc7 Mon Sep 17 00:00:00 2001 From: tomo Date: Tue, 24 Sep 2002 16:02:12 +0000 Subject: [PATCH] XEmacs 21.4.8 "Honest Recruiter". --- ChangeLog | 8 ++++++++ lib-src/ChangeLog | 4 ++++ lisp/ChangeLog | 19 +++++++++++++++++++ lisp/select.el | 38 ++++++++++++++++++++++++++------------ lisp/simple.el | 13 +++++++++---- lwlib/ChangeLog | 4 ++++ man/ChangeLog | 4 ++++ netinstall/ChangeLog | 8 ++++++-- nt/ChangeLog | 4 ++++ src/ChangeLog | 26 ++++++++++++++++++++++++++ src/process.c | 45 ++++++++++++++++++++++++++++++++++++++------- src/process.h | 7 +++++++ tests/ChangeLog | 4 ++++ version.sh | 6 +++--- 14 files changed, 162 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index b903f5a..eb48d1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + +2002-05-09 Stephen J. Turnbull + + * info/.cvsignore: New file from 21.5. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 35763e2..f4b6416 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d5db062..da80c61 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + +2002-05-09 Stephen J. Turnbull + + This patch is based on Jerry James's patch and analysis. + + * select.el (get-clipboard): + (get-selection): + Update docstrings. + (get-clipboard-foreign): + (get-selection-foreign): + New function for use as `interprogram-paste-function's. + + * simple.el (interprogram-paste-function): Change default to + `get-clipboard-foreign'; improve docstring. + (interprogram-cut-function): Improve dosctring. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. diff --git a/lisp/select.el b/lisp/select.el index 3905641..d654ea7 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -75,9 +75,15 @@ set the clipboard.") (insert clip)))) (defun get-clipboard () - "Return text pasted to the clipboard." + "Return text pasted to the clipboard. +Not suitable for `interprogram-paste-function', use `get-clipboard-foreign'." (get-selection 'CLIPBOARD)) +(defun get-clipboard-foreign () + "Return text pasted to the clipboard by another program. +See `interprogram-paste-function' for more information." + (get-selection-foreign 'CLIPBOARD)) + (define-device-method get-cutbuffer "Return the value of one of the cut buffers. This will do nothing under anything other than X.") @@ -93,19 +99,27 @@ says how to convert the data. Returns NIL if there is no selection." "Return the value of a window-system selection. The argument TYPE (default `PRIMARY') says which selection, and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) -says how to convert the data. If there is no selection an error is signalled." +says how to convert the data. If there is no selection an error is signalled. +Not suitable in a `interprogram-paste-function', q.v." (or type (setq type 'PRIMARY)) (or data-type (setq data-type selected-text-type)) - (let ((text - (if (consp data-type) - (condition-case err - (get-selection-internal type (car data-type)) - (selection-conversion-error - (if (cdr data-type) - (get-selection type (cdr data-type)) - (signal (car err) (cdr err))))) - (get-selection-internal type data-type)))) - text)) + (if (consp data-type) + (condition-case err + (get-selection-internal type (car data-type)) + (selection-conversion-error + (if (cdr data-type) + (get-selection type (cdr data-type)) + (signal (car err) (cdr err))))) + (get-selection-internal type data-type))) + +(defun get-selection-foreign (&optional type data-type) + "Return the value of a window-system selection, or nil if XEmacs owns it. +The argument TYPE (default `PRIMARY') says which selection, +and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) +says how to convert the data. If there is no selection an error is signalled. +See `interprogram-paste-function' for more information." + (unless (selection-owner-p type) + (get-selection type data-type))) ;; FSFmacs calls this `x-set-selection', and reverses the ;; first two arguments (duh ...). This order is more logical. diff --git a/lisp/simple.el b/lisp/simple.el index 89afe34..36566d4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1222,7 +1222,9 @@ The function takes one or two arguments. The first argument, TEXT, is a string containing the text which should be made available. The second, PUSH, if non-nil means this is a \"new\" kill; -nil means appending to an \"old\" kill." +nil means appending to an \"old\" kill. + +One reasonable choice is `own-clipboard' (the default)." :type '(radio (function-item :tag "Send to Clipboard" :format "%t\n" own-clipboard) @@ -1230,7 +1232,7 @@ nil means appending to an \"old\" kill." (function :tag "Other")) :group 'killing) -(defcustom interprogram-paste-function 'get-clipboard +(defcustom interprogram-paste-function 'get-clipboard-foreign "Function to call to get text cut from other programs. Most window systems provide some sort of facility for cutting and @@ -1248,10 +1250,13 @@ than Emacs has provided a string for pasting; if Emacs provided the most recent string, the function should return nil. If it is difficult to tell whether Emacs or some other program provided the current string, it is probably good enough to return nil if the string -is equal (according to `string=') to the last text Emacs provided." +is equal (according to `string=') to the last text Emacs provided. + +Reasonable choices include `get-clipboard-foreign' (the default), and +functions calling `get-selection-foreign' (q.v.)." :type '(radio (function-item :tag "Get from Clipboard" :format "%t\n" - get-clipboard) + get-clipboard-foreign) (const :tag "None" nil) (function :tag "Other")) :group 'killing) diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index c5c748f..846f96c 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,7 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. diff --git a/man/ChangeLog b/man/ChangeLog index 33374c7..b42d899 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. diff --git a/netinstall/ChangeLog b/netinstall/ChangeLog index 7aa517e..2a2f053 100644 --- a/netinstall/ChangeLog +++ b/netinstall/ChangeLog @@ -1,3 +1,7 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. @@ -292,5 +296,5 @@ * all: port from cygwin setup. -%%% $Id: ChangeLog,v 1.2.2.13 2001/12/17 08:45:59 stephent Exp $ -$Revision: 1.2.2.13 $ +%%% $Id: ChangeLog,v 1.2.2.15 2002/05/09 12:02:35 stephent Exp $ +$Revision: 1.2.2.15 $ diff --git a/nt/ChangeLog b/nt/ChangeLog index b8b6b06..5178ece 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. diff --git a/src/ChangeLog b/src/ChangeLog index bd6c040..6a91759 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,29 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + +2002-05-07 Nix + + Supersedes 2002-04-17 patch. + + * process.h (PROCESS_LIVE_P): Use the process status as + evidence of health, not the state of the input stream. + (PROCESS_READABLE_P): Say if the process is readable + from. (It may be dead nonetheless.) + (CHECK_READABLE_PROCESS): Test for that condition. + + * process.c (create_process): Use PROCESS_READABLE_P. + (read_process_output, set_process_filter): Likewise. + + * process.c (Fprocess_input_coding_system): Use CHECK_READABLE_PROCESS. + (Fset_process_input_coding_system, Fprocess_coding_system): Likewise. + + This code is #if 0'd, this is not the time to add new functions: + + * process.c (Fprocess_readable_p): Report readability status. + * process.c (Qprocess_readable_p): New, associated symbol... + * process.c (syms_of_process): ... initialize it. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. diff --git a/src/process.c b/src/process.c index 405dc90..f555019 100644 --- a/src/process.c +++ b/src/process.c @@ -58,7 +58,7 @@ Boston, MA 02111-1307, USA. */ #include "systty.h" #include "syswait.h" -Lisp_Object Qprocessp, Qprocess_live_p; +Lisp_Object Qprocessp, Qprocess_live_p, Qprocess_readable_p; /* Process methods */ struct process_methods the_process_methods; @@ -266,6 +266,29 @@ Return t if OBJECT is a process that is alive. ? Qt : Qnil; } +#if 0 +/* This is a reasonable definition for this new primitive. Kyle sez: + + "The patch looks OK to me except for the creation and exporting of the + Fprocess_readable_p function. I don't think a new Lisp function + should be created until we know something actually needs it. If + we later want to give process-readable-p different semantics it + may be hard to do it and stay compatible with what we hastily + create today." + + He's right, not yet. Let's discuss the semantics on XEmacs Design + before enabling this. +*/ +DEFUN ("process-readable-p", Fprocess_readable_p, 1, 1, 0, /* +Return t if OBJECT is a process from which input may be available. +*/ + (object)) +{ + return PROCESSP (object) && PROCESS_READABLE_P (XPROCESS (object)) + ? Qt : Qnil; +} +#endif + DEFUN ("process-list", Fprocess_list, 0, 0, 0, /* Return a list of all processes. */ @@ -512,7 +535,7 @@ create_process (Lisp_Object process, Lisp_Object *argv, int nargv, pid = PROCMETH (create_process, (p, argv, nargv, program, cur_dir)); p->pid = make_int (pid); - if (PROCESS_LIVE_P (p)) + if (PROCESS_READABLE_P (p)) event_stream_select_process (p); } @@ -842,7 +865,7 @@ read_process_output (Lisp_Object process) Really, the loop in execute_internal_event() should check itself for a process-filter change, like in status_notify(); but the struct Lisp_Process is not exported outside of this file. */ - if (!PROCESS_LIVE_P (p)) + if (!PROCESS_READABLE_P (p)) return -1; /* already closed */ if (!NILP (p->filter) && (p->filter_does_read)) @@ -1051,7 +1074,7 @@ void set_process_filter (Lisp_Object process, Lisp_Object filter, int filter_does_read) { CHECK_PROCESS (process); - if (PROCESS_LIVE_P (XPROCESS (process))) { + if (PROCESS_READABLE_P (XPROCESS (process))) { if (EQ (filter, Qt)) event_stream_unselect_process (XPROCESS (process)); else @@ -1142,7 +1165,7 @@ Return PROCESS's input coding system. (process)) { process = get_process (process); - CHECK_LIVE_PROCESS (process); + CHECK_READABLE_PROCESS (process); return decoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_instream) ); } @@ -1162,7 +1185,7 @@ Return a pair of coding-system for decoding and encoding of PROCESS. (process)) { process = get_process (process); - CHECK_LIVE_PROCESS (process); + CHECK_READABLE_PROCESS (process); return Fcons (decoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_instream)), encoding_stream_coding_system @@ -1177,7 +1200,7 @@ Set PROCESS's input coding system to CODESYS. { codesys = Fget_coding_system (codesys); process = get_process (process); - CHECK_LIVE_PROCESS (process); + CHECK_READABLE_PROCESS (process); set_decoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_instream), codesys); @@ -2023,6 +2046,10 @@ syms_of_process (void) defsymbol (&Qprocessp, "processp"); defsymbol (&Qprocess_live_p, "process-live-p"); +#if 0 + /* see comment at Fprocess_readable_p */ + defsymbol (&Qprocess_readable_p, "process-readable-p"); +#endif defsymbol (&Qrun, "run"); defsymbol (&Qstop, "stop"); defsymbol (&Qopen, "open"); @@ -2037,6 +2064,10 @@ syms_of_process (void) DEFSUBR (Fprocessp); DEFSUBR (Fprocess_live_p); +#if 0 + /* see comment at Fprocess_readable_p */ + DEFSUBR (Fprocess_readable_p); +#endif DEFSUBR (Fget_process); DEFSUBR (Fget_buffer_process); DEFSUBR (Fdelete_process); diff --git a/src/process.h b/src/process.h index 5fefad1..736660d 100644 --- a/src/process.h +++ b/src/process.h @@ -46,6 +46,7 @@ DECLARE_LRECORD (process, Lisp_Process); #define PROCESSP(x) RECORDP (x, process) #define CHECK_PROCESS(x) CHECK_RECORD (x, process) #define PROCESS_LIVE_P(x) (EQ ((x)->status_symbol, Qrun)) +#define PROCESS_READABLE_P(x) (!NILP ((x)->pipe_instream)) #define CHECK_LIVE_PROCESS(x) do { \ CHECK_PROCESS (x); \ @@ -53,6 +54,12 @@ DECLARE_LRECORD (process, Lisp_Process); dead_wrong_type_argument (Qprocess_live_p, (x)); \ } while (0) +#define CHECK_READABLE_PROCESS(x) do { \ + CHECK_PROCESS (x); \ + if (! PROCESS_READABLE_P (XPROCESS (x))) \ + dead_wrong_type_argument (Qprocess_readable_p, (x)); \ +} while (0) + #ifdef emacs EXFUN (Fprocess_kill_without_query, 2); diff --git a/tests/ChangeLog b/tests/ChangeLog index 4de0e07..e19c551 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2002-05-09 Stephen J. Turnbull + + * XEmacs 21.4.8 "Honest Recruiter" is released. + 2002-05-04 Stephen J. Turnbull * XEmacs 21.4.7 "Economic Science" is released. diff --git a/version.sh b/version.sh index 9236956..80d9c65 100644 --- a/version.sh +++ b/version.sh @@ -2,9 +2,9 @@ emacs_is_beta= emacs_major_version=21 emacs_minor_version=4 -emacs_beta_version=7 -emacs_kit_version= -xemacs_codename="Economic Science" +emacs_beta_version=8 +xemacs_codename="Honest Recruiter" +emacs_kitname="" infodock_major_version=4 infodock_minor_version=0 infodock_build_version=8 -- 1.7.10.4