unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: help in writing function to pop indirect buffer
Date: Wed, 25 Jan 2023 20:55:41 +0300	[thread overview]
Message-ID: <Y9FtHZX6a9veJvI/@protected.localdomain> (raw)
In-Reply-To: <CAKoxK+6t6KBwevLqeCDyL5VQ6_N3XB7L1xC6rDXbX964LeJnLA@mail.gmail.com>

* Luca Ferrari <fluca1978@gmail.com> [2023-01-25 14:16]:
> This almost works, but when the indirect buffer is popped, I do not
> have syntax highlight while I have indentation and apparently all the
> other Perl things.
> How can I turn on syntax highlight?

I can see error:
Not enabling jit-lock: it does not work in indirect buffer

but how to solve it, I do not know.

I find great what you are doing.

> Another question: how can I let start and end to be bound to the
> region between a defined tag like '$code$'? I thought about
> word-search-forward and backward, but it seems ugly and not really
> stable.

Why not define thing-at-point?

;;; Thing at point 'thing-within-$code$

(defun rcd-tap-thing-within-$code$-start ()
    "Move point to the beginning of thing within `$code$'."
    (re-search-backward "\\$code\\$")
    (forward-char 7))

(defun rcd-tap-thing-within-$code$-end ()
    "Move point to the end of thing within `$code$."
  (re-search-forward "\\$code\\$")
  (backward-char 7))

(put 'thing-within-$code$ 'beginning-op 'rcd-tap-thing-within-$code$-start)
(put 'thing-within-$code$ 'end-op 'rcd-tap-thing-within-$code$-end)

$code$
print 1 + 2;
$code$

try: 
(thing-at-point 'thing-within-$code$) within $code$ and 


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



  reply	other threads:[~2023-01-25 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 11:13 help in writing function to pop indirect buffer Luca Ferrari
2023-01-25 17:55 ` Jean Louis [this message]
2023-01-26  6:45   ` Emanuel Berg
2023-01-27 18:30   ` Bruno Barbier
     [not found]   ` <notmuch-sha1-03eb8baf922f469fd287c8e7e6f142e660e155d3>
2023-01-28 11:59     ` Bruno Barbier
2023-01-30 13:30       ` Luca Ferrari
2023-01-30 18:38         ` Bruno Barbier
2023-01-31  7:36         ` Jean Louis
2023-09-07 12:53           ` Luca Ferrari
2023-01-28 13:20 ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y9FtHZX6a9veJvI/@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=fluca1978@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).