From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: issue with gdb-mi.el and Guile Date: Sun, 04 Jun 2017 17:20:22 +0300 Message-ID: <8360gbbzrt.fsf@gnu.org> References: <83shjhbiq2.fsf@gnu.org> <512B3559-B3DD-46DE-9E8C-2D0A90260A4D@ieee.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1496586048 5960 195.159.176.226 (4 Jun 2017 14:20:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Jun 2017 14:20:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Boles Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 04 16:20:39 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHWOU-0000zX-Vt for ged-emacs-devel@m.gmane.org; Sun, 04 Jun 2017 16:20:39 +0200 Original-Received: from localhost ([::1]:57142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHWOY-0002Aq-Og for ged-emacs-devel@m.gmane.org; Sun, 04 Jun 2017 10:20:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHWOS-0002Aj-Kg for emacs-devel@gnu.org; Sun, 04 Jun 2017 10:20:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHWOP-0004Px-Fn for emacs-devel@gnu.org; Sun, 04 Jun 2017 10:20:36 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHWOP-0004Ps-Ct; Sun, 04 Jun 2017 10:20:33 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3445 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dHWOO-0000by-P1; Sun, 04 Jun 2017 10:20:33 -0400 In-reply-to: <512B3559-B3DD-46DE-9E8C-2D0A90260A4D@ieee.org> (message from David Boles on Sat, 3 Jun 2017 16:20:51 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215441 Archived-At: [Please keep the mailing-list address on the CC.] > From: David Boles > 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. Thanks. > 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, yes. > 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". Thanks.