From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Lambert, Joshua D" Newsgroups: gmane.emacs.help Subject: Re: Multiple encodings in one file Date: Tue, 30 Apr 2024 17:17:37 +0000 Message-ID: References: <86plu8skew.fsf@gnu.org> <86jzkgq8v0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16768"; mail-complaints-to="usenet@ciao.gmane.io" To: "help-gnu-emacs@gnu.org" , Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 30 19:23:41 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s1rCe-000482-5g for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 30 Apr 2024 19:23:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1rBq-0007SL-DJ; Tue, 30 Apr 2024 13:22:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1rBp-0007S4-1d for help-gnu-emacs@gnu.org; Tue, 30 Apr 2024 13:22:49 -0400 Original-Received: from mail-mw2nam12on20700.outbound.protection.outlook.com ([2a01:111:f403:200a::700] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1rBk-00055h-Il for help-gnu-emacs@gnu.org; Tue, 30 Apr 2024 13:22:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EN2MkXq3kizGap0hA1XH/+2astD/Za9tXOHbgvJISc76J9FXEbVd+OtUJnFWQzdqbc/cOxvmFcRqWKpVwd8ijEdUWwqCqmk9XOq+p9YjzQr/duFOeNrg5uKKLYXpLgIn+RRBFdHvFuJtByisaBxliZ1XNrKDc6QS8fY/4QnvGrhR1e2eK0CbNAzMEEWlX5J2BdhCgRWQIcURggsvrC3Z0cl4xrXahutbqE6eJ863OtEIcmn26DI5MY09wFt3T6+gXe0rJ2NU8rEwgA9a7GIPO6f4HZQkLeRO/Hm88atR7eZSUPwMXR8tvlfwlPzZ6mrv78A07ngQ3xTQzyHwy6xo7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NyanT0GLk3eGoXS9FUy0/DVQ+EWQt6lhxiJ4d7qpolY=; b=IED238aPB/2RaFNYtF47I5wq9SVhamiIZ8esnmBix8iy2GQEoV8Wv0oGoJK06EcoPrQiBD/END4UvlV0RlxP1NDe8oCMSv7o025yuXM3SWYWZmEyVWpHYkzv28xQY6Hsz4AndGU+NXWNsaJvPmDmTFWi/JGBw30tcQAtNRgST6CevdjxV3OdXzg/zvrAlp1mjMbLbmRG8y1RsSztBfVyFHkMMZ1jFwhwfkpfxZizUWzByYxxEn/oA+6Ir/stxlMOw3gbeXtwbNGNLhqSsv9LkJeMDYPvkeArzk70e7AL+dMxOr41FviHrPoX2481CummEYYOsScpVdRZvMAX5FmHoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=missouristate.edu; dmarc=pass action=none header.from=missouristate.edu; dkim=pass header.d=missouristate.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=missouristate.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NyanT0GLk3eGoXS9FUy0/DVQ+EWQt6lhxiJ4d7qpolY=; b=ULg3HCqGTkTMb3Nj28mZBdPF3MlhkX4LBlueX4YNEhTwhjkbhLtftBXdbWpvPi7xEqH+bLzEJM3q78tTxJAMJLGkTJ62G/Kb7aaI1O9s/J/KPaAHTgc4xw9xeQtJpTdZ4yyBBDGTi/u2M2K5ynxpGbP43vT3PWij9/gqicFP6A4= Original-Received: from SA1PR01MB6605.prod.exchangelabs.com (2603:10b6:806:1a3::14) by CO1PR01MB6693.prod.exchangelabs.com (2603:10b6:303:f3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 17:17:37 +0000 Original-Received: from SA1PR01MB6605.prod.exchangelabs.com ([fe80::2838:745c:ccc0:edca]) by SA1PR01MB6605.prod.exchangelabs.com ([fe80::2838:745c:ccc0:edca%3]) with mapi id 15.20.7544.023; Tue, 30 Apr 2024 17:17:37 +0000 Thread-Topic: Multiple encodings in one file Thread-Index: AQHameY4mKSP1S4V+0CQey1THwfYt7F+2GEggAC3l4GAAA9mH4AAcdJqgAD3C20= In-Reply-To: Accept-Language: en-US Content-Language: en-US authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=MissouriState.edu; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR01MB6605:EE_|CO1PR01MB6693:EE_ x-ms-office365-filtering-correlation-id: c9f29bf3-824e-4c9a-96bb-08dc69396f18 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|366007|1800799015|376005|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?EcNbHb4B4PZGLQhryOJYqAvaI6ZtoYLWQAUjEXNBRQfehjl7QfSf6OMOHDMZ?= =?us-ascii?Q?DIxmJvDLFogQe4g/ZsaxQ85B4qwqbVfn1fC6G7jzgsx4cq9oTq3MbifdpYha?= =?us-ascii?Q?iGWm1jMstMVI8AGxFtp1WrF7bHhULg9Sn0TnxTR4cJoxv4M5gtNIHfRXeZ8w?= =?us-ascii?Q?t7mIF9Eog7VJkQg0u6YWNLMdIxxUWx0nK8br4gxUpA3raLB8Amnry9plZQ2q?= =?us-ascii?Q?WmpGLHyqPxC8OUvyBR/U4tPXZodfTJGiJIphcQHEV948HPnIq7dj210rSeI1?= =?us-ascii?Q?ieFA2KriDAY9RMpi6ZuFSxlJatHHYdH3NZhn6Z/H+MNqc5nqJ6zx7JLoJl0E?= =?us-ascii?Q?0WJ9uK+JT8QglibDt+iozOl/IV55DWdtgGmnGQar+xRHYDwyd3oj6fSqxX6/?= =?us-ascii?Q?UgFgN008tXbhcyOueilz46mOsQxgyszVqORXF8W3aYrPWmRw4uM4CDoswrg0?= =?us-ascii?Q?abseL4QFqX2c7PlizxVNH5lnbNFnJd3g2DdjQP61/GZInyNN4BLU6EpNE/dE?= =?us-ascii?Q?Zi58LW/CbRaAyvEOLKqf4ImVTeZeBGzEvp7FLKg5Z/Wwek1hZPN0HMPDwU8z?= =?us-ascii?Q?uORYJvqKYeanhOy0p4Q9uSVB1aOQq8cc917DUyLIvywl9VHmVZG/OrZXR7yr?= =?us-ascii?Q?peaE5 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR01MB6605.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gVmd2i0Cj3uAeL0mLWW7T1mACBB/MJkPSDQGAJLFgg5f4j7Z0Pewc8XvlFbh?= =?us-ascii?Q?SVIpvj80WLR8RDrMfeJbnEmXRYC0KCwzheqVsiEq4gXRsC0yTsKXmW9FznAS?= =?us-ascii?Q?PD4o2keCG2aA7m55HhxqaPWjF7YjH+rCe/GitlVo6X2XQ+AZaXSBqbKxdbG3?= =?us-ascii?Q?myMxYqibFS1g1NpXG7MC3yv0/k9OvnbzJqp51bX/KoPeMKbdcRyBrdJ+Bm4G?= =?us-ascii?Q?WZYPMyxUzlhp1mKQ16AVlaLqjLTXRRgSdUPiBVpjLdID0u/c/g06Kf3UkZMk?= =?us-ascii?Q?SyYlbPy2t+qcWOkQ/hA1JRUQWJhWbR/cnYHjIofz2OP/gNvhnUYK5L2BdGG+?= =?us-ascii?Q?tqSANMjF8mk4X0YBchgkWfiJ5wYAV+ownuEWxNdjD4DM5Pfn4mWrjBD/uVU5?= =?us-ascii?Q?jKREfGygxa9bPjOwURvZZOIP9O+mhx6VIQGjyiHhczLwPp1oCku2NABJ+BYB?= =?us-ascii?Q?NiYIvEvcnaMcM2UXFU+cTxVaA/aaMapk1u7QtHuQ81TTnkMfwA3bTh6rTYJJ?= =?us-ascii?Q?u0heav3W/cG1KWVyyEcuJiKYCmTTwNjQH3iWH+pwSBD4UuVRXXdO6igIdxv0?= =?us-ascii?Q?8OG+yAne2DIvdv4lfuWv2hK52AV6p2+od5nkHs7lsR5H7ewogvRw2Atk5mK9?= =?us-ascii?Q?bN X-OriginatorOrg: missouristate.edu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR01MB6605.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9f29bf3-824e-4c9a-96bb-08dc69396f18 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2024 17:17:37.7132 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: cad830e4-554f-4361-bae5-c865233fb77f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KdcVT1ij141hj0st2G1cW0q2CnzbUhaWYNQM1qpcfzT+cYISVEUEUvuSTztIEZh9l+YZRfwtwU2H7MLkAO10MX2C6iuSmklxoS/e0rY/MIo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR01MB6693 Received-SPF: pass client-ip=2a01:111:f403:200a::700; envelope-from=JLambert@MissouriState.edu; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146516 Archived-At: Thank you. Your suggestion of editing one record at a time is how most MARC= editors work and that was my first thought as well. It will require record= by record redisplay of some sort to make it human readable to begin with. = That said, I'm thinking of multiple interfaces depending on the user's goal= . MARC is a file transmission format from 1968 (which in part explains the od= d encoding) and can include any number of records. It has no line breaks or= carriage returns but Emacs' longlines-break-chars seems to work well enoug= h that I can edit files with 10,000 typical sized records, including some f= ontification. Thanks to you and all who contribute to Emacs. Joshua ________________________________ From: help-gnu-emacs-bounces+jlambert=3Dmissouristate.edu@gnu.org on behalf of Stefan Mo= nnier via Users list for the GNU Emacs text editor Sent: Monday, April 29, 2024 9:02 PM To: help-gnu-emacs@gnu.org Subject: Re: Multiple encodings in one file CAUTION: External Sender >> Thank you for the time. What you said gives me some hope but I have >> a follow-up question. If I visit a file literally, make a change, and >> save it, the file seems to be different only where I changed it. Is >> that true? > > If you save it while binding coding-system-to-write to no-conversion, > yes. IOW, you need to disable encoding while saving. Also, if you open the file as a if it was all utf-8, then the utf-8 parts of the file should look just fine (and the MARC-8 parts may look screwy) and if you edit it and save the result it *should* result in a valid file where only the part your changed was modified. >> If so, then does the following seem reasonable. >> >> 1 Find a file literally. >> 2 The user will accept that some characters will show octal codes or >> something similar. >> 3 Edit the records where understandable and possible. >> 4 Save file. For a quick&dirty solution that should work as long as you're doing limited changes and only in parts that are mostly ASCII. If you're designing a major mode, maybe a better approach would look like: read the file literally (i.e. as bytes) and treat it as a kind of directory or archive (think tar-mode, dired, archive-mode, Rmail) so only show a summary of the contents, then let the users "open" a record which is then extracted (and decoded) into another buffer. Stefan This message originated outside Missouri State University. Please use cauti= on when opening attachments, clicking links, or replying.