unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26037: 25.1; perl-mode add syntax support for subroutine signatures
@ 2017-03-09 16:57 Evgeni Kolev
  2017-03-11 14:26 ` npostavs
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Evgeni Kolev @ 2017-03-09 16:57 UTC (permalink / raw)
  To: 26037

[-- Attachment #1: Type: text/plain, Size: 9440 bytes --]

perl 5.20 (released May 2014) added experimental support for subroutine
signatures. So this is valid perl code:

sub test ($param) {
  ...
}

However, perl-mode's syntax rules treat everything between ( and ) as
punctuation (syntax class "."). As a result (thing-at-point 'word)
doesn't return $param when the point is on $param because $param is
considered punctuation. The patch below tries to address this by
using syntax class "@" inside the parens.


diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index a516f07..2b9d9ad 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -258,7 +258,7 @@
       ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'.
       ;; Be careful not to match "sub { (...) ... }".
       ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([^)]+\\))"
-       (1 "."))
+       (1 "@"))
       ;; Turn __DATA__ trailer into a comment.
       ("^\\(_\\)_\\(?:DATA\\|END\\)__[
\t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)"
        (1 "< c") (2 "> c")






In GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0)
 of 2017-01-21 built on evgeni-mba.local
Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs/25.1/share/info/emacs
 --prefix=/usr/local/Cellar/emacs/25.1 --without-x --with-xml2
 --without-dbus --without-gnutls --without-ns'

Configured features:
JPEG NOTIFY ACL LIBXML2 ZLIB

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  aggressive-indent-mode: t
  beacon-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-smart-tab-mode: t
  smart-tab-mode: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  smartparens-mode: t
  winner-mode: t
  ivy-mode: t
  which-key-mode: t
  shackle-mode: t
  ido-vertical-mode: t
  save-place-mode: t
  recentf-mode: t
  global-evil-visualstar-mode: t
  evil-visualstar-mode: t
  evil-commentary-mode: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  evil-mode: t
  evil-local-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent messages:
Loading package haskell-snippets...done
Loading package uniquify...
Configuring package uniquify...done
Loading package uniquify...done
Loading package beacon...
Configuring package beacon...done
Loading package beacon...done
Loading /Users/edkolev/.emacs.d/init.el...done (1.320s) [after-init]
Configuring package aggressive-indent...done
Configuring package dired...done

Load-path shadows:
~/dev/evil/evil hides /Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil
~/dev/evil/evil-vars hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-vars
~/dev/evil/evil-types hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-types
~/dev/evil/evil-states hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-states
~/dev/evil/evil-search hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-search
~/dev/evil/evil-repeat hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-repeat
~/dev/evil/evil-pkg hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-pkg
~/dev/evil/evil-maps hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-maps
~/dev/evil/evil-macros hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-macros
~/dev/evil/evil-jumps hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-jumps
~/dev/evil/evil-integration hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-integration
~/dev/evil/evil-ex hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-ex
~/dev/evil/evil-digraphs hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-digraphs
~/dev/evil/evil-core hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-core
~/dev/evil/evil-common hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-common
~/dev/evil/evil-commands hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-commands
~/dev/evil/evil-command-window hides
/Users/edkolev/.emacs.d/elpa/evil-20170209.1259/evil-command-window
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-xact hides
/usr/local/share/emacs/site-lisp/ledger/ledger-xact
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-texi hides
/usr/local/share/emacs/site-lisp/ledger/ledger-texi
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-test hides
/usr/local/share/emacs/site-lisp/ledger/ledger-test
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-state hides
/usr/local/share/emacs/site-lisp/ledger/ledger-state
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-sort hides
/usr/local/share/emacs/site-lisp/ledger/ledger-sort
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-schedule hides
/usr/local/share/emacs/site-lisp/ledger/ledger-schedule
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-report hides
/usr/local/share/emacs/site-lisp/ledger/ledger-report
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-regex hides
/usr/local/share/emacs/site-lisp/ledger/ledger-regex
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-reconcile
hides /usr/local/share/emacs/site-lisp/ledger/ledger-reconcile
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-post hides
/usr/local/share/emacs/site-lisp/ledger/ledger-post
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-occur hides
/usr/local/share/emacs/site-lisp/ledger/ledger-occur
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-navigate hides
/usr/local/share/emacs/site-lisp/ledger/ledger-navigate
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-mode hides
/usr/local/share/emacs/site-lisp/ledger/ledger-mode
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-init hides
/usr/local/share/emacs/site-lisp/ledger/ledger-init
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-fonts hides
/usr/local/share/emacs/site-lisp/ledger/ledger-fonts
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-fontify hides
/usr/local/share/emacs/site-lisp/ledger/ledger-fontify
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-exec hides
/usr/local/share/emacs/site-lisp/ledger/ledger-exec
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-context hides
/usr/local/share/emacs/site-lisp/ledger/ledger-context
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-complete hides
/usr/local/share/emacs/site-lisp/ledger/ledger-complete
/Users/edkolev/.emacs.d/elpa/ledger-mode-20170208.425/ledger-commodities
hides /usr/local/share/emacs/site-lisp/ledger/ledger-commodities
/Users/edkolev/.emacs.d/elpa/seq-2.19/seq hides
/usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/emacs-lisp/seq

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils
colir color term/xterm xterm aggressive-indent beacon haskell-snippets
yasnippet smart-tab smartparens-config smartparens dash s ucs-normalize
winner whitespace ivy delsel ivy-overlay which-key shackle compile
ido-vertical-mode ido saveplace evil-indent-plus recentf tree-widget
wid-edit evil-visualstar evil-replace-with-register evil-exchange
evil-commentary evil-commentary-integration evil-surround evil
evil-integration undo-tree diff evil-maps evil-commands ffap url-parse
auth-source eieio eieio-core gnus-util time-date mm-util help-fns
mail-prsvr password-cache url-vars evil-jumps cl-seq evil-command-window
evil-types evil-search evil-ex evil-macros evil-repeat evil-states
evil-core evil-common derived cl-macs windmove cl thingatpt rect
evil-digraphs evil-vars hippie-exp comint regexp-opt ansi-color ring
edmacro kmacro general spacemacs-light-theme spacemacs-common
use-package diminish bind-key easy-mmode finder-inf advice info tool-bar
package epg-config seq byte-opt gv bytecomp byte-compile cl-extra
help-mode easymenu cconv cl-loaddefs pcase cl-lib mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select mouse jit-lock font-lock syntax
facemenu font-core frame 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 charscript case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer 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 kqueue multi-tty
make-network-process emacs)

Memory information:
((conses 16 452052 73574)
 (symbols 48 35184 3)
 (miscs 40 56 271)
 (strings 32 62447 49959)
 (string-bytes 1 1927618)
 (vectors 16 47695)
 (vector-slots 8 855243 19673)
 (floats 8 777 568)
 (intervals 56 270 16)
 (buffers 976 17))

[-- Attachment #2: Type: text/html, Size: 11664 bytes --]

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-04-03  7:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-09 16:57 bug#26037: 25.1; perl-mode add syntax support for subroutine signatures Evgeni Kolev
2017-03-11 14:26 ` npostavs
2017-03-15  2:08 ` npostavs
2017-03-16  0:49 ` npostavs
2017-03-18 14:24   ` Евгени Колев
2017-03-18 15:58     ` npostavs
2017-03-26 17:29       ` Евгени Колев
2017-03-26 18:04         ` npostavs
2017-03-28  3:34 ` bug#26037: [Евгени Колев] " npostavs
2017-03-28  3:41   ` npostavs
2017-03-29  6:28     ` Евгени Колев
2017-03-29 23:46       ` npostavs
2017-04-01 21:40         ` npostavs
2017-04-03  7:49           ` Евгени Колев

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).