[PATCH 21.4 21.5] Prevent bogus caching of background in custom-properties
12 years, 10 months
Vin Shelton
Aidan -
Here is your patch with a ChangeLog supplied. If I hear no objection
within the next couple of days, I will apply this patch to both 21.4
and 21.5.
Thanks,
Vin
diff -r 5e1c1e53103c lisp/ChangeLog
--- a/lisp/ChangeLog Sun Apr 03 09:59:56 2011 -0400
+++ b/lisp/ChangeLog Mon Nov 14 22:14:50 2011 -0500
@@ -1,0 +1,7 @@
+2011-11-14 Vin Shelton <acs(a)xemacs.org>
+
+ * faces.el: When the default background was changed from light to
+ dark or vice versa, the custom-property cache maintained the old
+ value, preventing face definitions from choosing the proper
+ values. Patch from Aidan Kehoe.
+
diff -r 5e1c1e53103c lisp/faces.el
--- a/lisp/faces.el Sun Apr 03 09:59:56 2011 -0400
+++ b/lisp/faces.el Mon Nov 14 22:15:03 2011 -0500
@@ -1314,7 +1314,6 @@
(device-type (frame-device frame)))
'class (device-class (frame-device frame))
'background (or frame-background-mode
- (frame-property frame 'background-mode)
(get-frame-background-mode frame))))
(defcustom init-face-from-resources t
@@ -1375,15 +1374,7 @@
(defun get-custom-frame-properties (&optional frame)
"Return a plist with the frame properties of FRAME used by custom.
If FRAME is nil, return the default frame properties."
- (cond (frame
- ;; Try to get from cache.
- (let ((cache (frame-property frame 'custom-properties)))
- (unless cache
- ;; Oh well, get it then.
- (setq cache (extract-custom-frame-properties frame))
- ;; and cache it...
- (set-frame-property frame 'custom-properties cache))
- cache))
+ (cond (frame (extract-custom-frame-properties frame))
(default-custom-frame-properties)
(t
(setq default-custom-frame-properties
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Ignore lazy docstring info, #'built-in-symbol-file; nothing built-in uses it.
12 years, 11 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1321204432 0
# Node ID 3b1d4fa716a4f3c563f7e86f8943098fc7dcc359
# Parent 391d809fa4e9b1f3f813ff1141df16d802824195
Ignore lazy docstring info, #'built-in-symbol-file; nothing built-in uses it.
2011-11-13 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c (Fbuilt_in_symbol_file):
Don't attempt to take file information from lazy docstring
information in compiled functions; those functions are not
built-in, and as such it's appropriate to give nil.
Fix some indentation in passing.
diff -r 391d809fa4e9 -r 3b1d4fa716a4 src/ChangeLog
--- a/src/ChangeLog Wed Nov 09 13:16:19 2011 +0000
+++ b/src/ChangeLog Sun Nov 13 17:13:52 2011 +0000
@@ -1,3 +1,11 @@
+2011-11-13 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doc.c (Fbuilt_in_symbol_file):
+ Don't attempt to take file information from lazy docstring
+ information in compiled functions; those functions are not
+ built-in, and as such it's appropriate to give nil.
+ Fix some indentation in passing.
+
2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
Prevent SIGPIPEs in deactivate_process().
diff -r 391d809fa4e9 -r 3b1d4fa716a4 src/doc.c
--- a/src/doc.c Wed Nov 09 13:16:19 2011 +0000
+++ b/src/doc.c Sun Nov 13 17:13:52 2011 +0000
@@ -513,12 +513,19 @@
Lisp_Object fun;
Lisp_Object filename = Qnil;
- if (EQ(Ffboundp(symbol), Qt) && (EQ(type, Qnil) || EQ(type, Qdefun)))
+ CHECK_SYMBOL (symbol);
+
+ if (!UNBOUNDP (XSYMBOL_FUNCTION (symbol))
+ && (NILP (type) || EQ (type, Qdefun)))
{
fun = Findirect_function (symbol);
- if (SUBRP (fun) || (CONSP(fun) && (EQ (Qmacro, Fcar_safe (fun)))
- && (fun = Fcdr_safe (fun), SUBRP (fun))))
+ if (EQ (Qmacro, Fcar_safe (fun)))
+ {
+ fun = XCDR (fun);
+ }
+
+ if (SUBRP (fun))
{
if (XSUBR (fun)->doc == 0)
return Qnil;
@@ -537,10 +544,7 @@
}
}
- if (COMPILED_FUNCTIONP (fun) || (CONSP(fun) &&
- (EQ (Qmacro, Fcar_safe (fun)))
- && (fun = Fcdr_safe (fun),
- COMPILED_FUNCTIONP (fun))))
+ if (COMPILED_FUNCTIONP (fun))
{
Lisp_Object tem;
Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
@@ -548,30 +552,25 @@
if (! (f->flags.documentationp))
return Qnil;
tem = compiled_function_documentation (f);
- if (NATNUMP (tem) || CONSP (tem))
+ if (NATNUMP (tem))
{
- filename = get_object_file_name (tem);
- return filename;
- }
+ return get_object_file_name (tem);
+ }
}
}
- if (EQ(Fboundp(symbol), Qt) && (EQ(type, Qnil) || EQ(type, Qdefvar)))
+ if (!UNBOUNDP (XSYMBOL_VALUE (symbol)) && (NILP (type) || EQ (type, Qdefvar)))
{
Lisp_Object doc_offset = Fget (symbol, Qvariable_documentation, Qnil);
- if (!NILP(doc_offset))
+ if (!NILP (doc_offset))
{
- if (FIXNUMP(doc_offset))
+ if (FIXNUMP (doc_offset))
{
- filename = get_object_file_name
+ filename = get_object_file_name
(XFIXNUM (doc_offset) > 0 ? doc_offset
: make_fixnum (- XFIXNUM (doc_offset)));
}
- else if (CONSP(doc_offset))
- {
- filename = get_object_file_name(doc_offset);
- }
return filename;
}
}
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Update tests that have started failing because of changed design decisions.
12 years, 11 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1320844579 0
# Node ID 391d809fa4e9b1f3f813ff1141df16d802824195
# Parent cc8ea7ed4286d0eca21c76c96f9787025d2b8d86
Update tests that have started failing because of changed design decisions.
2011-11-09 Aidan Kehoe <kehoea(a)parhasard.net>
Update some tests that have started failing because of some
changed design decisions.
* automated/lisp-tests.el (eq):
(type-of 42) now returns the symbol fixnum.
* automated/lisp-tests.el (needs-lexical-context):
(function ...) doesn't create a lexical context, and this is now the
case in interpreted as well as in compiled code.
* automated/mule-tests.el (featurep):
Silence messages when byte-compiling files; if a file doesn't have
the escape-quoted coding cookie, it will now have the
raw-text-unix coding cookie, look for that instead of looking for
the absence of the escape-quoted coding cookie.
diff -r cc8ea7ed4286 -r 391d809fa4e9 tests/ChangeLog
--- a/tests/ChangeLog Wed Nov 09 12:51:10 2011 +0000
+++ b/tests/ChangeLog Wed Nov 09 13:16:19 2011 +0000
@@ -1,3 +1,18 @@
+2011-11-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ Update some tests that have started failing because of some
+ changed design decisions.
+ * automated/lisp-tests.el (eq):
+ (type-of 42) now returns the symbol fixnum.
+ * automated/lisp-tests.el (needs-lexical-context):
+ (function ...) doesn't create a lexical context, and this is now the
+ case in interpreted as well as in compiled code.
+ * automated/mule-tests.el (featurep):
+ Silence messages when byte-compiling files; if a file doesn't have
+ the escape-quoted coding cookie, it will now have the
+ raw-text-unix coding cookie, look for that instead of looking for
+ the absence of the escape-quoted coding cookie.
+
2011-10-03 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/case-tests.el (uni-mappings):
diff -r cc8ea7ed4286 -r 391d809fa4e9 tests/automated/lisp-tests.el
--- a/tests/automated/lisp-tests.el Wed Nov 09 12:51:10 2011 +0000
+++ b/tests/automated/lisp-tests.el Wed Nov 09 13:16:19 2011 +0000
@@ -987,7 +987,7 @@
;;-----------------------------------------------------
(Assert (eq (type-of load-path) 'cons))
(Assert (eq (type-of obarray) 'vector))
-(Assert (eq (type-of 42) 'integer))
+(Assert (eq (type-of 42) 'fixnum))
(Assert (eq (type-of ?z) 'character))
(Assert (eq (type-of "42") 'string))
(Assert (eq (type-of 'foo) 'symbol))
@@ -2907,12 +2907,9 @@
third
#'(lambda () (return-from awkward 0)))
first)))))
- (if (compiled-function-p
- (ignore-errors (indirect-function #'needs-lexical-context)))
- (Known-Bug-Expect-Failure
- (Assert (eql 0 (needs-lexical-context 2 nil nil))
- "the function special operator doesn't create a lexical context."))
- (Assert (eql 0 (needs-lexical-context 2 nil nil)))))
+ (Known-Bug-Expect-Failure
+ (Assert (eql 0 (needs-lexical-context 2 nil nil))
+ "the function special operator doesn't create a lexical context.")))
;; Test symbol-macrolet with symbols with identical string names.
diff -r cc8ea7ed4286 -r 391d809fa4e9 tests/automated/mule-tests.el
--- a/tests/automated/mule-tests.el Wed Nov 09 12:51:10 2011 +0000
+++ b/tests/automated/mule-tests.el Wed Nov 09 13:16:19 2011 +0000
@@ -654,25 +654,26 @@
(let* ((temporary-file-name (make-temp-name
(expand-file-name "zjPQ2Pk"
(temp-directory))))
- (byte-compile-result (byte-compile-from-buffer
- (current-buffer) temporary-file-name
- nil)))
+ (byte-compile-result
+ (Silence-Message (byte-compile-from-buffer
+ (current-buffer) temporary-file-name
+ nil))))
(Assert (string-match
"^;;;###coding system: escape-quoted"
(buffer-substring nil nil byte-compile-result))))))
- (Assert-elc-has-no-specified-encoding ()
+ (Assert-elc-is-raw-text-unix ()
"Assert the current buffer has no coding cookie if compiled."
(save-excursion
(let* ((temporary-file-name (make-temp-name
(expand-file-name "zjPQ2Pk"
(temp-directory))))
- (byte-compile-result (byte-compile-from-buffer
- (current-buffer) temporary-file-name
- nil)))
- (Assert (not (string-match
- ";;;###coding system:"
- (buffer-substring nil nil
- byte-compile-result))))))))
+ (byte-compile-result
+ (Silence-Message
+ (byte-compile-from-buffer (current-buffer)
+ temporary-file-name nil))))
+ (Assert (string-match
+ "^;;;###coding system: raw-text-unix"
+ (buffer-substring nil nil byte-compile-result)))))))
(insert
;; Create a buffer with Unicode escapes. The #'read call is at
;; runtime, because this file may be compiled and read in a non-Mule
@@ -730,7 +731,7 @@
#r" (defvar testing-mule-compilation-handling
(string ?\xab)) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK")
- (Assert-elc-has-no-specified-encoding)
+ (Assert-elc-is-raw-text-unix)
(delete-region (point-min) (point-max))
(insert
@@ -738,7 +739,7 @@
#ru" (defvar testing-mule-compilation-handling
(string ?\u00AB)) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK\")")
- (Assert-elc-has-no-specified-encoding)
+ (Assert-elc-is-raw-text-unix)
(delete-region (point-min) (point-max))
(insert
@@ -746,7 +747,7 @@
#r" (defvar testing-mule-compilation-handling
(string ?A)) ;; LATIN CAPITAL LETTER A")
- (Assert-elc-has-no-specified-encoding)
+ (Assert-elc-is-raw-text-unix)
(delete-region (point-min) (point-max))
;; There used to be a bug here because the coding-cookie insertion code
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: kehoea: Update tests that have started failing because of changed design decisions.
12 years, 11 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/391d809fa4e9/
changeset: 391d809fa4e9
user: kehoea
date: 2011-11-09 14:16:19
summary: Update tests that have started failing because of changed design decisions.
2011-11-09 Aidan Kehoe <kehoea(a)parhasard.net>
Update some tests that have started failing because of some
changed design decisions.
* automated/lisp-tests.el (eq):
(type-of 42) now returns the symbol fixnum.
* automated/lisp-tests.el (needs-lexical-context):
(function ...) doesn't create a lexical context, and this is now the
case in interpreted as well as in compiled code.
* automated/mule-tests.el (featurep):
Silence messages when byte-compiling files; if a file doesn't have
the escape-quoted coding cookie, it will now have the
raw-text-unix coding cookie, look for that instead of looking for
the absence of the escape-quoted coding cookie.
affected #: 3 files
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Mention when compiled functions are built-in, help.el.
12 years, 11 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1320843070 0
# Node ID cc8ea7ed4286d0eca21c76c96f9787025d2b8d86
# Parent 4218b56833b3762e4226b0321fca51f4f1422df8
Mention when compiled functions are built-in, help.el.
2011-11-09 Aidan Kehoe <kehoea(a)parhasard.net>
* help.el (describe-function-1):
When printing compiled functions, mention whether they're
built-in.
diff -r 4218b56833b3 -r cc8ea7ed4286 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Nov 02 17:50:39 2011 +0000
+++ b/lisp/ChangeLog Wed Nov 09 12:51:10 2011 +0000
@@ -1,3 +1,9 @@
+2011-11-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * help.el (describe-function-1):
+ When printing compiled functions, mention whether they're
+ built-in.
+
2011-11-02 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-lambda):
diff -r 4218b56833b3 -r cc8ea7ed4286 lisp/help.el
--- a/lisp/help.el Wed Nov 02 17:50:39 2011 +0000
+++ b/lisp/help.el Wed Nov 09 12:51:10 2011 +0000
@@ -1395,33 +1395,37 @@
macrop t)
(setq fndef def))
(if aliases (princ aliases))
- (let ((int #'(lambda (string an-p macro-p)
- (princ (format
- (gettext (concat
- (cond ((commandp def)
- "an interactive ")
- (an-p "an ")
- (t "a "))
- "%s"
- (cond
- ((eq 'neither macro-p)
- "")
- (macro-p " macro")
- (t " function"))))
- string)))))
+ (labels
+ ((int (string an-p macro-p)
+ (princ (format
+ (gettext (concat
+ (cond ((commandp def)
+ "an interactive ")
+ (an-p "an ")
+ (t "a "))
+ "%s"
+ (cond
+ ((eq 'neither macro-p)
+ "")
+ (macro-p " macro")
+ (t " function"))))
+ string))))
+ (declare (inline int))
(cond ((or (stringp def) (vectorp def))
(princ "a keyboard macro.")
(setq kbd-macro-p t))
((special-operator-p fndef)
- (funcall int "built-in special operator" nil 'neither))
+ (int "built-in special operator" nil 'neither))
((subrp fndef)
- (funcall int "built-in" nil macrop))
+ (int "built-in" nil macrop))
((compiled-function-p fndef)
- (funcall int "compiled Lisp" nil macrop))
+ (int (concat (if (built-in-symbol-file function 'defun)
+ "built-in "
+ "") "compiled Lisp") nil macrop))
((eq (car-safe fndef) 'lambda)
- (funcall int "Lisp" nil macrop))
+ (int "Lisp" nil macrop))
((eq (car-safe def) 'autoload)
- (funcall int "autoloaded Lisp" t (elt def 4)))
+ (int "autoloaded Lisp" t (elt def 4)))
((and (symbolp def) (not (fboundp def)))
(princ "a symbol with a void (unbound) function definition."))
(t
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[AC 21.5] Prevent SIGPIPE in deactivate_process
12 years, 11 months
Stephen J. Turnbull
APPROVE COMMIT 21.5
I don't know if this is relevant to 21.4. Should I check, Vin? This
seems to be a very rare crash, up until Uday Reddy and friends found
me a way to produce it frequently. :-)
Reviewers: If you have a clue about Unix processes, please check my
analysis below, especially with respect to the call of
deactivate_process() in execute_internal_event() (event-stream.c).
VM seems to have replaced Gnus as my favorite way to induce XEmacs
crashes.... VM uses Imagemagick's convert program to generate
thumbnails to display with its MIME buttons, and apparently convert
crashes a lot. When this happens, there's a race condition such that
send_process() thinks it has blocked but doesn't know about the crash,
and so calls Faccept_process_output() in hopes of getting the subprocess
unblocked. The SIGCHLD arrives in the interim, status_notify() gets
called inside of Faccept_process_output(), notices the demise of the
child, and calls deactivate_process(), which tries to do a normal close
of all pipes. That calls Lstream_flush(), which writes to the now
nonexistent output pipe, and XEmacs takes the fall because it's not
prepared for a SIGPIPE there.
An analysis of calls of deactivate_process() indicates that it only gets
called when we know the process has already exited, so it makes no
sense to flush the output pipe. This patch removes the flush from the
function closing the output pipe (only).
I would like to do the signal(2) dance in the relevant Lstream
implementation (filedesc), but it doesn't know about pipes and
processes, only about FDs. Is it worth creating a pipe-specific
variant of the filedesc Lstream?
I will revert this patch on request. I don't really have an idea of
what bad things could happen if we fail to flush to a live process
that is about to be terminated, but if somebody thinks that's a risk,
I have an alternative patch which reduces the current risk but does
not eliminate it. (Specifically, with the alternative patch, the race
condition still exists in Faccept_process_output(), which is a Lisp
function so we have no idea when it might be called.)
diff -r 3fde0e346ad7 -r 2dbefd79b3d3 src/ChangeLog
--- a/src/ChangeLog Sat Oct 29 00:35:33 2011 +0900
+++ b/src/ChangeLog Sat Oct 29 01:10:32 2011 +0900
@@ -1,3 +1,16 @@
+2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Prevent SIGPIPEs in deactivate_process().
+
+ * process.c (deactivate_process):
+ Use Lstream_close_noflush on output pipe instead of Lstream_close.
+
+ * lstream.c (Lstream_close_noflush):
+ New. Factored out of Lstream_close.
+ (Lstream_close): Use Lstream_close_noflush.
+
+ * lstream.h (Lstream_close_noflush): Declare it.
+
2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
Prevent assert at frame.c, l. 6311 by initializing glyph cachels.
diff -r 3fde0e346ad7 -r 2dbefd79b3d3 src/lstream.c
--- a/src/lstream.c Sat Oct 29 00:35:33 2011 +0900
+++ b/src/lstream.c Sat Oct 29 01:10:32 2011 +0900
@@ -791,6 +791,45 @@
return Lstream_flush (lstr);
}
+/* Close the stream without flushing buffers.
+ In current practice, this is only useful when a subprocess terminates
+ unexpectedly, and the OS closes its pipes without warning. In that case,
+ we do not want to flush our output buffers, as there is no longer a pipe
+ to write to.
+ This nomenclature may deserve review if XEmacs starts getting called as
+ a subprocess. */
+
+int
+Lstream_close_noflush (Lstream *lstr)
+{
+ lstr->flags &= ~LSTREAM_FL_IS_OPEN;
+ lstr->byte_count = 0;
+ /* Note that Lstream_flush() reset all the buffer indices. That way,
+ the next call to Lstream_putc(), Lstream_getc(), or Lstream_ungetc()
+ on a closed stream will call into the function equivalents, which will
+ cause an error. */
+
+ /* We set the pointers to 0 so that we don't lose when this function
+ is called more than once on the same object */
+ if (lstr->out_buffer)
+ {
+ xfree (lstr->out_buffer);
+ lstr->out_buffer = 0;
+ }
+ if (lstr->in_buffer)
+ {
+ xfree (lstr->in_buffer);
+ lstr->in_buffer = 0;
+ }
+ if (lstr->unget_buffer)
+ {
+ xfree (lstr->unget_buffer);
+ lstr->unget_buffer = 0;
+ }
+
+ return 0;
+}
+
/* Close the stream. All data will be flushed out. If the stream is
already closed, nothing happens. Note that, even if all data has
already been flushed out, the act of closing a stream may generate more
@@ -838,30 +877,7 @@
rc = -1;
}
- lstr->flags &= ~LSTREAM_FL_IS_OPEN;
- lstr->byte_count = 0;
- /* Note that Lstream_flush() reset all the buffer indices. That way,
- the next call to Lstream_putc(), Lstream_getc(), or Lstream_ungetc()
- on a closed stream will call into the function equivalents, which will
- cause an error. */
-
- /* We set the pointers to 0 so that we don't lose when this function
- is called more than once on the same object */
- if (lstr->out_buffer)
- {
- xfree (lstr->out_buffer);
- lstr->out_buffer = 0;
- }
- if (lstr->in_buffer)
- {
- xfree (lstr->in_buffer);
- lstr->in_buffer = 0;
- }
- if (lstr->unget_buffer)
- {
- xfree (lstr->unget_buffer);
- lstr->unget_buffer = 0;
- }
+ Lstream_close_noflush (lstr);
return rc;
}
diff -r 3fde0e346ad7 -r 2dbefd79b3d3 src/lstream.h
--- a/src/lstream.h Sat Oct 29 00:35:33 2011 +0900
+++ b/src/lstream.h Sat Oct 29 01:10:32 2011 +0900
@@ -306,6 +306,7 @@
int Lstream_rewind (Lstream *lstr);
int Lstream_seekable_p (Lstream *lstr);
int Lstream_close (Lstream *lstr);
+int Lstream_close_noflush (Lstream *lstr);
void Lstream_delete (Lstream *lstr);
void Lstream_set_character_mode (Lstream *str);
diff -r 3fde0e346ad7 -r 2dbefd79b3d3 src/process.c
--- a/src/process.c Sat Oct 29 00:35:33 2011 +0900
+++ b/src/process.c Sat Oct 29 01:10:32 2011 +0900
@@ -2150,8 +2150,20 @@
/* Must call this before setting the streams to nil */
event_stream_unselect_process (p, 1, 1);
+ /* We can get here in case of a crash in the external process, and then
+ the Lstream_close on output will cause a SIGPIPE, which we're not ready
+ for here. It looks to me like all cases where this function is called
+ we know the process has exited (but I'm not 100% sure for the call in
+ execute_internal_event (event-stream.c)), so it should be OK to use
+ Lstream_close_noflush.
+
+ #### The layering here needs a rethink. We should just be able
+ to call Lstream_close, and let the Lstream's implementation decide
+ if it can flush safely or not. The immediate problem is that the
+ Lstream needs to know the process's status, but I don't think it has
+ a handle to the process. */
if (!NILP (DATA_OUTSTREAM (p)))
- Lstream_close (XLSTREAM (DATA_OUTSTREAM (p)));
+ Lstream_close_noflush (XLSTREAM (DATA_OUTSTREAM (p)));
if (!NILP (DATA_INSTREAM (p)))
Lstream_close (XLSTREAM (DATA_INSTREAM (p)));
if (!NILP (DATA_ERRSTREAM (p)))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Give the label name when warning or erroring, bytecomp.el
12 years, 11 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1320256239 0
# Node ID 4218b56833b3762e4226b0321fca51f4f1422df8
# Parent 2dbefd79b3d3713ac08021ff1a8ce6efd034d607
Give the label name when warning or erroring, bytecomp.el
2011-11-02 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-lambda):
Accept a new NAME argument here, have byte-compile-current-form
reflect that if it's specified.
* bytecomp.el (byte-compile-initial-macro-environment):
Specify the label name when byte-compiling it, so warning and
errors are more helpful.
diff -r 2dbefd79b3d3 -r 4218b56833b3 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Oct 29 01:10:32 2011 +0900
+++ b/lisp/ChangeLog Wed Nov 02 17:50:39 2011 +0000
@@ -1,3 +1,12 @@
+2011-11-02 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * bytecomp.el (byte-compile-lambda):
+ Accept a new NAME argument here, have byte-compile-current-form
+ reflect that if it's specified.
+ * bytecomp.el (byte-compile-initial-macro-environment):
+ Specify the label name when byte-compiling it, so warning and
+ errors are more helpful.
+
2011-10-17 Aidan Kehoe <kehoea(a)parhasard.net>
* startup.el (load-terminal-library):
diff -r 2dbefd79b3d3 -r 4218b56833b3 lisp/bytecomp.el
--- a/lisp/bytecomp.el Sat Oct 29 01:10:32 2011 +0900
+++ b/lisp/bytecomp.el Wed Nov 02 17:50:39 2011 +0000
@@ -563,24 +563,25 @@
'byte-optimizer)
'byte-compile-inline-expand)
`(((function ,placeholder)
- ,(byte-compile-lambda lambda)
+ ,(byte-compile-lambda lambda name)
(function ,lambda)))))
names placeholders lambdas))
(compiled
- (mapcar #'byte-compile-lambda
- (if (not inline)
- lambdas
- ;; See further down for the
+ (mapcar* #'byte-compile-lambda
+ (if (not inline)
+ lambdas
+ ;; See further down for the
;; rationale of the sublis calls.
- (sublis (pairlis
- (mapcar #'cadar inline)
- (mapcar #'third inline))
- (sublis
- (pairlis
- (mapcar #'car inline)
- (mapcar #'second inline))
- lambdas :test #'equal)
-:test #'eq))))
+ (sublis (pairlis
+ (mapcar #'cadar inline)
+ (mapcar #'third inline))
+ (sublis
+ (pairlis
+ (mapcar #'car inline)
+ (mapcar #'second inline))
+ lambdas :test #'equal)
+:test #'eq))
+ names))
elt)
(mapc #'(lambda (placeholder function)
(nsubst function placeholder compiled
@@ -2736,10 +2737,11 @@
;; Byte-compile a lambda-expression and return a valid function.
;; The value is usually a compiled function but may be the original
;; lambda-expression.
-(defun byte-compile-lambda (fun)
+(defun byte-compile-lambda (fun &optional name)
(or (eq 'lambda (car-safe fun))
(error "not a lambda -- %s" (prin1-to-string fun)))
- (let* ((arglist (nth 1 fun))
+ (let* ((byte-compile-current-form (or name byte-compile-current-form))
+ (arglist (nth 1 fun))
(byte-compile-bound-variables
(let ((new-bindings
(mapcar #'(lambda (x) (cons x byte-compile-arglist-bit))
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches