From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: [ELPA] New package: compact-docstrings Date: Sun, 26 Jun 2016 13:30:42 -0400 Message-ID: <57701142.1040001@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ihFb705ET1a8b1UsBuA5XGXVCdCeHf8ht" X-Trace: ger.gmane.org 1466962303 23476 80.91.229.3 (26 Jun 2016 17:31:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jun 2016 17:31:43 +0000 (UTC) Cc: Stefan Monnier To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 26 19:31:35 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bHDuA-0006D1-N5 for ged-emacs-devel@m.gmane.org; Sun, 26 Jun 2016 19:31:34 +0200 Original-Received: from localhost ([::1]:54744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHDu9-0006dN-O1 for ged-emacs-devel@m.gmane.org; Sun, 26 Jun 2016 13:31:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHDtX-0006Qt-Gb for emacs-devel@gnu.org; Sun, 26 Jun 2016 13:30:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHDtS-0007xQ-DC for emacs-devel@gnu.org; Sun, 26 Jun 2016 13:30:54 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.75]:63521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHDtS-0007xK-3k for emacs-devel@gnu.org; Sun, 26 Jun 2016 13:30:50 -0400 Original-Received: from [18.189.1.110] ([18.189.1.110]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0Lud28-1bQGOs0QhE-00zkJM; Sun, 26 Jun 2016 19:30:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 X-Provags-ID: V03:K0:7bMWY2s4iM8ngeBC+6SDKYqINQD3ImXlXa9tzdjbhI5hsGdQzzF /6jo/0XRINw9HjQzIJildAB8XhBGiiGUydEZkjTtWKYAxQ+oUK6MoCJUO/mK48xygF69e9q o2Ax2/xLmfkroPKTFOvpZdsrMZIqds46BXc/qVdtJ0zPA18lVdYBRhzjab3fhnYcCMtBC5Z wCMxBVp0hjlN5eEoWYHWQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ewKPp381aXI=:erXj62g+kTSjz1kyYjCZzR opFnuQ6SekB6wOrJ1Qtn9QC94bdeFBRuAkMuCDETZHI6gQEDEq0wggaAy8eqXzK04/RgvY9h3 F00V/9iHS62+Gxwi4syd3r/6B7BQ1r1pAirLF2NBzepou1lOEzLzwhoYKXn+i8cEv8ny/PAMg Oej6sRmLrWF/MSSva1AKL/vT8+1uZ/UEcR/n0rNNPoqUY/mA+45SGFiwwTvGayCF6hPjhri+I 6S+TD+47mRZhqML16RUCEzDDWzjk5oVwIfBx2uZvKJLsEPLHK/Ffs1HRalBZOW+6f1L6ZoJ/s Uc801KNeFy3FRejYvwXVRgBhxLFTGJCDwwFTV2kNR7rQN9H7CUqDX0R2+dySbL2jjq8yaN+Op a/8rOIiIkksQ4o2+S/06eH08Pgkiw0kfIf6WkzpBmaQ+nKvfW8z7i9VKbw5O5bAOQsO5xgss7 7tWeXwRz1d5VuGBuUh26ZoEypVGaVrQozBw2DPF9AKn0QC/zXd64+68OT18DOcxZmmhsvBbTB uw9UEEw/ZJyE/QRcooUJi614GNzNJvaCxDpongsgEcgbDluXc7jUKBjA9ZVPj6J7Tq72iVOv6 yDHF+dagLTjsvNpf6nor6XYQzI7eBSZutUGXD2nmkMQBuzeztq8InNMluWGWRM67Hp61H+5NG 0+KM98/TdsI1ujqSgmjZibtXxlFnaHOBKpVgHbJrHx51ndMdVWC+T3vMY5z0zeSLgUsk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.75 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204779 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ihFb705ET1a8b1UsBuA5XGXVCdCeHf8ht Content-Type: multipart/mixed; boundary="h8mJMmoQBOR8VrWgV4RiDs0pwKRQaVqiT" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Emacs developers Cc: Stefan Monnier Message-ID: <57701142.1040001@gmail.com> Subject: [ELPA] New package: compact-docstrings --h8mJMmoQBOR8VrWgV4RiDs0pwKRQaVqiT Content-Type: multipart/mixed; boundary="------------030504010301020802060004" This is a multi-part message in MIME format. --------------030504010301020802060004 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi emacs-devel, As a follow-up to the recent discussion on docstring styles (see https://= lists.gnu.org/archive/html/emacs-devel/2016-05/msg00240.html), I just pus= hed the attached package to scratch/compact-docstrings (this is my first = push to ELPA, so please excuse potential mistakes). This very simple package defines a `compact-docstrings-mode' mode mode. W= hen activated, empty lines in docstrings and doc comments are displayed i= n a different font (currently defaulting to half-height). In practice, th= is shrinks white space in docstrings to save space, while still clearly s= eparating consecutive paragraphs. The development of this package was sug= gested by Stefan; I've been using it for about a week now, and it works p= retty well for me. The github page at https://github.com/cpitclaudel/compact-docstrings has = a screenshot. Opinions and advice welcome! Cheers, Cl=C3=A9ment. --------------030504010301020802060004 Content-Type: text/x-emacs-lisp; name="compact-docstrings.el" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="compact-docstrings.el" ;;; compact-docstrings.el --- Shrink blank lines in docstrings and doc co= mments ;; Copyright (C) 2016 Free Software Foundation, Inc. ;; Author: Cl=C3=A9ment Pit-Claudel ;; Maintainer: Cl=C3=A9ment Pit-Claudel ;; URL: https://github.com/cpitclaudel/compact-docstrings ;; Package-Version: 0.1 ;; Keywords: convenience, faces, lisp, maint, c ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; Shrink blank lines in docstrings and doc comments ;; ;; Enable locally with `compact-docstrings-mode': ;; (add-hook 'some-mode-hook #'compact-docstrings-mode) ;; ;; Enable globally (in all programming modes) with ;; (add-hook 'after-init-hook #'global-compact-docstrings--mode) ;;; Code: (defgroup compact-docstrings nil "Shrink empty lines in docstrings and doc comments." :group 'faces) (defface compact-docstrings-face '((t :height 0.5)) "Face applied to blank lines in docstrings." :group 'compact-docstrings) (defcustom compact-docstrings-only-doc-blocks t "When nil, also shrink blank lines in regular strings and comments." :group 'compact-docstrings :type 'boolean) (defun compact-docstrings--matcher (bound) "Find blank line in docstring, looking in point .. BOUND." (let ((found nil)) (while (and (not found) (re-search-forward "^\\s-*\n" bound t)) (let ((syntax (syntax-ppss))) (when (and (or (nth 3 syntax) ;; In string (nth 4 syntax)) ;; In comment (or (not compact-docstrings-only-doc-blocks) (let ((face (get-text-property (point) 'face))) (or (eq face 'font-lock-doc-face) (and (listp face) (memq 'font-lock-doc-face = face)))))) (setq found t)))) found)) (defconst compact-docstrings--keywords '((compact-docstrings--matcher 0 'compact-docstrings-face prepend)) 'ap= pend) ;;;###autoload (define-minor-mode compact-docstrings-mode "Shrink empty lines in docstrings and doc comments." :lighter " compact" (if compact-docstrings-mode (font-lock-add-keywords nil compact-docstrings--keywords 'append) (font-lock-remove-keywords nil compact-docstrings--keywords)) (if (fboundp #'font-lock-flush) (font-lock-flush) (with-no-warnings (font-lock-fontify-buffer)))) (defun compact-docstrings--mode-on () "Turn on `compact-docstrings-mode', if appropriate." (when (derived-mode-p major-mode #'prog-mode) (compact-docstrings-mode))) ;;;###autoload (defalias 'shrink-docstrings #'compact-docstrings--mode-on) ;;;###autoload (define-globalized-minor-mode global-compact-docstrings-mode compact-docs= trings-mode compact-docstrings--mode-on :init-value nil) (provide 'compact-docstrings) ;;; compact-docstrings.el ends here --------------030504010301020802060004-- --h8mJMmoQBOR8VrWgV4RiDs0pwKRQaVqiT-- --ihFb705ET1a8b1UsBuA5XGXVCdCeHf8ht Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXcBFCAAoJEPqg+cTm90wjCssP/jS7zKbL8PkBg0gh3qf5JEmz bLKFwWiTVY7M1VWPD7gSDV7I3mOfJXd12n4CHmxvPNy+dc56sDu6CjQLHSslD6Ff tBnrLJ2YJuplD099/5W1a8B0Rxsz4XJLrU/2i1naZ6zExagab4nXGILWI0FHNHjl cEXD7hDjo89y2afLVxl604/aCqfX719IA92u/S7LrdLwS0t8GxDiRlup31tsDQt9 lYrxr5UFpS4YyApJJ0RbnixRiDRTcGdnxcRkigkfWteHWi4kBO4fVIG/UASGYTCy hDIwaLUwqpZNt05c8ZMdyxorP6K0eBie2VUoXIEEosp9JFxmNtIZ96NNsT821ZbA L5O5jQbZdAdpqMD9j53YaZVEjA8pjoVzYJ8p1Eqn05B0hf54/885r54A4I5L0Nvs AaAjt/j0wNeN8p/PYOXUWSLgWlnTxIoEwmwIhOPQxVu4zBOwgHP43w0vOwKAcvxc O7OoKfn5EXFcdRqXw9A7OGPWjq9Bg7bvlH2tunmieV3hft51R0QYWvkpSqxOZIOV v1zQiqY/J1jxX8J1XgtkcdIEUGv2Zxlw87Dr8+G7jdhreBYmQykqKDwJHwHYM2sY 5jayERs7bSncPpvEzN7fW0yRFmExyruM7vI9bavsD60n3SqzAhEDMktg5NfHAmPd /Wb/SzKTfhvUEEnJDLuY =3II7 -----END PGP SIGNATURE----- --ihFb705ET1a8b1UsBuA5XGXVCdCeHf8ht--