guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: emacs: Fill package heading in Info buffers.


From: Alex Kost
Subject: 03/03: emacs: Fill package heading in Info buffers.
Date: Tue, 14 Jul 2015 15:50:16 +0000

alezost pushed a commit to branch master
in repository guix.

commit dbe422aba862b2f4ff204743be13e2d3fb255fa8
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jul 13 22:08:11 2015 +0200

    emacs: Fill package heading in Info buffers.
    
    * emacs/guix-info.el (guix-package-info-fill-heading): New variable.
      (guix-package-info-insert-heading): Fill heading if needed.
    
    Co-authored-by: Alex Kost <address@hidden>
---
 emacs/guix-info.el |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/emacs/guix-info.el b/emacs/guix-info.el
index bb21024..f17ce01 100644
--- a/emacs/guix-info.el
+++ b/emacs/guix-info.el
@@ -1,6 +1,7 @@
 ;;; guix-info.el --- Info buffers for displaying entries   -*- 
lexical-binding: t -*-
 
-;; Copyright © 2014 Alex Kost <address@hidden>
+;; Copyright © 2014, 2015 Alex Kost <address@hidden>
+;; Copyright © 2015 Ludovic Courtès <address@hidden>
 
 ;; This file is part of GNU Guix.
 
@@ -482,6 +483,12 @@ If nil, insert package in a default way.")
 (defvar guix-package-info-heading-params '(synopsis description)
   "List of parameters displayed in a heading along with name and version.")
 
+(defcustom guix-package-info-fill-heading t
+  "If nil, insert heading parameters in a raw form, without
+filling them to fit the window."
+  :type 'boolean
+  :group 'guix-package-info)
+
 (defun guix-package-info-insert-heading (entry)
   "Insert the heading for package ENTRY.
 Show package name, version, and `guix-package-info-heading-params'."
@@ -494,8 +501,12 @@ Show package name, version, and 
`guix-package-info-heading-params'."
                 (face (guix-get-symbol (symbol-name param)
                                        'info 'package)))
             (when val
-              (guix-format-insert val (and (facep face) face))
-              (insert "\n\n"))))
+              (let* ((col (min (window-width) fill-column))
+                     (val (if guix-package-info-fill-heading
+                              (guix-get-filled-string val col)
+                            val)))
+                (guix-format-insert val (and (facep face) face))
+                (insert "\n\n")))))
         guix-package-info-heading-params))
 
 (defun guix-package-info-insert-with-heading (entry)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]