all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Accessibility: fill-column for man pages and docstring help
@ 2008-12-24  5:21 Samuel Wales
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Wales @ 2008-12-24  5:21 UTC (permalink / raw)
  To: help-gnu-emacs

I use very large fonts.  This causes many things in emacs to be
unreadable.  The biggest ones are:

  1.  C-h f, C-h v, etc.: in order to read, I have to manually adjust
fill-column and reformat paragraphs.  Difficult.

  2.  Man pages.  I don't know how to adjust the fill column.

Is there a fix for both of these?

Notes:

     Note that readability also improves when fill-column is
     short.  This is why magazines and newspapers and some
     science papers have short columns.

     Also note that some people are likely to start using
     org-mode on small devices.

     Is it possible to use a shorter fill-column, say 60, in
     docstrings?

     I realize that this might be difficult, if the code
     itself uses a long fill-column, unless there is a way
     to make fill-paragraph work differently on docstrings.
     I also realize that it might be hard to automate the
     fixing of existing docstrings.

Note that some docstrings use lines that should not be folded.

Reducing font size is not an option.  This is an accessibility issue.

Thanks.

-- 
Myalgic encephalomyelitis denialists are knowingly causing further
suffering and death by opposing biomedical research on this serious
infectious disease.  Do you care about the world?
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm




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

* Re: Accessibility: fill-column for man pages and docstring help
       [not found] <mailman.3327.1230132083.26697.help-gnu-emacs@gnu.org>
@ 2008-12-25  4:34 ` Andreas Politz
  2009-01-01 13:20 ` Dmitry Dzhus
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Politz @ 2008-12-25  4:34 UTC (permalink / raw)
  To: help-gnu-emacs

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

Samuel Wales wrote:
> I use very large fonts.  This causes many things in emacs to be
> unreadable.  The biggest ones are:
> 
>   1.  C-h f, C-h v, etc.: in order to read, I have to manually adjust
> fill-column and reformat paragraphs.  Difficult.

Some time ago, I wanted something similar such that the help text
is always kept untruncated despite windowsize. I wrote some elisp
to do that. I don't know if that's working for you or if there is
a simpler way. It's attached to this mail.

It's basically using fill-region, so you might just want to use
that.

> 
>   2.  Man pages.  I don't know how to adjust the fill column.
> 
That's fairly easy. If you use woman, you can customize
woman-fill-column and maybe use woman-reformat-last-file
afterwards.
man-mode respects the MANWIDTH environment variable, so something
like (setenv "MANWIDTH" "40") should work. Maybe even put it in
your shells initfile.

-ap

> Is there a fix for both of these?
> 
> Notes:
> 
>      Note that readability also improves when fill-column is
>      short.  This is why magazines and newspapers and some
>      science papers have short columns.
> 
>      Also note that some people are likely to start using
>      org-mode on small devices.
> 
>      Is it possible to use a shorter fill-column, say 60, in
>      docstrings?
> 
>      I realize that this might be difficult, if the code
>      itself uses a long fill-column, unless there is a way
>      to make fill-paragraph work differently on docstrings.
>      I also realize that it might be hard to automate the
>      fixing of existing docstrings.
> 
> Note that some docstrings use lines that should not be folded.
> 
> Reducing font size is not an option.  This is an accessibility issue.
> 
> Thanks.
> 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: refill-help-buffer.el --]
[-- Type: text/x-emacs-lisp; name="refill-help-buffer.el", Size: 1869 bytes --]

(defvar refill-help-buffer-max-fill-column 68)

(defun refill-help-buffer (&optional frame)
  (interactive)
  (walk-windows
   #'(lambda (win)
       (with-selected-window win
         (save-excursion
           (when (and (eq major-mode 'help-mode)
                      (or (< fill-column refill-help-buffer-max-fill-column)
                          (window-truncated-p))
                      (progn
                        (goto-char (point-min))
                        (forward-sentence)
                        (re-search-backward "variable\\|function\\|command\\|face\\|form\\|macro" nil t)))
             (let (buffer-read-only)
               (setq fill-column (min refill-help-buffer-max-fill-column
                                      (- (window-width) 1)))
               (fill-region (point-min) (point-max)))))))
   'no-minibuffer frame))

(defun window-truncated-p (&optional window)
  "Return non-nil if current window (or the argument) has some
truncated lines."
  (with-selected-window (or window (selected-window))
    (save-excursion
      (goto-char (point-min))
      (re-search-forward
       (format "^..\\{%d\\}" (window-width)) nil t))))

(defun refill-help-buffer-reset-fill-column-and-refill nil
  (setq fill-column 0)
  (refill-help-buffer))

(define-minor-mode refill-help-buffer-mode
  "Automatically fill help buffer to
 \(min `refill-help-buffer-max-fill-column' \(window-width\)\)
 on displaying and resizing."
  nil nil nil
  :global t
  (if refill-help-buffer-mode
      (progn
        (add-hook 'window-size-change-functions 'refill-help-buffer)
        (add-hook 'temp-buffer-show-hook 'refill-help-buffer-reset-fill-column-and-refill))
    (remove-hook 'window-size-change-functions 'refill-help-buffer)
    (remove-hook 'temp-buffer-show-hook 'refill-help-buffer-reset-fill-column-and-refill)))

(provide 'refill-help-buffer)

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

* Re: Accessibility: fill-column for man pages and docstring help
       [not found] <mailman.3327.1230132083.26697.help-gnu-emacs@gnu.org>
  2008-12-25  4:34 ` Accessibility: fill-column for man pages and docstring help Andreas Politz
@ 2009-01-01 13:20 ` Dmitry Dzhus
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Dzhus @ 2009-01-01 13:20 UTC (permalink / raw)
  To: help-gnu-emacs

Samuel Wales wrote:

>   2.  Man pages.  I don't know how to adjust the fill column.

Customize variable `woman-fill-column`.

-- 
Happy Hacking.

http://sphinx.net.ru^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-01 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3327.1230132083.26697.help-gnu-emacs@gnu.org>
2008-12-25  4:34 ` Accessibility: fill-column for man pages and docstring help Andreas Politz
2009-01-01 13:20 ` Dmitry Dzhus
2008-12-24  5:21 Samuel Wales

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.