From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UFpgJ8PAo2EArQAAgWs5BA (envelope-from ) for ; Sun, 28 Nov 2021 18:47:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GPj+IsPAo2FZJAAA1q6Kng (envelope-from ) for ; Sun, 28 Nov 2021 17:47:47 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3DD6928998 for ; Sun, 28 Nov 2021 18:47:47 +0100 (CET) Received: from localhost ([::1]:58958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrOHA-00027r-U3 for larch@yhetil.org; Sun, 28 Nov 2021 12:47:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrOGI-00027B-7S for emacs-orgmode@gnu.org; Sun, 28 Nov 2021 12:46:50 -0500 Received: from ciao.gmane.io ([116.202.254.214]:33692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrOGG-00008n-Bn for emacs-orgmode@gnu.org; Sun, 28 Nov 2021 12:46:49 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mrOGE-0000N0-Ag for emacs-orgmode@gnu.org; Sun, 28 Nov 2021 18:46:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Rasmus Subject: smart quotes and languages like en-gb Date: Sun, 28 Nov 2021 18:46:35 +0100 Message-ID: <87ilwcuq9w.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Emacs Gnus Cancel-Lock: sha1:Qn20uAqlm+BeCEEYM1IaZ1L4dDc= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638121667; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=tTFnL9MTRy+Kc5Uz++jFfrU9SwYqI5XlV94rvn9nmSw=; b=H3ZWdxtBgkxmva+6Ma68/o9jiEwgpG0AiJ1eMY+guT0gdIzemI9xmHWl8Vq6Db0xgAhxgP PHrtizGD+32k/jfhd3VfDNX0O3N9mKD4FOcbKClKG7ezebepqg8BVwqyzwnLJ5P1zb+slK KkCIgHZ7vQWKHUPMr7TASy1IinP6VUI/ZuR9VuHve+nCNp1o0/aMkqdANEntcVbKIz+6RC xDopUupINShMekqJFOuUYgs9sRkWRNkdzb3THcORhcz38mitzDL6ekuC1SLQ4tg2RB1kfC BPUySh2a3/HkLAicbUZS/3Fi86kFD3Aup7S84VU2Q7N/3wC3gs1oaj8fY4CHoA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638121667; a=rsa-sha256; cv=none; b=rttbpc+kuDud4VJ5FmAXtEsjBTFEiJkjh7LmzWZMiP7KPbSu/B9Agoy899/M05vHDWkpsJ FBEV0RDdnejRCMth7gq2QHT12y9GwAFumUdqDPRkBDEgW+5oOeEOx6iE1HoEzQU3OcS0kL 76NvOv0oS2OBcNEwfQPnHHyLugyYl/gdP/m5B74nW9MJu1T7Z/3o4zO/G3G9XPsBS4ZHaE yc4++3YuA0WlQ4LHfdHp+ugmWRZl9ed33bOObHmpSU98HzzSqjVlXB61/bdmQHw5uBELVn OY2QlZVAOJ+bT+ERK+pxjb5mLA/RkWMb8B9x1PWU7xD4a9s9IzS8P+5RJdMjdw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmx.us (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 3DD6928998 X-Spam-Score: -1.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: Wswl7/dNwjwi --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi, I have noticed that smart quotes are not picked up for “long” languages, like “en-gb”, since smart quotes are defined for “short” languages, like “en”, in org-export-smart-quotes-alist. The attached patch is an attempt at remedying this. Not sure if it is the best fix, though... Test file: #+language: en-gb "Foo" Thanks, Rasmus -- Dung makes an excellent fertilizer --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-export-activate-smart-quotes-Support-languages-w.patch >From 44df143a60e035816bcf5a241631e48b9b0a487a Mon Sep 17 00:00:00 2001 From: Rasmus Pank Roulund Date: Sun, 28 Nov 2021 18:41:34 +0100 Subject: [PATCH] org-export-activate-smart-quotes: Support languages with hyphens. Get smart-quotes from "en" for "#+language: en-gb". --- lisp/ox.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index 98c9c1119..6f10112bb 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -5688,8 +5688,9 @@ Return the new string." (lambda (match) (or (plist-get (cdr (assq (pop quote-status) - (cdr (assoc (plist-get info :language) - org-export-smart-quotes-alist)))) + (cdr (cl-assoc (plist-get info :language) + org-export-smart-quotes-alist + :test (lambda (lang k) (string-match-p k lang)))))) encoding) match)) s nil t))) -- 2.34.1 --=-=-=--