Received: (at 71375) by debbugs.gnu.org; 5 Jun 2024 09:13:30 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 05 05:13:30 2024 Received: from localhost ([127.0.0.1]:44776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sEmi1-0005mf-LM for submit <at> debbugs.gnu.org; Wed, 05 Jun 2024 05:13:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acorallo@HIDDEN>) id 1sEmhz-0005mC-Bl for 71375 <at> debbugs.gnu.org; Wed, 05 Jun 2024 05:13:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <acorallo@HIDDEN>) id 1sEmhg-0008RS-5R; Wed, 05 Jun 2024 05:13:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=KSC15hpwFfWZX8/F1LPmxMLQjTz9/84u5L+ll0dAqnU=; b=cMeUxy5lsTdJHi/RvRrz yqKJokNCapDPpOOhYew1HXM1lz47xGoDwYWuEpo9zVDCzHnwGf/SYupMe48vMVZsU1cZBwxF+Of3N fj0LnNjK3ZT9MsAjYOKCVmYHZpZIeK4emm7leWOCy9nJq8tmRXj20kV2WEzIrKPjyMJb1isKxwl4Q z7A1J85PbEsC+aPEHLgl88+psFdbPhK7kbXWpxcGjYiYvy8x4gwXeqcOedbymu3WXMIx7xEoboBZP RXmw8eQI6jGUdovj5R7/rnGZcwZNn+MK/Gt1WYF84vykjIA8G0EaGqci4obYfTD58W5Q6b386WH1U af9W4+NTHa2xtQ==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from <acorallo@HIDDEN>) id 1sEmhf-000726-SW; Wed, 05 Jun 2024 05:13:07 -0400 From: Andrea Corallo <acorallo@HIDDEN> To: Pranshu <pranshusharma366@HIDDEN> Subject: Re: bug#71375: 30.0.50 In-Reply-To: <877cf36eu9.fsf@HIDDEN> (Pranshu's message of "Wed, 05 Jun 2024 17:14:38 +1000") References: <877cf36eu9.fsf@HIDDEN> Date: Wed, 05 Jun 2024 05:13:07 -0400 Message-ID: <yp1y17jn464.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71375 Cc: 71375 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Pranshu <pranshusharma366@HIDDEN> writes: > Currently in table.el, charecters such as '$' sign are escaped. This > diff adds a variable which can control what is escaped or not. Since a > backslash is escaped in a different way to other charecters in latex, > the variable had to be a cons cell of a regexp and bool. Hi Pranshu, I think you sent this by mistake twice, I'm merging it with 71364. Andrea
bug-gnu-emacs@HIDDEN
:bug#71375
; Package emacs
.
Full text available.Andrea Corallo <acorallo@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at submit) by debbugs.gnu.org; 5 Jun 2024 07:15:04 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 05 03:15:03 2024 Received: from localhost ([127.0.0.1]:36096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sEkrP-0000CC-9J for submit <at> debbugs.gnu.org; Wed, 05 Jun 2024 03:15:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:39776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <pranshusharma366@HIDDEN>) id 1sEkrM-0000BE-KK for submit <at> debbugs.gnu.org; Wed, 05 Jun 2024 03:15:01 -0400 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 <pranshusharma366@HIDDEN>) id 1sEkr8-0005Ui-Ex for bug-gnu-emacs@HIDDEN; Wed, 05 Jun 2024 03:14:46 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <pranshusharma366@HIDDEN>) id 1sEkr6-0001R2-Rh for bug-gnu-emacs@HIDDEN; Wed, 05 Jun 2024 03:14:46 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1f60a502bb2so15093075ad.3 for <bug-gnu-emacs@HIDDEN>; Wed, 05 Jun 2024 00:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717571682; x=1718176482; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=AmN8iACSNXYRfOpgZI7mPcvEXs3jcAnJz6Bjl2n8jGA=; b=TmpwekTg0iyvWzUrq5SI1cwCoOZat13+GmGNKFzyLovtPPrKm945W57tg+aaDGbrW5 rP42lOpCmZCzTDuhg5iEryNF0WqgQM3ipOKcY1QKk1fen5Qdt8hsS/envFoxlw8E85fj 42kf26gTtcIz1M/2s7MijKjXlh7JYwu8sNSEs7C15auSdnThADbl/VejP9IYZ3UeGhjq 7v4oe7SCyUgMRXcPDq57ONCNpZzTKnGEqcnBkMEG+0sQR00JBnV6CPw+6PiEyGn//8Gv OsOupypqv0wCryA2toqAoyZVN28Or6WBD0CjvVEoPhPy2quy8CKpjcDXZJN0ahUDPw+m 5iyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717571682; x=1718176482; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AmN8iACSNXYRfOpgZI7mPcvEXs3jcAnJz6Bjl2n8jGA=; b=MkyaNF2U6WDsdVMyNJN8FFcrTpgxZgly74ksRVaz2F+qtN2YbJmbsVYRW0XWCKS+xt JXenmlVNAwWguvhihO9WioUKHURP9MRqmxiVGw67Yrby2snfgbAwye8Kq8pPmPceaHsu ROtcz590p6ZBoRBx7lZRb9iyarFeUAJiBdoQwyK+Hblj/bgCpa9gq9q34EAUkwrC0FwK k6khhYV0mKGHgUZrg4KQp//VMOtWCWo1eHgUFVIEAq5O44KEUajRyy2fuvyyM3+SPvb8 LI5H1mkxvKPMOzWC0T7MhIjJmDDTCfBloWAUXPViab5oy0PW0i0Vda+JQebPUuchsJgp fRqw== X-Gm-Message-State: AOJu0YzmQU0Dc6P3oxCbnjtgecL6ubptd7nYDE8OL2rLf5HftINr8M22 rOX+bhL885N2WeFVIgvEoS0SI5oeAXPrpZUJFd/lE1lp0SlqODL1U461wHtP X-Google-Smtp-Source: AGHT+IGI0r0bioNwm/QoI29fAM2I0EpZnXA35LBDzh5rdtfonILN8VIzjHOBIupgHYROIHOApp7mLg== X-Received: by 2002:a17:903:32cf:b0:1f6:8489:d150 with SMTP id d9443c01a7336-1f6a5a04226mr20730575ad.13.1717571682261; Wed, 05 Jun 2024 00:14:42 -0700 (PDT) Received: from pebl ([2001:8003:7816:8300:7f15:5962:16a0:6470]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f692ad015esm29919185ad.278.2024.06.05.00.14.40 for <bug-gnu-emacs@HIDDEN> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 00:14:41 -0700 (PDT) From: Pranshu <pranshusharma366@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: 30.0.50 Date: Wed, 05 Jun 2024 17:14:38 +1000 Message-ID: <877cf36eu9.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=pranshusharma366@HIDDEN; helo=mail-pl1-x62d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.1 (--) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=table.diff diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 19c6a8d7c4..28401084a6 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -697,6 +697,19 @@ table-word-continuation-char :type 'character :group 'table) +(defcustom table-source-latex-escape-characters (cons "[#$~_^%{}&]" t) + "A cons cell containing which charecters to escape in the latex source +of `table-generate-source'. The head of the list, if non-nil contains a +regexp that matches all text that is to be adding a preceding backslash +to the matching text. If nil, no non-backslash charecters will be +escaped. The tail, if non-nil, escapes all the backslashes in the latex +source." + :tag "Source Latex Escape Charecters Regexp" + :type '(cons (radio (regexp :tag "regexp") + (const :tag "Off" nil)) + boolean) + :group 'table) + (defcustom table-detect-cell-alignment t "Detect cell contents alignment automatically. When non-nil cell alignment is automatically determined by the @@ -3264,19 +3277,29 @@ table--generate-source-scan-lines (lambda (from to) (let ((line (table--buffer-substring-and-trim (table--goto-coordinate (cons from y)) - (table--goto-coordinate (cons to y))))) + (table--goto-coordinate (cons to y)))) + (escape-char-reg + (apply 'concat (append (and (car table-source-latex-escape-characters) + (list "\\(" + (car table-source-latex-escape-characters) + "\\)" + (and (cdr table-source-latex-escape-characters) + "\\|"))) + (and (cdr table-source-latex-escape-characters) + (list"\\(\\\\\\)")))))) ;; escape special characters (with-temp-buffer (insert line) (goto-char (point-min)) - (while (re-search-forward "\\([#$~_^%{}&]\\)\\|\\(\\\\\\)\\|\\([<>|]\\)" nil t) - (if (match-beginning 1) - (save-excursion - (goto-char (match-beginning 1)) - (insert "\\")) - (if (match-beginning 2) - (replace-match "$\\backslash$" t t) - (replace-match (concat "$" (match-string 3) "$")) t t))) + (when (or (car table-source-latex-escape-characters) + (cdr table-source-latex-escape-characters)) + (while (re-search-forward escape-char-reg nil t) + (if (and (car table-source-latex-escape-characters) + (match-beginning 1)) + (save-excursion + (goto-char (match-beginning 1)) + (insert "\\")) + (replace-match "$\\backslash$" t t)))) (setq line (buffer-substring (point-min) (point-max)))) ;; insert a column separator and column/multicolumn contents (with-current-buffer dest-buffer --=-=-= Content-Type: text/plain Currently in table.el, charecters such as '$' sign are escaped. This diff adds a variable which can control what is escaped or not. Since a backslash is escaped in a different way to other charecters in latex, the variable had to be a cons cell of a regexp and bool. --=-=-=--
Pranshu <pranshusharma366@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#71375
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.