help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help in writing function to pop indirect buffer


From: Jean Louis
Subject: Re: help in writing function to pop indirect buffer
Date: Wed, 25 Jan 2023 20:55:41 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* 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 via email to

[Prev in Thread] Current Thread [Next in Thread]