GNU bug report logs - #21072
24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp

Previous Next

Package: emacs;

Reported by: Raffaele Ricciardi <rfflrccrd <at> gmail.com>

Date: Thu, 16 Jul 2015 06:13:01 UTC

Severity: minor

Found in version 24.5

Done: Marcin Borkowski <mbork <at> mbork.pl>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Marcin Borkowski <mbork <at> mbork.pl>
To: npostavs <at> users.sourceforge.net
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 21072 <at> debbugs.gnu.org
Subject: bug#21072: Brave new mark-defun (and a testing tool)
Date: Wed, 03 May 2017 17:20:56 +0200
On 2017-05-01, at 00:21, npostavs <at> users.sourceforge.net wrote:

> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>> This suggests that the first arg is not "evaluated by the macro itself
>> at compile time", but instead is passed unevaluated to `insert`, in
>> which case it can't be instrumented.
>
> Oh, I see, this patch works, although it surprised me a bit to start
> stepping immediately when doing the C-u C-M-x.
>
> ---   i/test/lisp/emacs-lisp/lisp-tests.el
> +++   w/test/lisp/emacs-lisp/lisp-tests.el
> @@ -320,12 +320,10 @@ elisp-tests-with-temp-buffer
>  of the form =!NAME= in CONTENTS are removed, and a for each one a
>  variable called NAME is bound to the position of the word's
>  start."
> -  (declare (indent 1) (debug (form body)))
> +  (declare (indent 1) (debug (def-form body)))
>    (let* ((var-pos nil)
>           (text (with-temp-buffer
> -                 (insert (cond ((symbolp contents)
> -                                (symbol-value contents))
> -                               (t contents)))
> +                 (insert (eval contents))
>                   (goto-char (point-min))
>                   (while (re-search-forward elisp-test-point-position-regex nil t)
>                     (push (list (intern (match-string-no-properties 1))

Hi Stefan and Noam,

I finally analyzed Noam's code, and the very same thing occurred to me:
that using `(eval contents)' would both be more reasonable (after all,
CONTENTS might be neither a symbol nor a string, but some expression!)
and at the same time consistent with Noam's rewording of the docstring.
Thanks!

I'm in a train now, and with limited access to the internet, so I'll get
back to this thread (and push the branch after clean-up - I guess I'll
have to delete the current branch first, right?) soon.

It's good that the Emacs manuals are available offline - I'll read about
arguments to `debug' now. ;-)

Best,

--
Marcin Borkowski




This bug report was last modified 8 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.