[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ExecuteMetaData with [ ] instead of { }
From: |
Uwe Brauer |
Subject: |
Re: ExecuteMetaData with [ ] instead of { } |
Date: |
Tue, 23 Aug 2022 22:26:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
> Uwe Brauer <oub@mat.ucm.es> writes:
> With use-case specific, I meant the numeric scheme of tags you're using
> like this:
> %<*1>
> text
> %</1>
> ..
> %<*2>
> text
> %</2>
> I'm not sure if other users of the package go the same route.
> I don't see any issue to add some generic code to catchbetweentags.el
> which parses the source file and offers them for completion in the
> target file, as described above. If you want to introduce a custom
> variable for numeric scheme, that would be also Ok. I'm just saying
> that the code should be usable for all users.
> (require 'cl-lib) isn't a big deal, you can replace that one occurrence
> of `incf' (which should be `cl-incf' actually) with (setq foo (1+ foo))
> and you're done.
Well
(defun my-catch-counter-inc ()
"Increment `my-catch-counter' and return the new value."
(when (= my-catch-counter 0)
(save-excursion
(goto-char (point-min))
(while (re-search-forward (concat "^\\%<\\*\\(" my-catch-chars "*?\\)>$")
(point-max) t)
(let ((fn (string-to-number (match-string 1))))
(when (> fn my-catch-counter)
(setq my-catch-counter fn))))))
(setq my-catch-counter (1+my-catch-counter)))
;; (incf my-catch-counter))
Does not work for me
But
(defun my-catch-counter-inc ()
"Increment `my-catch-counter' and return the new value."
(when (= my-catch-counter 0)
(save-excursion
(goto-char (point-min))
(while (re-search-forward (concat "^\\%<\\*\\(" my-catch-chars "*?\\)>$")
(point-max) t)
(let ((fn (string-to-number (match-string 1))))
(when (> fn my-catch-counter)
(setq my-catch-counter fn))))))
(incf my-catch-counter))
Does. Most likely I misunderstood you
> Also note that `next-line' is for interactive use only, in lisp you
> should use `forward-line', check the docstring.
> Best, Arash
--
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military.
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine.
smime.p7s
Description: S/MIME cryptographic signature
- ExecuteMetaData with [ ] instead of { }, Uwe Brauer, 2022/08/17
- Re: ExecuteMetaData with [ ] instead of { }, Arash Esbati, 2022/08/18
- Re: ExecuteMetaData with [ ] instead of { }, Uwe Brauer, 2022/08/18
- Re: ExecuteMetaData with [ ] instead of { }, Arash Esbati, 2022/08/18
- Re: ExecuteMetaData with [ ] instead of { }, Uwe Brauer, 2022/08/18
- Re: ExecuteMetaData with [ ] instead of { }, Uwe Brauer, 2022/08/19
- Re: ExecuteMetaData with [ ] instead of { }, Arash Esbati, 2022/08/23
- Re: ExecuteMetaData with [ ] instead of { }, Uwe Brauer, 2022/08/23
- Re: ExecuteMetaData with [ ] instead of { }, Arash Esbati, 2022/08/23
- Re: ExecuteMetaData with [ ] instead of { }, Uwe Brauer, 2022/08/23
- Re: ExecuteMetaData with [ ] instead of { },
Uwe Brauer <=
- Re: ExecuteMetaData with [ ] instead of { }, Arash Esbati, 2022/08/24
- Re: ExecuteMetaData with [ ] instead of { }, Uwe Brauer, 2022/08/24