From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: noah Newsgroups: gmane.emacs.bugs Subject: bug#37951: 27.0.50; octave completion-at-point for fieldnames Date: Sun, 27 Oct 2019 19:22:43 -0400 Message-ID: <87h83tzscc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="246005"; mail-complaints-to="usenet@blaine.gmane.org" To: 37951@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 28 00:23:48 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iOrsx-0011qB-V0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Oct 2019 00:23:48 +0100 Original-Received: from localhost ([::1]:49930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOrsw-00046L-OX for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2019 19:23:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36990) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOrsH-0003EP-SA for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 19:23:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOrsF-0004Ox-5N for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 19:23:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34827) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOrsE-0004Or-WB for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 19:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iOrsE-00079c-Lq for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 19:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: noah Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2019 23:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37951 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.157221857327467 (code B ref -1); Sun, 27 Oct 2019 23:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Oct 2019 23:22:53 +0000 Original-Received: from localhost ([127.0.0.1]:43648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOrs4-00078v-KK for submit@debbugs.gnu.org; Sun, 27 Oct 2019 19:22:52 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:60217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOrs3-00078o-0t for submit@debbugs.gnu.org; Sun, 27 Oct 2019 19:22:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36958) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOrs1-0002tN-FL for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 19:22:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOrrz-0004Eq-3W for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 19:22:49 -0400 Original-Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:35941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOrry-0004ED-Vb for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 19:22:47 -0400 Original-Received: by mail-qt1-x830.google.com with SMTP id x14so1725319qtq.3 for ; Sun, 27 Oct 2019 16:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=9iOIXCLUzITygmkWI3axi7pJj8KiQpemP8P50lnRvEg=; b=NLkuKeGBZZ8y5U/rxcx9vspa6Y14sBb3+x19hx0j2lPpJ8+ugjNCDi8mGNoKAtmJU4 O9Ica9WwzOlZq4Gm2tkNqHV4AYBVyym9vKODS8KmJfA0h455/8bASnBG75lEYeBaoM97 g2cBRdP5WdV4vW1tVHPqRDSN32VWmlnboaQ8GJa3J2a3d/AwHLyu+r81JQnjQZ6gHO5l BlGUQ6fU49YUK3o2WS5dlBl63rz2YoOgE1sydfkizR6gid2lh6UouytFiVrlqokMduAP f+XGP9RD0wqNEN/xYu0nPx//37i23e6suLInlAEGxqfizVTbYUh4q/PkonZdDKjQkoKF bZ0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=9iOIXCLUzITygmkWI3axi7pJj8KiQpemP8P50lnRvEg=; b=kupYPGEeriqDv6woUxm074bWcrkNpk4rkotFPkLFuK2r346drZYbVHwofzqUH2gKWt 5Ft+jkzEK7kLukhHGXctRHsJ2Bi1Qm3Ed4RbVxeZOH92gyeIHfvgtmfjEoyA7u3j/svl EkozzUDYo5wquvpJh0L5pfG2788wkHR2SXWfIwbTRkhWTbXBvlVzRzuwwca7YUw2mnle WZ5FDhjfVa9Y2QhK/XZV1ZiFy3tOOnmIZPllHYcDYS4ptsCH47kRPOtXP3KT/GPH8un1 6A6zQU06KVZdYZLvPMygoIXRU8QyEV2Bi+aHtBupn6AZQAwGzlBIUrAKJO1dPKZJM4m8 KDXA== X-Gm-Message-State: APjAAAWvm6A5xzd1ubfzHQQNWNUQIx0RE7esiLrjNSdJzJJSIDPoSpOo EHZmPpBEjMbfe/1MtWlhCuxuTnCnjns= X-Google-Smtp-Source: APXvYqxofGYUM+VmVkuJYbDnEkGQgDxKd0kC7IJmMvT87pH5TK8cLzier7OIT04LaR6y/AV9Eh+M4w== X-Received: by 2002:ac8:80f:: with SMTP id u15mr14569958qth.193.1572218566008; Sun, 27 Oct 2019 16:22:46 -0700 (PDT) Original-Received: from noah-M51AC (c-98-229-29-60.hsd1.ma.comcast.net. [98.229.29.60]) by smtp.gmail.com with ESMTPSA id g8sm6320552qta.67.2019.10.27.16.22.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Oct 2019 16:22:45 -0700 (PDT) X-Google-Original-From: "noah" Original-Received: by noah-M51AC (sSMTP sendmail emulation); Sun, 27 Oct 2019 19:22:43 -0400 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170279 Archived-At: This is relevant to octave.el (should I be sending to a different list or tagging it somehow?) The completion-at-point functions in both octave source buffers and inferior octave buffers don't complete for fieldnames of eg. structs. For example, it would be nice to get completion candidates after '.' in these cases octave> s(1) = struct('field1', [], 'field2', []) octave> s(2) = struct('field1', [], 'field2', []) octave> s. # case 1 octave> s(1). # case 2 This is simply a matter of not capturing the correct bounds of objects at point in `octave-completion-at-point` and `inferior-octave-completion-at-point`. The octave function `completion_matches` already returns the correct completion candidates ("s.field1" "s.field2") when passed the full "s." or "s(1)." strings in the above example. The following modification to retrieve the bounds of the object at point seems to work in both source and inferior buffers. (defun my-octave-bounds-of-object-at-point (&optional lim) (let ((beg (save-excursion (skip-syntax-backward "w_" lim) ;; just this extra check (when (eq ?. (char-before)) (forward-char -1) (and (eq ?\) (char-before)) ; struct(i). (ignore-errors (backward-sexp))) (skip-syntax-backward "w_" lim)) (point))) (end (point))) (when (< beg end) ; extends region past point (save-excursion (skip-syntax-forward "w_") (setq end (point)))) (when (> end beg) (cons beg end)))) However, being pretty new to octave, I'm not sure about all the cases where this completion would be applicable. In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-10-27 built on noah-M51AC Repository revision: 0e4dd67aae8b10032317a29a6bd99d2d4a64c897 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 18.04.3 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: Beginning of history; no preceding item previous-line: Beginning of buffer Configured using: 'configure --prefix=/usr/local --with-modules --with-xwidgets' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 44989 6110) (symbols 48 6002 1) (strings 32 15444 1947) (string-bytes 1 504797) (vectors 16 10036) (vector-slots 8 129209 9586) (floats 8 20 24) (intervals 56 189 0) (buffers 1000 11))