From unknown Sat Sep 13 08:57:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17672: 24.4.50; [PATCH] python.el: Skeleton to insert import statements Resent-From: Matthias Meulien Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jun 2014 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 17672@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140174297110726 (code B ref -1); Mon, 02 Jun 2014 21:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Jun 2014 21:02:51 +0000 Received: from localhost ([127.0.0.1]:41347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrZNa-0002mv-08 for submit@debbugs.gnu.org; Mon, 02 Jun 2014 17:02:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39394) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrZNX-0002ma-Eg for submit@debbugs.gnu.org; Mon, 02 Jun 2014 17:02:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrZNQ-0006ne-H9 for submit@debbugs.gnu.org; Mon, 02 Jun 2014 17:02:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrZNQ-0006na-E7 for submit@debbugs.gnu.org; Mon, 02 Jun 2014 17:02:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrZNN-0000RS-T2 for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 17:02:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrZNM-0006my-1N for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 17:02:37 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:33680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrZNL-0006mk-Lu for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 17:02:35 -0400 Received: by mail-wi0-f177.google.com with SMTP id f8so5422949wiw.4 for ; Mon, 02 Jun 2014 14:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=e4xE22vZ64s+Pz25eVM7qnaTky9NAtgqNujEyVZJFW4=; b=fd7ad018B4hXDQpIJDUB0M9lU1bfFcPArPo9MAjwhzC4snt0BvWNmTsIwBfizxCKd1 PVOvLLI8LK9d/VUru+yV9vE08GQwpLN9ug7EveDeGNR/hvF6UI9gfwtRppU70aA/9oYJ 3TU+1BW0Pc2UvK8ewbS+st9ECxQ7MGKsjc/B+zej3Hz/6gBbChXxVIR/adDqUw8zFMVt De22FgflOX93PSphs5IFpFrBFyrhY//p/vCZm/rsD1PhJ5vwLgQAWWPKbhpB0h+ECYt1 24QxECvBf0bHcsF94uQHPJ0LbXWZ+cABfwlzptw8KUo7P//9/cfjKPBix88YAZ/D81yG OJDQ== X-Received: by 10.180.107.130 with SMTP id hc2mr25550975wib.7.1401742953761; Mon, 02 Jun 2014 14:02:33 -0700 (PDT) Received: from choubidou.localdomain ([2a01:e35:2ef1:4540:e2b9:a5ff:fe0b:e998]) by mx.google.com with ESMTPSA id qq5sm35610459wic.10.2014.06.02.14.02.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jun 2014 14:02:32 -0700 (PDT) From: Matthias Meulien Date: Mon, 02 Jun 2014 23:02:31 +0200 Message-ID: <8738fnc9eg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain; format=flowed The attach patch defines a skeleton to insert import statements in Python mode. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-python.el-Skeleton-to-insert-import-statements.patch Content-Description: python.el: Skeleton to insert import statement >From 2342a864c8787f59039978196501a007ddb13e5c Mon Sep 17 00:00:00 2001 From: Matthias Meulien Date: Mon, 2 Jun 2014 22:37:07 +0200 Subject: [PATCH] python.el: Skeleton to insert import statements --- lisp/progmodes/python.el | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 436442d..3d4d5a1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -155,15 +155,16 @@ ;; the shell completion in background so you should run ;; `python-shell-send-buffer' from time to time to get better results. -;; Skeletons: 6 skeletons are provided for simple inserting of class, -;; def, for, if, try and while. These skeletons are integrated with -;; abbrev. If you have `abbrev-mode' activated and +;; Skeletons: 7 skeletons are provided for simple inserting of class, +;; def, for, import, if, try and while. These skeletons are +;; integrated with abbrev. If you have `abbrev-mode' activated and ;; `python-skeleton-autoinsert' is set to t, then whenever you type ;; the name of any of those defined and hit SPC, they will be ;; automatically expanded. As an alternative you can use the defined ;; skeleton commands: `python-skeleton-class', `python-skeleton-def' -;; `python-skeleton-for', `python-skeleton-if', `python-skeleton-try' -;; and `python-skeleton-while'. +;; `python-skeleton-for', `python-skeleton-import', +;; `python-skeleton-if', `python-skeleton-try' and +;; `python-skeleton-while'. ;; FFAP: You can find the filename for a given module when using ffap ;; out of the box. This feature needs an inferior python shell @@ -253,6 +254,7 @@ (define-key map "\C-c\C-td" 'python-skeleton-def) (define-key map "\C-c\C-tf" 'python-skeleton-for) (define-key map "\C-c\C-ti" 'python-skeleton-if) + (define-key map "\C-c\C-tm" 'python-skeleton-import) (define-key map "\C-c\C-tt" 'python-skeleton-try) (define-key map "\C-c\C-tw" 'python-skeleton-while) ;; Shell interaction @@ -2957,6 +2959,12 @@ The skeleton will be bound to python-skeleton-NAME." > _ \n '(python-skeleton--else) | ^) +(python-skeleton-define import nil + "Import from module: " + "from " str & " " | -5 + "import " + ("Identifier: " str ", ") -2 \n _) + (python-skeleton-define try nil nil "try:" \n -- 1.9.3 --=-=-= Content-Type: text/plain In GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2014-05-27 on choubidou Windowing system distributor `The X.Org Foundation', version 11.0.11501000 Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB Important settings: value of $LC_COLLATE: C value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix Major mode: Org Minor modes in effect: diff-auto-refine-mode: t flyspell-mode: t shell-dirtrack-mode: t show-paren-mode: t global-auto-complete-mode: t global-semantic-mru-bookmark-mode: t global-semanticdb-minor-mode: t global-semantic-idle-scheduler-mode: t semantic-mode: t desktop-save-mode: t auto-image-file-mode: t electric-pair-mode: t icomplete-mode: t global-auto-revert-mode: t auto-insert-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t use-hard-newlines: 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 auto-fill-function: org-auto-fill-function transient-mark-mode: t Recent input: e m e n t s M-p M-p M-p M-p C-b C-b C-b C-d C-x d g q M-p C-b C-b ~ C-x d g p p d x y C-v C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-e M-< C-_ C-_ C-x C-f C-x b p y t h C-s i m p o r t C-S-s C-s C-s C-s C-s C-s C-g C-x b s h e l l 3 C-x C-f 0 0 C-n C-n C-x b p y t h o n M-g g 2 9 5 7 C-e C-n C-n C-n C-n C-n C-n C-n C-e C-p C-e C-n C-n C-n C-e C-x C-s C-x b * s h < 3 M-p M-p M-p SPC - - a m e n d M-p M-p C-x C-f M-p g C-_ C-x k M-p M-p M-p M-p M-p M-p M-p M-n M-p M-p M-p M-p M-p M-p C-x b 0 0 C-x C-f 0 0 C-x C-f 0 0 1 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p M-< C-x d C-x 2 C-x d p r o e m p a t g C-x o R M-p g C-x o C-x o g n C-x o C-x b p y t h o M-< C-n C-n C-n C-n M-f C-n C-n C-x o C-x o M-x r e p o r t SPC e m Recent messages: Omitting... (Nothing to omit) Omitting... (Nothing to omit) Move: 1 file Omitting... Omitted 7 lines. Omitting... Omitted 3 lines. Mark set Load-path shadows: None found. Features: (shadow sort mail-extr gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime password-cache dig mailcap gnus-sum emacsbug sendmail find-dired grep debug org-table org-id conf-mode diff-mode add-log log-view pcvs-util descr-text hl-line rect dabbrev bookmark tabify info-look pp derived pcase time-stamp semantic/edit diary-lib diary-loaddefs reftex-dcr reftex reftex-vars tex-mode warnings inversion semantic/bovine/c hideif semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc semantic/analyze/refs cwarn sh-script executable css-mode smie semantic/wisent/javascript-jv semantic/wisent/js-wy semantic/java semantic/doc cap-words superword subword js json imenu arc-mode archive-mode rst semantic/tag-write face-remap vc-dir ewoc vc vc-dispatcher generic eieio-opt help-mode misearch multi-isearch mule-util semantic/html sgml-mode semantic/bovine/make semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/bovine/make-by semantic/bovine make-mode dired-aux avoid flyspell ox-latex ox-icalendar ox-html ox-ascii ox-publish ox goto-addr org-element org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m vc-git semantic/tag-file semantic/db-file data-debug cedet-files semantic/wisent/python semantic/decorate/include semantic/db-find semantic/db-ref semantic/decorate/mode semantic/decorate pulse semantic/dep semantic/wisent/python-wy semantic/wisent semantic/wisent/wisent rx python ob-sh shell ob-plantuml paren choubidou-custom cus-edit cus-start cus-load gnus-demon nntp gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls utf7 netrc parse-time gnus-spec gnus-win nnoo gnus-int gnus-range message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus gnus-ems nnheader gnus-util mail-utils mm-util mail-prsvr wid-edit gnus-dired dired-x dired org-capture org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs dictionary link connection irfc url-vars flymake-csslint php-mode etags cc-langs speedbar sb-image dframe sql view thingatpt flymake-jslint flymake-python-pyflakes flymake-easy advice help-fns flymake compile comint hideshow skeleton find-file whitespace auto-complete edmacro kmacro cl-macs popup cl minimap semantic/mru-bookmark ring semantic/db-mode semantic/db gv eieio-base semantic/idle semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet ispell desktop frameset server woman man cl-loaddefs cl-lib ansi-color image-file tar-mode saveplace elec-pair icomplete windmove autorevert filenotify autoinsert cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs generic-x Django-doc-autoloads auto-complete-autoloads color-theme-solarized-autoloads doctags-autoloads flymake-csslint-autoloads flymake-jslint-autoloads flymake-easy-autoloads gist-autoloads finder-inf gh-autoloads eieio byte-opt bytecomp byte-compile cconv eieio-core info easymenu gnuplot-autoloads graphviz-dot-mode-autoloads htmlize-autoloads logito-autoloads php-mode-autoloads popup-autoloads symbols-mode-autoloads package time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 1100492 207925) (symbols 48 63889 0) (miscs 40 8990 837) (strings 32 406285 30443) (string-bytes 1 8349847) (vectors 16 64126) (vector-slots 8 1844234 141588) (floats 8 408 778) (intervals 56 43444 0) (buffers 960 239) (heap 1024 122508 19429)) --=-=-=-- From unknown Sat Sep 13 08:57:13 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Matthias Meulien Subject: bug#17672: closed (Re: bug#17672: 24.4.50; [PATCH] python.el: Skeleton to insert import statements) Message-ID: References: <8738fnc9eg.fsf@gmail.com> X-Gnu-PR-Message: they-closed 17672 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 17672@debbugs.gnu.org Date: Thu, 12 Jun 2014 02:36:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1402540563-19762-1" This is a multi-part message in MIME format... ------------=_1402540563-19762-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17672: 24.4.50; [PATCH] python.el: Skeleton to insert import statements which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 17672@debbugs.gnu.org. --=20 17672: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17672 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1402540563-19762-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17672-done) by debbugs.gnu.org; 12 Jun 2014 02:35:51 +0000 Received: from localhost ([127.0.0.1]:44725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wuurm-00058D-Vw for submit@debbugs.gnu.org; Wed, 11 Jun 2014 22:35:51 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22330) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wuurj-00057o-Qm for 17672-done@debbugs.gnu.org; Wed, 11 Jun 2014 22:35:48 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4mEhQYDSSIBAjSGReOegeEOASpGYFqg0wh X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4mEhQYDSSIBAjSGReOegeEOASpGYFqg0wh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="66632190" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Jun 2014 22:35:41 -0400 Received: by pastel.home (Postfix, from userid 20848) id 30EAE60358; Wed, 11 Jun 2014 22:35:41 -0400 (EDT) From: Stefan Monnier To: Matthias Meulien Subject: Re: bug#17672: 24.4.50; [PATCH] python.el: Skeleton to insert import statements Message-ID: References: <8738fnc9eg.fsf@gmail.com> Date: Wed, 11 Jun 2014 22:35:41 -0400 In-Reply-To: <8738fnc9eg.fsf@gmail.com> (Matthias Meulien's message of "Mon, 02 Jun 2014 23:02:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 17672-done Cc: 17672-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > The attach patch defines a skeleton to insert import statements in > Python mode. Thanks, installed, Stefan ------------=_1402540563-19762-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Jun 2014 21:02:51 +0000 Received: from localhost ([127.0.0.1]:41347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrZNa-0002mv-08 for submit@debbugs.gnu.org; Mon, 02 Jun 2014 17:02:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39394) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrZNX-0002ma-Eg for submit@debbugs.gnu.org; Mon, 02 Jun 2014 17:02:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrZNQ-0006ne-H9 for submit@debbugs.gnu.org; Mon, 02 Jun 2014 17:02:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrZNQ-0006na-E7 for submit@debbugs.gnu.org; Mon, 02 Jun 2014 17:02:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrZNN-0000RS-T2 for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 17:02:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrZNM-0006my-1N for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 17:02:37 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:33680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrZNL-0006mk-Lu for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 17:02:35 -0400 Received: by mail-wi0-f177.google.com with SMTP id f8so5422949wiw.4 for ; Mon, 02 Jun 2014 14:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=e4xE22vZ64s+Pz25eVM7qnaTky9NAtgqNujEyVZJFW4=; b=fd7ad018B4hXDQpIJDUB0M9lU1bfFcPArPo9MAjwhzC4snt0BvWNmTsIwBfizxCKd1 PVOvLLI8LK9d/VUru+yV9vE08GQwpLN9ug7EveDeGNR/hvF6UI9gfwtRppU70aA/9oYJ 3TU+1BW0Pc2UvK8ewbS+st9ECxQ7MGKsjc/B+zej3Hz/6gBbChXxVIR/adDqUw8zFMVt De22FgflOX93PSphs5IFpFrBFyrhY//p/vCZm/rsD1PhJ5vwLgQAWWPKbhpB0h+ECYt1 24QxECvBf0bHcsF94uQHPJ0LbXWZ+cABfwlzptw8KUo7P//9/cfjKPBix88YAZ/D81yG OJDQ== X-Received: by 10.180.107.130 with SMTP id hc2mr25550975wib.7.1401742953761; Mon, 02 Jun 2014 14:02:33 -0700 (PDT) Received: from choubidou.localdomain ([2a01:e35:2ef1:4540:e2b9:a5ff:fe0b:e998]) by mx.google.com with ESMTPSA id qq5sm35610459wic.10.2014.06.02.14.02.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jun 2014 14:02:32 -0700 (PDT) From: Matthias Meulien To: bug-gnu-emacs@gnu.org Subject: 24.4.50; [PATCH] python.el: Skeleton to insert import statements Date: Mon, 02 Jun 2014 23:02:31 +0200 Message-ID: <8738fnc9eg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain; format=flowed The attach patch defines a skeleton to insert import statements in Python mode. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-python.el-Skeleton-to-insert-import-statements.patch Content-Description: python.el: Skeleton to insert import statement >From 2342a864c8787f59039978196501a007ddb13e5c Mon Sep 17 00:00:00 2001 From: Matthias Meulien Date: Mon, 2 Jun 2014 22:37:07 +0200 Subject: [PATCH] python.el: Skeleton to insert import statements --- lisp/progmodes/python.el | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 436442d..3d4d5a1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -155,15 +155,16 @@ ;; the shell completion in background so you should run ;; `python-shell-send-buffer' from time to time to get better results. -;; Skeletons: 6 skeletons are provided for simple inserting of class, -;; def, for, if, try and while. These skeletons are integrated with -;; abbrev. If you have `abbrev-mode' activated and +;; Skeletons: 7 skeletons are provided for simple inserting of class, +;; def, for, import, if, try and while. These skeletons are +;; integrated with abbrev. If you have `abbrev-mode' activated and ;; `python-skeleton-autoinsert' is set to t, then whenever you type ;; the name of any of those defined and hit SPC, they will be ;; automatically expanded. As an alternative you can use the defined ;; skeleton commands: `python-skeleton-class', `python-skeleton-def' -;; `python-skeleton-for', `python-skeleton-if', `python-skeleton-try' -;; and `python-skeleton-while'. +;; `python-skeleton-for', `python-skeleton-import', +;; `python-skeleton-if', `python-skeleton-try' and +;; `python-skeleton-while'. ;; FFAP: You can find the filename for a given module when using ffap ;; out of the box. This feature needs an inferior python shell @@ -253,6 +254,7 @@ (define-key map "\C-c\C-td" 'python-skeleton-def) (define-key map "\C-c\C-tf" 'python-skeleton-for) (define-key map "\C-c\C-ti" 'python-skeleton-if) + (define-key map "\C-c\C-tm" 'python-skeleton-import) (define-key map "\C-c\C-tt" 'python-skeleton-try) (define-key map "\C-c\C-tw" 'python-skeleton-while) ;; Shell interaction @@ -2957,6 +2959,12 @@ The skeleton will be bound to python-skeleton-NAME." > _ \n '(python-skeleton--else) | ^) +(python-skeleton-define import nil + "Import from module: " + "from " str & " " | -5 + "import " + ("Identifier: " str ", ") -2 \n _) + (python-skeleton-define try nil nil "try:" \n -- 1.9.3 --=-=-= Content-Type: text/plain In GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2014-05-27 on choubidou Windowing system distributor `The X.Org Foundation', version 11.0.11501000 Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB Important settings: value of $LC_COLLATE: C value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix Major mode: Org Minor modes in effect: diff-auto-refine-mode: t flyspell-mode: t shell-dirtrack-mode: t show-paren-mode: t global-auto-complete-mode: t global-semantic-mru-bookmark-mode: t global-semanticdb-minor-mode: t global-semantic-idle-scheduler-mode: t semantic-mode: t desktop-save-mode: t auto-image-file-mode: t electric-pair-mode: t icomplete-mode: t global-auto-revert-mode: t auto-insert-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t use-hard-newlines: 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 auto-fill-function: org-auto-fill-function transient-mark-mode: t Recent input: e m e n t s M-p M-p M-p M-p C-b C-b C-b C-d C-x d g q M-p C-b C-b ~ C-x d g p p d x y C-v C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-e M-< C-_ C-_ C-x C-f C-x b p y t h C-s i m p o r t C-S-s C-s C-s C-s C-s C-s C-g C-x b s h e l l 3 C-x C-f 0 0 C-n C-n C-x b p y t h o n M-g g 2 9 5 7 C-e C-n C-n C-n C-n C-n C-n C-n C-e C-p C-e C-n C-n C-n C-e C-x C-s C-x b * s h < 3 M-p M-p M-p SPC - - a m e n d M-p M-p C-x C-f M-p g C-_ C-x k M-p M-p M-p M-p M-p M-p M-p M-n M-p M-p M-p M-p M-p M-p C-x b 0 0 C-x C-f 0 0 C-x C-f 0 0 1 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p M-< C-x d C-x 2 C-x d p r o e m p a t g C-x o R M-p g C-x o C-x o g n C-x o C-x b p y t h o M-< C-n C-n C-n C-n M-f C-n C-n C-x o C-x o M-x r e p o r t SPC e m Recent messages: Omitting... (Nothing to omit) Omitting... (Nothing to omit) Move: 1 file Omitting... Omitted 7 lines. Omitting... Omitted 3 lines. Mark set Load-path shadows: None found. Features: (shadow sort mail-extr gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime password-cache dig mailcap gnus-sum emacsbug sendmail find-dired grep debug org-table org-id conf-mode diff-mode add-log log-view pcvs-util descr-text hl-line rect dabbrev bookmark tabify info-look pp derived pcase time-stamp semantic/edit diary-lib diary-loaddefs reftex-dcr reftex reftex-vars tex-mode warnings inversion semantic/bovine/c hideif semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc semantic/analyze/refs cwarn sh-script executable css-mode smie semantic/wisent/javascript-jv semantic/wisent/js-wy semantic/java semantic/doc cap-words superword subword js json imenu arc-mode archive-mode rst semantic/tag-write face-remap vc-dir ewoc vc vc-dispatcher generic eieio-opt help-mode misearch multi-isearch mule-util semantic/html sgml-mode semantic/bovine/make semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/bovine/make-by semantic/bovine make-mode dired-aux avoid flyspell ox-latex ox-icalendar ox-html ox-ascii ox-publish ox goto-addr org-element org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m vc-git semantic/tag-file semantic/db-file data-debug cedet-files semantic/wisent/python semantic/decorate/include semantic/db-find semantic/db-ref semantic/decorate/mode semantic/decorate pulse semantic/dep semantic/wisent/python-wy semantic/wisent semantic/wisent/wisent rx python ob-sh shell ob-plantuml paren choubidou-custom cus-edit cus-start cus-load gnus-demon nntp gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls utf7 netrc parse-time gnus-spec gnus-win nnoo gnus-int gnus-range message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus gnus-ems nnheader gnus-util mail-utils mm-util mail-prsvr wid-edit gnus-dired dired-x dired org-capture org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs dictionary link connection irfc url-vars flymake-csslint php-mode etags cc-langs speedbar sb-image dframe sql view thingatpt flymake-jslint flymake-python-pyflakes flymake-easy advice help-fns flymake compile comint hideshow skeleton find-file whitespace auto-complete edmacro kmacro cl-macs popup cl minimap semantic/mru-bookmark ring semantic/db-mode semantic/db gv eieio-base semantic/idle semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet ispell desktop frameset server woman man cl-loaddefs cl-lib ansi-color image-file tar-mode saveplace elec-pair icomplete windmove autorevert filenotify autoinsert cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs generic-x Django-doc-autoloads auto-complete-autoloads color-theme-solarized-autoloads doctags-autoloads flymake-csslint-autoloads flymake-jslint-autoloads flymake-easy-autoloads gist-autoloads finder-inf gh-autoloads eieio byte-opt bytecomp byte-compile cconv eieio-core info easymenu gnuplot-autoloads graphviz-dot-mode-autoloads htmlize-autoloads logito-autoloads php-mode-autoloads popup-autoloads symbols-mode-autoloads package time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 1100492 207925) (symbols 48 63889 0) (miscs 40 8990 837) (strings 32 406285 30443) (string-bytes 1 8349847) (vectors 16 64126) (vector-slots 8 1844234 141588) (floats 8 408 778) (intervals 56 43444 0) (buffers 960 239) (heap 1024 122508 19429)) --=-=-=-- ------------=_1402540563-19762-1--