unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "T.V Raman" <raman@google.com>
To: emacs-devel@gnu.org
Subject: Feature Request: Help: Display Relevant Bits First?
Date: Thu, 31 Mar 2022 13:22:36 -0700	[thread overview]
Message-ID: <25158.3468.429616.238692@google.com> (raw)

At present, if you do describe-function on any command that toggles a
mode, you get a lot of common boiler-plate, with the salient bits
about that particular function at the end -- could we reverse this?

As an example, here is what C-h f font-lock-mode shows 

I'd personally find it more useful if the block of text between 
"this is a minor mode . ..." and 
"the mode's hook is called ..." appeared at the end of the help
buffer.

Thoughts?
font-lock-mode is an interactive compiled Lisp function in
‘font-core.el’.

(font-lock-mode &optional ARG)

Toggle syntax highlighting in this buffer (Font Lock mode).

This is a minor mode.  If called interactively, toggle the ‘Font-Lock
mode’ mode.  If the prefix argument is positive, enable the mode, and
if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is ‘toggle’.  Enable the
mode if ARG is nil, omitted, or is a positive number.  Disable the
mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer,
evaluate ‘font-lock-mode’.

The mode’s hook is called both when the mode is enabled and when it is
disabled.

When Font Lock mode is enabled, text is fontified as you type it:

 - Comments are displayed in ‘font-lock-comment-face’;
 - Strings are displayed in ‘font-lock-string-face’;
 - Certain other expressions are displayed in other faces
   according to the value of the variable ‘font-lock-keywords’.

To customize the faces (colors, fonts, etc.) used by Font Lock for
fontifying different parts of buffer text, use M-x customize-face.

You can enable Font Lock mode in any major mode automatically by
turning on in the major mode’s hook.  For example, put in your
~/.emacs:

 (add-hook 'c-mode-hook 'turn-on-font-lock)

Alternatively, you can use Global Font Lock mode to automagically
turn on Font Lock mode in buffers whose major mode supports it
and whose major mode is one of ‘font-lock-global-modes’.  For
example, put in your ~/.emacs:

 (global-font-lock-mode t)

Where major modes support different levels of fontification, you
can use the variable ‘font-lock-maximum-decoration’ to specify
which level you generally prefer.  When you turn Font Lock mode
on/off the buffer is fontified/defontified, though fontification
occurs only if the buffer is less than ‘font-lock-maximum-size’.

To add your own highlighting for some major mode, and modify the
highlighting selected automatically via the variable
‘font-lock-maximum-decoration’, you can use
‘font-lock-add-keywords’.

To fontify a buffer, without turning on Font Lock mode and
regardless of buffer size, you can use M-x font-lock-fontify-buffer.

To fontify a block (the function or paragraph containing point,
or a number of lines around point), perhaps because modification
on the current line caused syntactic change on other lines, you
can use M-x font-lock-fontify-block.

You can set your own default settings for some mode, by setting a
buffer local value for ‘font-lock-defaults’, via its mode hook.

The above is the default behavior of ‘font-lock-mode’; you may
specify your own function which is called when ‘font-lock-mode’
is toggled via ‘font-lock-function’.

  Probably introduced at or before Emacs version 19.29.

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮



             reply	other threads:[~2022-03-31 20:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 20:22 T.V Raman [this message]
2022-03-31 20:50 ` [External] : Feature Request: Help: Display Relevant Bits First? Drew Adams
2022-03-31 21:01   ` T.V Raman
2022-04-02 13:56 ` Lars Ingebrigtsen
2022-04-02 14:36   ` Basil L. Contovounesios
2022-04-02 14:53     ` Lars Ingebrigtsen
2022-04-02 17:13   ` T.V Raman
2022-04-03 11:54     ` Lars Ingebrigtsen
2022-04-03  0:37   ` Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25158.3468.429616.238692@google.com \
    --to=raman@google.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).