Commit graph

55 commits

Author SHA1 Message Date
Lars Ingebrigtsen
be4f858498 Add new function `ensure-list'
* doc/lispref/lists.texi (Building Lists): Document it.

* lisp/subr.el (ensure-list): New function.

* lisp/emacs-lisp/shortdoc.el (list): Mention it.
2021-09-21 20:31:05 +02:00
Stefan Kangas
0cf0a2b986 Add new sequence function 'seq-union'
* lisp/emacs-lisp/seq.el (seq-union): New function.
* doc/lispref/sequences.texi (Sequence Functions):
* lisp/emacs-lisp/shortdoc.el (sequence): Document above new
function.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-union): New test.
2021-09-17 11:03:39 +02:00
Lars Ingebrigtsen
d15c430a84 Mention get-byte in shortdoc
* lisp/emacs-lisp/shortdoc.el (buffer): Mention `get-byte' here.
2021-09-13 09:20:21 +02:00
Lars Ingebrigtsen
751f1707f0 Add new functions to replace strings/regexp in a region
* doc/lispref/searching.texi (Search and Replace): Document them.
* lisp/subr.el (replace-string-in-region)
(replace-regexp-in-region): New functions.

* lisp/emacs-lisp/shortdoc.el (regexp, buffer): Mention them.
2021-08-16 13:20:35 +02:00
Masahiro Nakamura
e2eb58c487 Mark up commands in shortdoc.el for modes
* lisp/emacs-lisp/shortdoc.el: Add command mode tagging
(bug#50064).
2021-08-15 11:55:34 +02:00
Lars Ingebrigtsen
f04f8126f0 Rename directory-append to file-name-concat
* src/fileio.c (Ffile_name_concat):
* lisp/files.el (move-file-to-trash):
* lisp/emacs-lisp/shortdoc.el (file-name):
* doc/lispref/files.texi (Directory Names): Rename
`directory-append' to `file-name-concat'.
2021-07-25 08:54:20 +02:00
Lars Ingebrigtsen
b4543dfa9e Extend directory-append to take an arbitrary number of components
* doc/lispref/files.texi (Directory Names): Document it.
* lisp/emacs-lisp/shortdoc.el (file-name): Add new example.

* src/fileio.c (Fdirectory_append): Change the function to take an
arbitrary number of components.
2021-07-24 17:22:43 +02:00
Lars Ingebrigtsen
5431a58e86 Add new function `directory-append'
* doc/lispref/files.texi (Directory Names): Document it, and
remove the concat-based file concatenation description.
* lisp/emacs-lisp/shortdoc.el (file-name): Add.  And add more
expand-file-name examples.

* src/fileio.c (Fdirectory_append): New function.
2021-07-24 13:30:58 +02:00
Lars Ingebrigtsen
6336c18e5c Use make-separator-line in shortdoc
* lisp/simple.el (separator-line): Tweak definition to not be so
overwhelming.

* lisp/emacs-lisp/shortdoc.el (shortdoc-separator): Removed.
(shortdoc-display-group): Use make-separator-line.
2021-07-19 16:13:57 +02:00
Lars Ingebrigtsen
153c9d5ff4 Make 'n'/'p' work again in shortdoc after previous changes
* lisp/emacs-lisp/shortdoc.el (shortdoc--goto-section): Adjust to
changes in how the text properties are inserted in 22a5482ab6
(bug#49605).  Also make into a regular function.
2021-07-17 15:41:33 +02:00
Lars Ingebrigtsen
8f5738eb8f Add more car/cdr examples to shortdoc
* lisp/emacs-lisp/shortdoc.el (list): Add more car/cdr examples.
2021-07-15 18:32:34 +02:00
Lars Ingebrigtsen
22a5482ab6 Improve the shortdoc link action in *Help* buffers
* lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Allow
taking an optional parameter to place point on a specific function.
(shortdoc--display-function): Go to the function in question in
the shortdoc buffer.
2021-07-15 18:29:27 +02:00
Lars Ingebrigtsen
4aac8f60e6 Mention more split-string-* functions in shortdoc
* lisp/emacs-lisp/shortdoc.el (string): Mention
split-string-and-unquote and split-string-shell-command.
2021-07-15 10:37:11 +02:00
Colin Woodbury
4f2765f6f1 Add new function file-name-with-extension
* doc/lispref/files.texi (File Name Components): Document it.
* lisp/emacs-lisp/shortdoc.el (file-name): Ditto.

* lisp/files.el (file-name-with-extension): New function.
2021-06-30 14:07:29 +02:00
Basil L. Contovounesios
3b1d69efc3 Fix shortdoc-add-function section creation
* lisp/emacs-lisp/shortdoc.el (shortdoc-add-function): Use nconc to
actually append a new section to the list of groups while avoiding a
previous OBOE.  Push a new group to the front of shortdoc--groups
without copying it, just like define-short-documentation-group does.
(buffer): Fix copypasta in unlock-buffer example.

* test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-examples): Also
check that :no-value forms demonstrate the right function.

* doc/lispref/help.texi (Documentation Groups): Clarify that @dots
in the define-short-documentation-group arglist refer to whole
key-value pairs.  Fix typo in :eg-result-string description.
2021-06-21 16:20:22 +01:00
Daniel Martín
e247b4b691 Add a new documentation group for overlays
* lisp/emacs-lisp/shortdoc.el (overlay): Add documentation group for
buffer overlays(bug#48730).
2021-05-30 06:41:52 +02:00
Daniel Martín
1230651ffd Improve the documentation of documentation groups
* doc/lispref/help.texi (Documentation Groups): Fix typos and add an
example.
* lisp/emacs-lisp/shortdoc.el (define-short-documentation-group): Add
:no-eval* and :result-string keywords to the docstring.  (Bug#48730)
2021-05-30 06:41:24 +02:00
Mattias Engdegård
93162efd79 Fix shortdoc examples
Make sure that each example in shortdoc actually contains the function
it illustrates, and add a test for it.

* lisp/emacs-lisp/shortdoc.el (string, list, buffer, number):
Use the right functions in examples for string-version-lessp,
lax-plist-put, point-min and ffloor.
* test/lisp/emacs-lisp/shortdoc-tests.el: New test file.
2021-05-29 09:18:00 +02:00
Daniel Martín
651394d845 Fix looking-at-p example in shortdoc.el
* lisp/emacs-lisp/shortdoc.el (regexp): Use `looking-at-p' instead of
`looking-at' (bug#48709).
2021-05-28 01:45:28 +02:00
Alexandr Vityazev
2c90aa93a9 Fix the length= shortdoc example
* lisp/emacs-lisp/shortdoc.el (list): Fix the length= example
(bug#48495).

Copyright-paperwork-exempt: yes
2021-05-18 15:36:25 +02:00
Stefan Kangas
086e29d213 * lisp/emacs-lisp/shortdoc.el: Doc fixes. 2021-04-29 13:32:24 +02:00
Lars Ingebrigtsen
a4ececf004 Move string-trim functions to subr.el
* doc/lispref/strings.texi (Creating Strings): Document them.

* lisp/faces.el: Don't require subr-x, because that leads to build
errors.

* lisp/subr.el (string-trim, string-trim-right)
(string-trim-left): Move here from subr-x.el.

* lisp/emacs-lisp/shortdoc.el (string): Adjust.
2021-03-24 09:22:44 +01:00
Protesilaos Stavrou
7c48c83dab Use named faces in shortdoc
* shortdoc.el (shortdoc-heading): Define new face for headings.
(shortdoc-display-group): Apply new heading face.
(shortdoc--display-function): Use existing face for section text.
* etc/NEWS: Document new face (bug#46748).
2021-02-24 17:18:26 +01:00
Daniel Martín
e62f71988f Minor shortdoc link improvements
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Use
describe-function as a fallback link when a function is not documented
in any Info manual.  Also make the link respond to mouse-1, like the
rest of *Help* links, and add a proper help-echo property.
* lisp/help-fns.el (help-fns--mention-shortdoc-groups): Same link
improvement as described before, this time for the shortdoc groups
(bug#45750).
2021-01-10 13:45:44 +01:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Basil L. Contovounesios
df882c9701 ; Fix recent shortdoc.el and fns.c additions
* lisp/emacs-lisp/shortdoc.el (list): Fix typos.
* src/fns.c (Flength_equal): Fix docstring.
2020-12-27 13:14:30 +00:00
Lars Ingebrigtsen
0f790464d5 Add new predicates for sequence lengths
* doc/lispref/sequences.texi (Sequence Functions): Document them.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark them as
side-effect-free.

* lisp/emacs-lisp/shortdoc.el (list): Mention them.

* src/fns.c (Flength): Mention them in the doc string.
(length_internal): New function.
(Flength_less, Flength_greater, Flength_equal): New defuns.
(syms_of_fns): Sym them.
2020-12-27 09:00:23 +01:00
Lars Ingebrigtsen
af359de917 Allow `string-limit' to work on encoded strings
* doc/lispref/strings.texi (Creating Strings): Document it.

* lisp/emacs-lisp/subr-x.el (string-limit): Allow limiting on
encoded strings.
2020-12-25 05:58:09 +01:00
Lars Ingebrigtsen
269cec13a2 Remove `string-slice' -- it's not very well defined
* doc/lispref/strings.texi (Creating Strings): Ditto.

* lisp/emacs-lisp/subr-x.el (string-slice): Remove.
2020-12-25 05:16:46 +01:00
Lars Ingebrigtsen
5c86a53296 Improve the string-limit doc string
* lisp/emacs-lisp/subr-x.el (string-limit): Mention
truncate-string-to-width in the doc string.
2020-12-23 07:59:24 +01:00
Lars Ingebrigtsen
051d8f7535 Make string-pad take an optional START parameter
* lisp/emacs-lisp/subr-x.el (string-pad): Alter the calling
convention.
2020-12-22 06:59:25 +01:00
Lars Ingebrigtsen
9480169f1b Change the string-limit parameter semantics
* lisp/emacs-lisp/subr-x.el (string-limit): Alter the calling
convention.
2020-12-22 06:54:32 +01:00
Lars Ingebrigtsen
c9a95237a8 Add try-completion to the string shortdoc
* lisp/emacs-lisp/shortdoc.el (string): Mention try-completion here.
2020-12-21 22:08:56 +01:00
Lars Ingebrigtsen
f329a3180e Add string-chop-newline
* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/subr-x.el (string-chop-newline): Add new function.
2020-12-21 22:05:37 +01:00
Lars Ingebrigtsen
cf2e832185 Rename slice-string to string-slice
* lisp/emacs-lisp/subr-x.el (string-slice): Rename from slice-string.
* doc/lispref/strings.texi (Creating Strings): Ditto.
2020-12-21 20:18:57 +01:00
Lars Ingebrigtsen
b3dec31766 Add `string-pad'
* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/shortdoc.el (string): Add example.

* lisp/emacs-lisp/subr-x.el (string-pad): New function.
2020-12-21 20:01:28 +01:00
Lars Ingebrigtsen
87e422f104 Beef up the Emacs string utility set a bit
* doc/lispref/strings.texi (Modifying Strings): Document them.
* lisp/emacs-lisp/shortdoc.el (string): Add examples.

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace)
(string-fill, string-limit, string-lines, slice-string): New
functions.
2020-12-21 18:53:40 +01:00
Brian Leung
916eb895d1 shortdoc: prefer seq-contains-p over seq-contains
* lisp/emacs-lisp/shortdoc.el (sequence): use seq-contains-p instead
of seq-contains, which is obsolete as of 27.1.  (Bug#44536)

Copyright-paperwork-exempt: yes
2020-11-09 21:19:10 +01:00
Stefan Kangas
ff3838ecc3 ; Remove spurious FIXMEs in my last commit 2020-10-30 11:41:47 +01:00
Stefan Kangas
122ace858b Add shortdoc navigation commands
* lisp/emacs-lisp/shortdoc.el (text-property-search): Require.
(shortdoc-mode): New major mode.
(shortdoc-mode-map): New variable.
(shortdoc--goto-section): New macro.
(shortdoc-next, shortdoc-previous, shortdoc-next-section)
(shortdoc-previous-section): New commands.
(shortdoc-display-group): Use new shortdoc-models.  Propertize
section header.
(shortdoc--display-function): Propertize function header.
2020-10-30 11:40:43 +01:00
Mattias Engdegård
bb3d13ac35 ; * lisp/emacs-lisp/shortdoc.el (regexp): less contrived rx example 2020-10-28 15:05:35 +01:00
Stefan Kangas
bd3ecfef84 Run substitute-command-keys on shortdoc section headings
* lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Run
substitute-command-keys on section headings before displaying.
2020-10-28 14:46:43 +01:00
Stefan Kangas
6b3ed2375b Extend the regexp shortdoc group
* lisp/emacs-lisp/shortdoc.el (regexp): New section "Match Data"; add
save-match-data.  New section "The `rx' Structured Regexp Notation".
2020-10-28 14:46:28 +01:00
Lars Ingebrigtsen
d23e483cfb Tweak how shortdocs are displayed
* lisp/emacs-lisp/shortdoc.el (shortdoc-example): Removed.
(shortdoc-section): Remove colors.
(shortdoc-separator): New face.
(shortdoc-display-group, shortdoc--display-function): Don't use
background colours, because that makes things harder to read.
Separate with a horizontal line instead.
2020-10-26 19:15:36 +01:00
Stefan Kangas
a98bb620c4 Add section "Replacing Match" to the regexp shortdoc group
* lisp/emacs-lisp/shortdoc.el (regexp): New section "Replacing Match".
2020-10-25 19:18:27 +01:00
Stefan Kangas
10ea719abc Add shortdoc group for alist
* lisp/emacs-lisp/shortdoc.el (alist): New shortdoc group.
2020-10-25 01:40:52 +02:00
Stefan Kangas
b6a41c76a5 Add shortdoc group for hash-table
* lisp/emacs-lisp/shortdoc.el (hash-table): New shortdoc group.
2020-10-25 00:53:17 +02:00
Basil L. Contovounesios
ec4f2723c1 Simplify syntax of shortdoc face specs
* lisp/emacs-lisp/shortdoc.el: Remove unused dependency.
(shortdoc-section, shortdoc-example): Use newer (DISPLAY . PLIST)
face spec syntax.
2020-10-20 17:31:09 +01:00
Lars Ingebrigtsen
d5c811279b Fix error in file shortdoc group
* lisp/emacs-lisp/shortdoc.el (number): Add some more numeric
stuff (and clean up some arglists).
2020-10-11 23:51:26 +02:00
Eli Zaretskii
4b84095d23 Improve documentation of shortdoc features
* lisp/help-fns.el (help-fns-describe-function-functions): Doc
fix.
* lisp/emacs-lisp/shortdoc.el (define-short-documentation-group)
(shortdoc-display-group, shortdoc-add-function): Doc fixes.

* doc/lispref/help.texi (Documentation Groups): Improve the
recently-added documentation and the indexing.
2020-10-11 17:28:40 +03:00