From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: [PATCH] org-babel-goto-named-src-block bugfix and test Date: Sat, 11 Jun 2016 16:04:44 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="0-1983171293-1465686285=:1245" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBrxT-0002pS-A5 for emacs-orgmode@gnu.org; Sat, 11 Jun 2016 19:04:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBrxQ-00086U-1z for emacs-orgmode@gnu.org; Sat, 11 Jun 2016 19:04:51 -0400 Received: from iport-acv3-out.ucsd.edu ([132.239.0.4]:14882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBrxP-00086N-JP for emacs-orgmode@gnu.org; Sat, 11 Jun 2016 19:04:47 -0400 Received: from [137.110.38.186] (unknown [137.110.38.186]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ccberry@ad.ucsd.edu) by act-bufferout-a2.ucsd.edu (Postfix) with ESMTPSA id 1F7C0102F36 for ; Sat, 11 Jun 2016 16:04:45 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org-Mode mailing list This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1983171293-1465686285=:1245 Content-Type: text/plain; format=flowed; charset=US-ASCII Hi all, The revision a few months back of `org-babel-goto-named-src-block' broke some of the interactive uses. I have fixed these in the attached patch. Also, I provide an ERT test for those interactive uses --- filling in the initial-input with the name of the symbol, results block name, #+call: name, or not if point is elsewhere. The test uses lines like: (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\n\n") to emulate interactive usage. This feels like a hack, and the messages generated spill into my *shell* buffer when I run `make test'. If there is a cleaner way to do this, I'd like to know it. WDYT? Chuck --0-1983171293-1465686285=:1245 Content-Type: text/plain; charset=US-ASCII; name=0001-org-babel-goto-named-src-block-bugfix.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: patch Content-Disposition: attachment; filename=0001-org-babel-goto-named-src-block-bugfix.patch RnJvbSA2YjZkMGJlYjkwODQ3NGI3NWU5MDNjODY2NDlhMDRiNmVmNzEwNDhj IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogQ2hhcmxlcyBCZXJy eSA8Y2NiZXJyeUB1Y3NkLmVkdT4NCkRhdGU6IFNhdCwgMTEgSnVuIDIwMTYg MTU6NDU6MjAgLTA3MDANClN1YmplY3Q6IFtQQVRDSF0gb3JnLWJhYmVsLWdv dG8tbmFtZWQtc3JjLWJsb2NrIGJ1Z2ZpeA0KDQoqIGxpc3Avb2ItY29yZS5l bCAob3JnLWJhYmVsLWdvdG8tbmFtZWQtc3JjLWJsb2NrKTogVGhlIHVzZXIg cHJvbXB0DQogIChpLmUuIGBpbml0aWFsLWlucHV0JyBhcmcgb2YgYGNvbXBs ZXRpbmctcmVhZCcpIHdpbGwgYmUgdGhlIG5hbWUgb2YNCiAgdGhlIHJlc3Vs dHMgYmxvY2ssIG5vd2ViIHJlZmVyZW5jZSwgY2FsbCByZWZlcmVuY2UsIG9y IHN5bWJvbCBpZg0KICBwb2ludCBpcyBpbiBzdWNoLg0KDQoqIHRlc3Rpbmcv bGlzcC90ZXN0LW9iLmVsICh0ZXN0LW9iL2dvdG8tbmFtZWQtc3JjLWJsb2Nr KTogU2ltdWxhdGUNCiAgaW50ZXJhY3RpdmUgdXNlIG9mIGBvcmctYmFiZWwt Z290by1uYW1lZC1zcmMtYmxvY2snLg0KLS0tDQogbGlzcC9vYi1jb3JlLmVs ICAgICAgICAgfCAxOCArKysrKysrKysrKystLS0tLS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ZWwtZ290by1uYW1lZC1zcmMtYmxvY2tcbmFiY1xuIikNCisgICAgICAgKHNo b3VsZCAgKD0gMTQgKHBvaW50KSkpICANCisgICAgICAgOzsgY2FsbCBsaW5l ICAgLSBhdXRvY29tcGxldGlvbg0KKyAgICAgICAoZm9yd2FyZC1saW5lIDMp DQorICAgICAgIChleGVjdXRlLWtiZC1tYWNybyAgIlxNLXhvcmctYmFiZWwt Z290by1uYW1lZC1zcmMtYmxvY2tcblxuIikNCisgICAgICAgKHNob3VsZCAg KD0gMTQgKHBvaW50KSkpDQorICAgICAgIDs7IG5vd2ViIHJlZmVyZW5jZSAg LSBhdXRvY29tcGxldGlvbg0KKyAgICAgICAoZm9yd2FyZC1saW5lIDUpDQor ICAgICAgIChleGVjdXRlLWtiZC1tYWNybyAgIlxNLXhvcmctYmFiZWwtZ290 by1uYW1lZC1zcmMtYmxvY2tcblxuIikNCisgICAgICAgKHNob3VsZCAgKD0g MTQgKHBvaW50KSkpDQorICAgICAgIDs7IGF0IHN5bWJvbCAgLSBhdXRvY29t cGxldGlvbg0KKyAgICAgICAoZm9yd2FyZC1saW5lIDcpDQorICAgICAgIChl eGVjdXRlLWtiZC1tYWNybyAgIlxNLXhvcmctYmFiZWwtZ290by1uYW1lZC1z cmMtYmxvY2tcblxuIikNCisgICAgICAgKHNob3VsZCAgKD0gMTQgKHBvaW50 KSkpDQorICAgICAgIDs7IGluIHJlc3VsdHMgIC0gYXV0b2NvbXBsZXRpb24N CisgICAgICAgKGZvcndhcmQtbGluZSA4KQ0KKyAgICAgICAoZXhlY3V0ZS1r YmQtbWFjcm8gICJcTS14b3JnLWJhYmVsLWdvdG8tbmFtZWQtc3JjLWJsb2Nr XG5cbiIpDQorICAgICAgIChzaG91bGQgICg9IDE0IChwb2ludCkpKQ0KKyAg ICAgICAoZm9yd2FyZC1saW5lIDkpDQorICAgICAgIChleGVjdXRlLWtiZC1t YWNybyAgIlxNLXhvcmctYmFiZWwtZ290by1uYW1lZC1zcmMtYmxvY2tcblxu IikNCisgICAgICAgKHNob3VsZCAgKD0gMTQgKHBvaW50KSkpKSkNCisNCiAo ZXJ0LWRlZnRlc3QgdGVzdC1vYi93aGVyZS1pcy1zcmMtYmxvY2stcmVzdWx0 ICgpDQogICAiVGVzdCBgb3JnLWJhYmVsLXdoZXJlLWlzLXNyYy1ibG9jay1y ZXN1bHQnIHNwZWNpZmljYXRpb25zLiINCiAgIDs7IEZpbmQgYW5vbnltb3Vz IHJlc3VsdHMuDQotLSANCjIuNi40IChBcHBsZSBHaXQtNjMpDQoNCg== --0-1983171293-1465686285=:1245--