X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d76bf86f438d4f5f9fe493ab76f02ffc78f3ae2e..732fd4c7e11debd61c97eaaba3038d61e6ec7024:/lisp/cedet/semantic/wisent/python.el diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el index 8ca398ef27..a8348d2ab8 100644 --- a/lisp/cedet/semantic/wisent/python.el +++ b/lisp/cedet/semantic/wisent/python.el @@ -1,6 +1,6 @@ ;;; wisent-python.el --- Semantic support for Python -;; Copyright (C) 2002, 2004, 2006-2013 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2006-2015 Free Software Foundation, Inc. ;; Author: Richard Kim ;; Maintainer: Richard Kim @@ -39,6 +39,7 @@ (require 'semantic/find) (require 'semantic/dep) (require 'semantic/ctxt) +(require 'semantic/format) (eval-when-compile (require 'cl)) @@ -485,6 +486,20 @@ Return a list as per `semantic-ctxt-current-symbol'. Return nil if there is nothing relevant." nil) +;;; Tag Formatting +;; +(define-mode-local-override semantic-format-tag-abbreviate python-mode (tag &optional parent color) + "Format an abbreviated tag for python. +Shortens 'code' tags, but passes through for others." + (cond ((semantic-tag-of-class-p tag 'code) + ;; Just take the first line. + (let ((name (semantic-tag-name tag))) + (when (string-match "\n" name) + (setq name (substring name 0 (match-beginning 0)))) + name)) + (t + (semantic-format-tag-abbreviate-default tag parent color)))) + ;;; Enable Semantic in `python-mode'. ;;