From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#22765: Missing interfaces for syntax of characters in buffers. Date: Wed, 05 Apr 2017 20:43:44 -0400 Message-ID: <87wpayuzzz.fsf@users.sourceforge.net> References: <20160222111212.GC1984@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1491439399 21120 195.159.176.226 (6 Apr 2017 00:43:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Apr 2017 00:43:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 22765@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 06 02:43:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvvVx-0003y7-W4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Apr 2017 02:43:06 +0200 Original-Received: from localhost ([::1]:42972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvvW3-0003qY-Or for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Apr 2017 20:43:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvvVy-0003qF-2K for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 20:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvvVu-0001tU-4p for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 20:43:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cvvVt-0001tN-WD for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 20:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cvvVt-0001Cc-Mk for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 20:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2017 00:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22765 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22765-submit@debbugs.gnu.org id=B22765.14914393484579 (code B ref 22765); Thu, 06 Apr 2017 00:43:01 +0000 Original-Received: (at 22765) by debbugs.gnu.org; 6 Apr 2017 00:42:28 +0000 Original-Received: from localhost ([127.0.0.1]:34208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvvVM-0001Bn-9P for submit@debbugs.gnu.org; Wed, 05 Apr 2017 20:42:28 -0400 Original-Received: from mail-it0-f51.google.com ([209.85.214.51]:36293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvvVK-0001BQ-AW for 22765@debbugs.gnu.org; Wed, 05 Apr 2017 20:42:27 -0400 Original-Received: by mail-it0-f51.google.com with SMTP id e75so92846797itd.1 for <22765@debbugs.gnu.org>; Wed, 05 Apr 2017 17:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=yNY0nNnSKb7kh+hE6v98XQi227evdo8tVQf+ib75zk0=; b=e/yI7oeCSICB5Pl+BE+eugb3xEx0M8Fn6BaZ2SI0bJm29n3bXCbN4IeDNEytKcClDK KBtC1601yA8OJpxM70ULE8PTbQSlZVpd0tGKCAoYjz37rRtSn0Z1thMJWDeNawUS2TeC Tjw53alAz9YbpUhZPebP5dVuK8m4faokyJvuu07J3GuFh0M72oa9qr+LQvgvEu89bLGD ndycIXFWX0N6lK9pbzq5AHbQvn5/xT4CqDESPxoQxsnweZL3dWTqpdFio5ECROtANdAk C6pHUKiOEpwvzoYP6hDlK/i+/eQnG0a59j1QjkjCeQLm00JW67z5oMFOrOW2cxp7rqTQ v2lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=yNY0nNnSKb7kh+hE6v98XQi227evdo8tVQf+ib75zk0=; b=BMQkYfKFzN+dzBbGYPMtfY82jEjXChMCWMdrN5ctgTWGB40bLditWhlJswibOeLgsu yFrCI3DhG4Lo/N4g8Sho9it6gSHHUG1qFMf+z2dCmwR01QFl3X7fBJb8LlBE+grj/OEs WBDP9C8XeP/nmeRtOEXuXTsO+N36rUSWjdb7FXiqKPMLQzngOmRVBjQjPbzdTJ8qiZt4 eLeGj2CT+Zu6PrUYi5tw4srtKwl4uNi4WpyRH0GW7vGsJ5i3+L4QimzOb6zXPiFfXkdO xii+6mM4rYIYLGM+Bsr8lx41TgRQlu+Cz8UfarcgCEPTe/7r1dCGoAyw11ABbdF7ymUy rdug== X-Gm-Message-State: AFeK/H2v8FfbdbfL2Bn0C5UpsWQQ/k4eRs/WrKIhwYPfOUvPo363dtWo omlr8rfn61TbfQ== X-Received: by 10.36.40.81 with SMTP id h78mr23868453ith.44.1491439340608; Wed, 05 Apr 2017 17:42:20 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id s194sm153176ita.12.2017.04.05.17.42.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Apr 2017 17:42:20 -0700 (PDT) In-Reply-To: <20160222111212.GC1984@acm.fritz.box> (Alan Mackenzie's message of "Mon, 22 Feb 2016 11:12:12 +0000") 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" Xref: news.gmane.org gmane.emacs.bugs:131302 Archived-At: Alan Mackenzie writes: > 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. I'm afraid I added another one in my recent `indent-sexp' changes. We should at least add a warning about this to the docstring. > 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. We do have string-to-syntax which can be used to convert in the other direction, although code using it would end up a bit more verbose. (eq (char-syntax-after POS) ?\() vs (eq (syntax-class (syntax-after POS)) (car (string-to-syntax "(")))