From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Luca Ferrari Newsgroups: gmane.emacs.help Subject: Perl and SQL within the same buffer Date: Mon, 3 Oct 2022 16:18:33 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18917"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 03 16:21:58 2022 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 1ofMKU-0004mj-1u for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 03 Oct 2022 16:21:58 +0200 Original-Received: from localhost ([::1]:35538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofMKS-0006Cd-LE for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 03 Oct 2022 10:21:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofMHt-00060G-Ml for help-gnu-emacs@gnu.org; Mon, 03 Oct 2022 10:19:21 -0400 Original-Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:42991) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofMHs-0007CX-2q for help-gnu-emacs@gnu.org; Mon, 03 Oct 2022 10:19:17 -0400 Original-Received: by mail-wm1-x330.google.com with SMTP id o20-20020a05600c4fd400b003b4a516c479so5932932wmq.1 for ; Mon, 03 Oct 2022 07:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=1uIVZlMTc744hgDCpfxqboOwAEVgkT/Gk1WCZ3uxz6I=; b=IclK4ihbSpylcpMyF0SKBg90zwzR+YnqFAh244Qb9BERMCBNVz/mLANCrUoHYS+AuS dMcnTgddWdss6DqypRE4X1G3ln2kVmmM/LLAQzDXSTqzA+n2Y5u7P2JCjWiDH9ZSaaFs XbwAsuL5z9peWCdfMoiAIZ5KwtAOxtItEkP2G4jpIwjNDc6aMsvuXHnfKxcY3mdpi81q tMtkR6Mo7jpnaikO+Sl0e6a5MMK+ShJbdp4KCaD8mOFJYiBFnBn9CqyPwFlg4IRh0n5S JapSDA9o7jWYXqYokwIjze76zvrA2U7cklTkahfRw3vRFBNB1dgQ4zUuNVu4IrWV/n1j ZQxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=1uIVZlMTc744hgDCpfxqboOwAEVgkT/Gk1WCZ3uxz6I=; b=tyh7CWHM/B6nJ7EEWhMb+Jb1S+lYdktqx+IangNWWdnrSo11djdYKfSqSwyCXeyThj agkQA6PN07zhjvlIaSnn6BEHwIuPGqXP/5J8KyGOJUdIpbX++3rbXm2r9e8xT2dtwNT4 iyXTK3ok1BgikC+JD5zPnOrNv7t5Cll38/K2LPy7Idj8J+Ug4v6LR1wMt+Fp5tiWnNG2 FFEY/ZcizXdAU5go/jiaXzVmEIARwaZRebduh6E7sh/m5wZMylUhl6J9JXo1azu+sNpM dVGSQdk+goBvp0Tg1GHC4wIIAo5jqZx6iurhlJuc0Fuqnor0dCz1lWiF6nTLasdqz4hI /Qbw== X-Gm-Message-State: ACrzQf10BmmlPsnCQA0FcFp4nFgzrE9n6luS/1uDcLZO3RapnmqUnBy/ Hu9U40L3lQGyoCBSqBfIVpOzL0kNGa8eYSobfS3nPsL7yzRgTQ== X-Google-Smtp-Source: AMsMyM5DHC1IfI1bNsKPgNdUljSbL9Xb8bu1OLwd9t2lAsz2BCFBbaD5ZLcEyh8TRcCzWMKsL7fqDBxMvaphEY74Nfs= X-Received: by 2002:a05:600c:3515:b0:3b4:a0fa:c4e1 with SMTP id h21-20020a05600c351500b003b4a0fac4e1mr7236150wmq.191.1664806749409; Mon, 03 Oct 2022 07:19:09 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=fluca1978@gmail.com; helo=mail-wm1-x330.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.help:139700 Archived-At: Hi all, when I edit PostgreSQL PL/Perl functions, I have a source code that has a basic SQL mode in the outer part of a function, and Perl in the inner part. Is there a way to instrument Perl to recognize and use both modes and syntax highlight? Something like what it happens when editing HTML and PHP inside it. An example of source code I edit: CREATE OR REPLACE FUNCTION pwc185.task2_plperl( text ) RETURNS text AS $CODE$ my ( $input ) = @_; my @output; my $counter = 4; for ( split( //, $input ) ) { push @output, 'x' and $counter-- and next if ( /[a-z0-9]/i ) and $counter > 0; push @output, $_; } return join( '', @output ); $CODE$ LANGUAGE plperl; Everything outside the $CODE$ lines is SQL, everything insde is Perl. Any suggestion? Thanks, Luca