[Top][All Lists]

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

Re: issue with gdb-mi.el and Guile

From: Eli Zaretskii
Subject: Re: issue with gdb-mi.el and Guile
Date: Sun, 04 Jun 2017 17:20:22 +0300

[Please keep the mailing-list address on the CC.]

> From: David Boles <address@hidden>
> Date: Sat, 3 Jun 2017 16:20:51 -0500
> > Thanks.  Can you try the following patch, after reverting your changes
> > to gdb-mi.el, and see if it gives good results?
> For whatever reason the patch is deemed corrupt at line 13 (perhaps an error 
> on my part). However, I applied the patch “by hand” to an up to date instance 
> of master and it appears to work fine. Clearly it’s a better approach than my 
> hack.
> I will be applying the delta to all my emacs installations and will let you 
> know if I see anything, but at the moment I don’t see any issues.


> Will you be merging this into the Emacs repo?

If you don't see any issues in a few days, I will install this change,

> Also, I don’t know whether this might be a fit for gdb-mi.el or not but I’ve 
> found it very helpful to hook yank and rewrite paste’s of hex numbers from 
> 0x1234 form to #x1234 lisp form when running a guile command or in the guile 
> repl:
> (defun gdb-guile-command-entry ()
>   (interactive)
>   (save-excursion
>     (let ((end-pos (point)))
>       (beginning-of-line)
>       (let* ((beg-pos (point))
>              (chunk (buffer-substring beg-pos end-pos)))
>         (if (string-match "guile" chunk)
>             t
>           nil)))))
> (defun my-gdb-guile-yank-filter (args)
>   (interactive)
>   (let ((chunk (car args)))
>     (if (and (string-match "*gud-" (buffer-name))
>              (gdb-guile-command-entry)
>              (string-match "0x\\([0-9a-f]+\\)" chunk))
>         (list (concat "#x" (match-string 1 chunk)))
>       (list chunk))))
> (advice-add 'insert-for-yank-1 :filter-args #'my-gdb-guile-yank-filter)

We try to avoid using advice in the Emacs sources, but patches are
welcome to implement a similar feature via other means.  Also, I think
we'd want this for multi-line Guile commands typed into GDB.  Maybe you
should file a feature request about this using "M-x report-emacs-bug".


reply via email to

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