unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Wrong LENGTH passed to AFTER-CHANGED-FUNCTIONS when using UNCOMMENT-REGION with MARKER arguments?
@ 2021-02-10  0:32 Qiantan Hong
  2021-02-10 21:41 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Qiantan Hong @ 2021-02-10  0:32 UTC (permalink / raw)
  To: Emacs developers


[-- Attachment #1.1: Type: text/plain, Size: 459 bytes --]

Way to reproduce: 
Have the following in buffer

;; (thing)

M-: (uncomment-region (save-excursion (goto-char <before-;;>) (point-marker))
(save-excursion (goto-char <after-(thing);>) (point-marker)))

I get 
  (#<marker at 448 in *scratch*> #<marker at 458 in *scratch*>)
passed to before-change-functions,
  (#<marker at 448 in *scratch*> 455 7)
passed to after-change-functions

However, the LENGTH should be 10 instead of 7.

Any ideas?



Best,
Qiantan


[-- Attachment #1.2: Type: text/html, Size: 2022 bytes --]

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 1858 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Wrong LENGTH passed to AFTER-CHANGED-FUNCTIONS when using UNCOMMENT-REGION with MARKER arguments?
  2021-02-10  0:32 Wrong LENGTH passed to AFTER-CHANGED-FUNCTIONS when using UNCOMMENT-REGION with MARKER arguments? Qiantan Hong
@ 2021-02-10 21:41 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2021-02-10 21:41 UTC (permalink / raw)
  To: Qiantan Hong; +Cc: Emacs developers

> However, the LENGTH should be 10 instead of 7.
> Any ideas?

Right, the code in `combine-change-calls-1` clearly expects to be called
with integers rather than markers, and I think that's the origin of
the problem.

If you change your `M-:` to pass `(point)` rather than `(point-marker)`,
then it will not exhibit this misbehavior.

I just pushed a fix for it on `master`.


        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-10 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10  0:32 Wrong LENGTH passed to AFTER-CHANGED-FUNCTIONS when using UNCOMMENT-REGION with MARKER arguments? Qiantan Hong
2021-02-10 21:41 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).