From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#22765: Missing interfaces for syntax of characters in buffers. Date: Mon, 22 Feb 2016 11:12:12 +0000 Message-ID: <20160222111212.GC1984@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1456139478 32255 80.91.229.3 (22 Feb 2016 11:11:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Feb 2016 11:11:18 +0000 (UTC) To: 22765@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 22 12:11:05 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aXoOO-0005le-65 for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Feb 2016 12:11:04 +0100 Original-Received: from localhost ([::1]:48495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXoOK-0007cF-58 for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Feb 2016 06:11:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXoNS-0006kj-ED for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2016 06:10:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXoNO-0000nk-BX for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2016 06:10:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXoNO-0000ng-8m for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2016 06:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aXoNO-0001zh-5f for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2016 06:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Feb 2016 11:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22765 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14561394007651 (code B ref -1); Mon, 22 Feb 2016 11:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Feb 2016 11:10:00 +0000 Original-Received: from localhost ([127.0.0.1]:36863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXoNL-0001zL-Q0 for submit@debbugs.gnu.org; Mon, 22 Feb 2016 06:09:59 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34030) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXoNL-0001z8-5d for submit@debbugs.gnu.org; Mon, 22 Feb 2016 06:09:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXoNF-0000lx-1n for submit@debbugs.gnu.org; Mon, 22 Feb 2016 06:09:53 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXoNE-0000lr-VJ for submit@debbugs.gnu.org; Mon, 22 Feb 2016 06:09:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXoNE-0006bH-2R for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2016 06:09:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXoN9-0000jS-3n for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2016 06:09:52 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:52206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXoN8-0000gc-QF for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2016 06:09:47 -0500 Original-Received: (qmail 19983 invoked by uid 3782); 22 Feb 2016 11:09:45 -0000 Original-Received: from acm.muc.de (p548A53D7.dip0.t-ipconnect.de [84.138.83.215]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 22 Feb 2016 12:09:44 +0100 Original-Received: (qmail 2750 invoked by uid 1000); 22 Feb 2016 11:12:12 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113448 Archived-At: Hello, Emacs. In all versions of Emacs to date, we are missing an interface to return the syntax of a character in a buffer in a "nice" form. By a "nice" form, I mean the characters ?\ , ?., ?w, ?\(, ?\), etc., which programs should be able to use. We have `char-syntax', but that takes no account of syntax-table text properties which might be on a buffer position, and so shouldn't really be used any more in buffers. There are still around 160 uses of `char-syntax' in our sources. We have `syntax-after', but this returns a raw syntax descriptor (like (4 . 41)), and we have no means of extracting ?\( from this. I propose adding the two functions `syntax-class-to-char' which would convert 4 to ?\(, and `char-syntax-after', which would return ?\( directly, given a buffer position with such a character under it. This would greatly aid in the conversion of these old `char-syntax' calls. -- Alan Mackenzie (Nuremberg, Germany).