From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Unused/obsolete `last-code-conversion-error'? Date: Wed, 27 Aug 2014 17:09:03 +0400 Message-ID: <53FDD86F.9060807@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000001040709030006060301" X-Trace: ger.gmane.org 1409144974 27091 80.91.229.3 (27 Aug 2014 13:09:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Aug 2014 13:09:34 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 27 15:09:27 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XMcyc-00020K-LV for ged-emacs-devel@m.gmane.org; Wed, 27 Aug 2014 15:09:27 +0200 Original-Received: from localhost ([::1]:59469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMcyb-0002GT-So for ged-emacs-devel@m.gmane.org; Wed, 27 Aug 2014 09:09:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMcyQ-0002Dc-TI for emacs-devel@gnu.org; Wed, 27 Aug 2014 09:09:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMcyJ-0006dJ-Gw for emacs-devel@gnu.org; Wed, 27 Aug 2014 09:09:14 -0400 Original-Received: from forward7l.mail.yandex.net ([84.201.143.140]:36617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMcyJ-0006dC-5P for emacs-devel@gnu.org; Wed, 27 Aug 2014 09:09:07 -0400 Original-Received: from smtp12.mail.yandex.net (smtp12.mail.yandex.net [95.108.131.191]) by forward7l.mail.yandex.net (Yandex) with ESMTP id 8CEB9BC0CDC for ; Wed, 27 Aug 2014 17:09:04 +0400 (MSK) Original-Received: from smtp12.mail.yandex.net (localhost [127.0.0.1]) by smtp12.mail.yandex.net (Yandex) with ESMTP id 3FB9116A00D3 for ; Wed, 27 Aug 2014 17:09:04 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp12.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 9cC0wS4ZH1-93wuflaw; Wed, 27 Aug 2014 17:09:03 +0400 (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: 797292b7-611d-4f9a-8044-ea2619d9ec9f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1409144943; bh=vV+VNATFNxO6uJkQnQrsVD+NBD0EWtUzyOBt0yA+J40=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type; b=q72g2a6MkeiMSUHV9yfj/x/WGJGQx3EudEnXmY0Ojbw5kdlgFAgy4DDl8id1uxKUP cb4mWxz3V0b8aR44liW7xu+7BFEuEkNTGMG5BXba/7LQbgIP/Vva7Yzl70Hv0POPS/ VxYiFWN7KDMb90jLi95r5H4t7xyAWydCbp40gJFU= Authentication-Results: smtp12.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 84.201.143.140 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173843 Archived-At: This is a multi-part message in MIME format. --------------000001040709030006060301 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit AFAICS `last-code-conversion-error' is untouched and unused since 2009 (probably it was never really used), and maintaining it just adds some overhead to important coding.c routines. OK to install something like this? Dmitry --------------000001040709030006060301 Content-Type: text/x-patch; name="last_code_conversion_error.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="last_code_conversion_error.patch" === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2014-01-01 07:43:34 +0000 +++ lisp/international/mule.el 2014-08-27 13:01:10 +0000 @@ -955,6 +955,10 @@ "It exists just for backward compatibility, and the value is always nil.") (make-obsolete-variable 'char-coding-system-table nil "23.1") +(defconst last-code-conversion-error nil + "It exists just for backward compatibility, and the value is always nil.") +(make-obsolete-variable 'last-code-conversion-error nil "24.4") + (defun transform-make-coding-system-args (name type &optional doc-string props) "For internal use only. Transform XEmacs style args for `make-coding-system' to Emacs style. === modified file 'src/coding.c' --- src/coding.c 2014-08-11 00:59:34 +0000 +++ src/coding.c 2014-08-27 12:58:32 +0000 @@ -326,8 +326,6 @@ Lisp_Object Qstart_process, Qopen_network_stream; static Lisp_Object Qtarget_idx; -static Lisp_Object Qinsufficient_source, Qinvalid_source, Qinterrupted; - /* If a symbol has this property, evaluate the value to define the symbol as a coding system. */ static Lisp_Object Qcoding_system_define_form; @@ -704,8 +702,8 @@ if (src == src_end) \ { \ if (src_base < src) \ - record_conversion_result \ - (coding, CODING_RESULT_INSUFFICIENT_SRC); \ + coding->result \ + = CODING_RESULT_INSUFFICIENT_SRC; \ goto no_more_source; \ } \ c = *src++; \ @@ -717,8 +715,8 @@ { \ src--; \ c = - string_char (src, &src, NULL); \ - record_conversion_result \ - (coding, CODING_RESULT_INVALID_SRC); \ + coding->result \ + = CODING_RESULT_INVALID_SRC; \ } \ } \ consumed_chars++; \ @@ -847,35 +845,6 @@ EMIT_TWO_BYTES (c3, c4); \ } while (0) - -static void -record_conversion_result (struct coding_system *coding, - enum coding_result_code result) -{ - coding->result = result; - switch (result) - { - case CODING_RESULT_INSUFFICIENT_SRC: - Vlast_code_conversion_error = Qinsufficient_source; - break; - case CODING_RESULT_INVALID_SRC: - Vlast_code_conversion_error = Qinvalid_source; - break; - case CODING_RESULT_INTERRUPT: - Vlast_code_conversion_error = Qinterrupted; - break; - case CODING_RESULT_INSUFFICIENT_DST: - /* Don't record this error in Vlast_code_conversion_error - because it happens just temporarily and is resolved when the - whole conversion is finished. */ - break; - case CODING_RESULT_SUCCESS: - break; - default: - Vlast_code_conversion_error = intern ("Unknown error"); - } -} - /* These wrapper macros are used to preserve validity of pointers into buffer text across calls to decode_char, encode_char, etc, which could cause relocation of buffers if it loads a charset map, @@ -1551,7 +1520,7 @@ } produced_chars = dst - (coding->destination + coding->produced); } - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; coding->produced_char += produced_chars; coding->produced = dst - coding->destination; return 0; @@ -1825,7 +1794,7 @@ EMIT_FOUR_BYTES (c1 & 0xFF, c1 >> 8, c2 & 0xFF, c2 >> 8); } } - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; coding->produced = dst - coding->destination; coding->produced_char += produced_chars; return 0; @@ -2739,7 +2708,7 @@ } } } - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; coding->produced_char += produced_chars; coding->produced = dst - coding->destination; return 0; @@ -4576,7 +4545,7 @@ ASSURE_DESTINATION (safe_room); ENCODE_RESET_PLANE_AND_REGISTER (); } - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; CODING_ISO_BOL (coding) = bol_designation; coding->produced_char += produced_chars; coding->produced = dst - coding->destination; @@ -5032,7 +5001,7 @@ EMIT_ONE_ASCII_BYTE (code & 0x7F); } } - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; coding->produced_char += produced_chars; coding->produced = dst - coding->destination; return 0; @@ -5104,7 +5073,7 @@ EMIT_ONE_ASCII_BYTE (code & 0x7F); } } - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; coding->produced_char += produced_chars; coding->produced = dst - coding->destination; return 0; @@ -5218,17 +5187,17 @@ switch (ccl->status) { case CCL_STAT_SUSPEND_BY_SRC: - record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_SRC); + coding->result = CODING_RESULT_INSUFFICIENT_SRC; break; case CCL_STAT_SUSPEND_BY_DST: - record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_DST); + coding->result = CODING_RESULT_INSUFFICIENT_DST; break; case CCL_STAT_QUIT: case CCL_STAT_INVALID_CMD: - record_conversion_result (coding, CODING_RESULT_INTERRUPT); + coding->result = CODING_RESULT_INTERRUPT; break; default: - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; break; } coding->consumed_char += consumed_chars; @@ -5289,17 +5258,17 @@ switch (ccl->status) { case CCL_STAT_SUSPEND_BY_SRC: - record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_SRC); + coding->result = CODING_RESULT_INSUFFICIENT_SRC; break; case CCL_STAT_SUSPEND_BY_DST: - record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_DST); + coding->result = CODING_RESULT_INSUFFICIENT_DST; break; case CCL_STAT_QUIT: case CCL_STAT_INVALID_CMD: - record_conversion_result (coding, CODING_RESULT_INTERRUPT); + coding->result = CODING_RESULT_INTERRUPT; break; default: - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; break; } @@ -5326,10 +5295,10 @@ { coding->consumed_char--; coding->consumed--; - record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_SRC); + coding->result = CODING_RESULT_INSUFFICIENT_SRC; } else - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; } static bool @@ -5406,7 +5375,7 @@ } produced_chars = dst - (coding->destination + coding->produced); } - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; coding->produced_char += produced_chars; coding->produced = dst - coding->destination; return 0; @@ -5704,7 +5673,7 @@ } } - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; coding->produced_char += produced_chars; coding->produced = dst - coding->destination; return 0; @@ -7366,7 +7335,7 @@ coding->consumed = coding->consumed_char = 0; coding->produced = coding->produced_char = 0; coding->chars_at_source = 0; - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; ALLOC_CONVERSION_WORK_AREA (coding, coding->src_bytes); @@ -7761,7 +7730,7 @@ coding->consumed = coding->consumed_char = 0; coding->produced = coding->produced_char = 0; - record_conversion_result (coding, CODING_RESULT_SUCCESS); + coding->result = CODING_RESULT_SUCCESS; ALLOC_CONVERSION_WORK_AREA (coding, coding->src_chars); @@ -10944,9 +10913,6 @@ ASET (Vcoding_category_table, coding_category_undecided, intern_c_string ("coding-category-undecided")); - DEFSYM (Qinsufficient_source, "insufficient-source"); - DEFSYM (Qinvalid_source, "invalid-source"); - DEFSYM (Qinterrupted, "interrupted"); DEFSYM (Qcoding_system_define_form, "coding-system-define-form"); defsubr (&Scoding_system_p); @@ -11047,23 +11013,6 @@ Coding system used in the latest file or process I/O. */); Vlast_coding_system_used = Qnil; - DEFVAR_LISP ("last-code-conversion-error", Vlast_code_conversion_error, - doc: /* -Error status of the last code conversion. - -When an error was detected in the last code conversion, this variable -is set to one of the following symbols. - `insufficient-source' - `inconsistent-eol' - `invalid-source' - `interrupted' - `insufficient-memory' -When no error was detected, the value doesn't change. So, to check -the error status of a code conversion by this variable, you must -explicitly set this variable to nil before performing code -conversion. */); - Vlast_code_conversion_error = Qnil; - DEFVAR_BOOL ("inhibit-eol-conversion", inhibit_eol_conversion, doc: /* *Non-nil means always inhibit code conversion of end-of-line format. --------------000001040709030006060301--