diff options
| author | Helmut Eller | 2026-04-04 20:59:46 +0200 |
|---|---|---|
| committer | Helmut Eller | 2026-04-04 20:59:46 +0200 |
| commit | 6eec001187e8551f32b6498e6dc60cdc58c2e515 (patch) | |
| tree | 13233de9f0a05ef86a51500e8b1870b75ff20c81 /doc/lispref | |
| parent | e4ea27119e79012f9d651cb61d1115589d91ef39 (diff) | |
| parent | 01a9d78a7e4c7d7fa5b799e4fdc2caf77a012734 (diff) | |
| download | emacs-feature/igc3.tar.gz emacs-feature/igc3.zip | |
Merge branch 'master' into feature/igc3feature/igc3
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/customize.texi | 13 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 16 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/tips.texi | 84 |
6 files changed, 117 insertions, 9 deletions
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 364edf63031..705af15e4e2 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi | |||
| @@ -372,12 +372,15 @@ added by calls to @code{custom-add-frequent-value} (see below). | |||
| 372 | @item :set @var{setfunction} | 372 | @item :set @var{setfunction} |
| 373 | Specify @var{setfunction} as the way to change the value of this | 373 | Specify @var{setfunction} as the way to change the value of this |
| 374 | option when using the Customize interface. The function | 374 | option when using the Customize interface. The function |
| 375 | @var{setfunction} should take two arguments, a symbol (the option | 375 | @var{setfunction} should take two or three arguments, a symbol (the option |
| 376 | name) and the new value, and should do whatever is necessary to update | 376 | name), the new value, and an optional @var{buffer-local} indicator. |
| 377 | @var{setfunction} should do whatever is necessary to update | ||
| 377 | the value properly for this option (which may not mean simply setting | 378 | the value properly for this option (which may not mean simply setting |
| 378 | the option as a Lisp variable); preferably, though, it should not | 379 | the option as a Lisp variable); preferably, though, it should not |
| 379 | modify its value argument destructively. The default for | 380 | modify its value argument destructively. If optional @var{buffer-local} |
| 380 | @var{setfunction} is @code{set-default-toplevel-value}. | 381 | is non-nil, the new value should be set buffer locally and not affect its |
| 382 | global or default values. The default for @var{setfunction} is | ||
| 383 | @code{set-default-toplevel-value}. | ||
| 381 | 384 | ||
| 382 | If defined, @var{setfunction} will also be called when evaluating a | 385 | If defined, @var{setfunction} will also be called when evaluating a |
| 383 | @code{defcustom} form with @kbd{C-M-x} in Emacs Lisp mode and when the | 386 | @code{defcustom} form with @kbd{C-M-x} in Emacs Lisp mode and when the |
| @@ -387,7 +390,7 @@ If defined, @var{setfunction} will also be called when evaluating a | |||
| 387 | If you specify this keyword, the variable's documentation string | 390 | If you specify this keyword, the variable's documentation string |
| 388 | should describe how to do the same job in hand-written Lisp code, | 391 | should describe how to do the same job in hand-written Lisp code, |
| 389 | either by invoking @var{setfunction} directly or by using | 392 | either by invoking @var{setfunction} directly or by using |
| 390 | @code{setopt}. | 393 | @code{setopt} or @code{setopt-local}. |
| 391 | 394 | ||
| 392 | @kindex get@r{, @code{defcustom} keyword} | 395 | @kindex get@r{, @code{defcustom} keyword} |
| 393 | @item :get @var{getfunction} | 396 | @item :get @var{getfunction} |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 656a422cf6e..9115b3a4691 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -1661,6 +1661,7 @@ Tips and Conventions | |||
| 1661 | * Compilation Tips:: Making compiled code run fast. | 1661 | * Compilation Tips:: Making compiled code run fast. |
| 1662 | * Warning Tips:: Turning off compiler warnings. | 1662 | * Warning Tips:: Turning off compiler warnings. |
| 1663 | * Documentation Tips:: Writing readable documentation strings. | 1663 | * Documentation Tips:: Writing readable documentation strings. |
| 1664 | * Documentation Group Tips:: Writing useful documentation groups. | ||
| 1664 | * Comment Tips:: Conventions for writing comments. | 1665 | * Comment Tips:: Conventions for writing comments. |
| 1665 | * Library Headers:: Standard headers for library packages. | 1666 | * Library Headers:: Standard headers for library packages. |
| 1666 | 1667 | ||
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 049e8ac3e84..f86a18fd896 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -2777,6 +2777,9 @@ the end of the file name. | |||
| 2777 | 2777 | ||
| 2778 | If @var{text} is a string, @code{make-temp-file} inserts it in the file. | 2778 | If @var{text} is a string, @code{make-temp-file} inserts it in the file. |
| 2779 | 2779 | ||
| 2780 | On Posix systems, Emacs creates the file with permissions that limit its | ||
| 2781 | access to the current user. | ||
| 2782 | |||
| 2780 | To prevent conflicts among different libraries running in the same | 2783 | To prevent conflicts among different libraries running in the same |
| 2781 | Emacs, each Lisp program that uses @code{make-temp-file} should have its | 2784 | Emacs, each Lisp program that uses @code{make-temp-file} should have its |
| 2782 | own @var{prefix}. The number added to the end of @var{prefix} | 2785 | own @var{prefix}. The number added to the end of @var{prefix} |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index d57d643e922..c50619a2de0 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -89,6 +89,20 @@ displayed on that terminal; the list of possible values is the same as | |||
| 89 | for @code{framep} above. | 89 | for @code{framep} above. |
| 90 | @end defun | 90 | @end defun |
| 91 | 91 | ||
| 92 | @defun frame-initial-p &optional frame | ||
| 93 | This predicate returns non-@code{nil} if @var{frame} is or holds the | ||
| 94 | initial text frame that is used internally during daemon mode | ||
| 95 | (@pxref{Initial Options, daemon,, emacs, The GNU Emacs Manual}), batch | ||
| 96 | mode (@pxref{Batch Mode}), and the early stages of startup | ||
| 97 | (@pxref{Startup Summary}). Interactive and graphical programs, for | ||
| 98 | instance, can use this predicate to avoid operating on the initial | ||
| 99 | frame, which is never displayed. | ||
| 100 | |||
| 101 | If @var{frame} is a terminal, this function returns non-@code{nil} if | ||
| 102 | @var{frame} holds the initial frame. If @var{frame} is omitted or | ||
| 103 | @code{nil}, it defaults to the selected one. | ||
| 104 | @end defun | ||
| 105 | |||
| 92 | @cindex top-level frame | 106 | @cindex top-level frame |
| 93 | On a graphical terminal we distinguish two types of frames: A normal | 107 | On a graphical terminal we distinguish two types of frames: A normal |
| 94 | @dfn{top-level frame} is a frame whose window-system window is a child | 108 | @dfn{top-level frame} is a frame whose window-system window is a child |
| @@ -3029,7 +3043,7 @@ direction. | |||
| 3029 | See also @code{next-window} and @code{previous-window}, in @ref{Cyclic | 3043 | See also @code{next-window} and @code{previous-window}, in @ref{Cyclic |
| 3030 | Window Ordering}. | 3044 | Window Ordering}. |
| 3031 | 3045 | ||
| 3032 | Some Lisp programs need to find one or more frames that satisfy a | 3046 | Some Lisp programs need to find one or more frames that satisfy |
| 3033 | given criteria. The function @code{filtered-frame-list} is provided for | 3047 | given criteria. The function @code{filtered-frame-list} is provided for |
| 3034 | this purpose. | 3048 | this purpose. |
| 3035 | 3049 | ||
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 3261cf838f7..a9bc9221912 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -828,14 +828,16 @@ if the user types the help character again. | |||
| 828 | @cindex documentation groups | 828 | @cindex documentation groups |
| 829 | @cindex groups of functions | 829 | @cindex groups of functions |
| 830 | @cindex function groups | 830 | @cindex function groups |
| 831 | @cindex shortdoc groups | ||
| 831 | 832 | ||
| 832 | Emacs can list functions based on various groupings. For instance, | 833 | Emacs can list functions based on various groupings. For instance, |
| 833 | @code{string-trim} and @code{mapconcat} are ``string'' functions, so | 834 | @code{string-trim} and @code{mapconcat} are ``string'' functions, so |
| 834 | @kbd{M-x shortdoc RET string RET} will give an overview | 835 | @kbd{M-x shortdoc RET string RET} will give an overview of these and |
| 835 | of functions that operate on strings. | 836 | other functions that operate on strings. |
| 836 | 837 | ||
| 837 | The documentation groups are created with the | 838 | The documentation groups are created with the |
| 838 | @code{define-short-documentation-group} macro. | 839 | @code{define-short-documentation-group} macro. @xref{Documentation |
| 840 | Group Tips}, for how to write good documentation groups. | ||
| 839 | 841 | ||
| 840 | @defmac define-short-documentation-group group &rest functions | 842 | @defmac define-short-documentation-group group &rest functions |
| 841 | Define @var{group} as a group of functions, and provide short | 843 | Define @var{group} as a group of functions, and provide short |
| @@ -846,6 +848,7 @@ summaries of using those functions. The optional argument | |||
| 846 | (@var{func} [@var{keyword} @var{val}]@dots{}) | 848 | (@var{func} [@var{keyword} @var{val}]@dots{}) |
| 847 | @end lisp | 849 | @end lisp |
| 848 | 850 | ||
| 851 | @cindex documentation group keywords | ||
| 849 | The following keywords are recognized: | 852 | The following keywords are recognized: |
| 850 | 853 | ||
| 851 | @table @code | 854 | @table @code |
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 7f22dc06ef2..2fbac9508d6 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi | |||
| @@ -35,6 +35,7 @@ in batch mode, e.g., with a command run by @kbd{@w{M-x compile | |||
| 35 | * Compilation Tips:: Making compiled code run fast. | 35 | * Compilation Tips:: Making compiled code run fast. |
| 36 | * Warning Tips:: Turning off compiler warnings. | 36 | * Warning Tips:: Turning off compiler warnings. |
| 37 | * Documentation Tips:: Writing readable documentation strings. | 37 | * Documentation Tips:: Writing readable documentation strings. |
| 38 | * Documentation Group Tips:: Writing useful documentation groups. | ||
| 38 | * Comment Tips:: Conventions for writing comments. | 39 | * Comment Tips:: Conventions for writing comments. |
| 39 | * Library Headers:: Standard headers for library packages. | 40 | * Library Headers:: Standard headers for library packages. |
| 40 | @end menu | 41 | @end menu |
| @@ -934,6 +935,89 @@ If you do not anticipate anyone editing your code with older Emacs | |||
| 934 | versions, there is no need for this work-around. | 935 | versions, there is no need for this work-around. |
| 935 | @end itemize | 936 | @end itemize |
| 936 | 937 | ||
| 938 | @node Documentation Group Tips | ||
| 939 | @section Tips for Documentation Groups | ||
| 940 | @cindex documentation groups, tips | ||
| 941 | @cindex tips for documentation groups | ||
| 942 | |||
| 943 | @cindex documentation groups, compatibility | ||
| 944 | Documentation groups, available since Emacs 28, are useful to document | ||
| 945 | functions of Lisp packages based on various groupings | ||
| 946 | (@pxref{Documentation Groups}). This section gives some tips on how you | ||
| 947 | can define documentation groups in your Lisp package in a way such that | ||
| 948 | users of different Emacs versions can equally well use these groups. | ||
| 949 | |||
| 950 | @itemize @bullet | ||
| 951 | @item | ||
| 952 | To define documentation groups for your own Lisp package across | ||
| 953 | different Emacs versions, you can use a boilerplate template along the | ||
| 954 | lines of the following to make your package compile and load without | ||
| 955 | errors: | ||
| 956 | |||
| 957 | @smallexample | ||
| 958 | @group | ||
| 959 | ;;; well-doc.el --- a well-documented package -*- lexical-binding: t; -*- | ||
| 960 | |||
| 961 | @dots{} package header and contents @dots{} | ||
| 962 | @end group | ||
| 963 | |||
| 964 | @group | ||
| 965 | ;; Explicitly require shortdoc for Emacs 28, which does not have an | ||
| 966 | ;; autoload for macro `define-short-documentation-group'. And for | ||
| 967 | ;; Emacs 30, so that we can redefine `shortdoc--check' later. | ||
| 968 | (require 'shortdoc nil t) | ||
| 969 | |||
| 970 | (eval-when-compile | ||
| 971 | |||
| 972 | ;; Default macro `define-short-documentation-group' for Emacs 27 | ||
| 973 | ;; and older, which do not have the shortdoc feature at all. | ||
| 974 | (unless (fboundp 'define-short-documentation-group) | ||
| 975 | (defmacro define-short-documentation-group (&rest _))) | ||
| 976 | |||
| 977 | ;; Disable too rigid shortdoc checks for Emacs 30, which let it | ||
| 978 | ;; error out on newer shortdoc keywords. | ||
| 979 | (when (eq emacs-major-version 30) | ||
| 980 | (fset 'shortdoc--check #'ignore))) | ||
| 981 | @end group | ||
| 982 | |||
| 983 | @group | ||
| 984 | (define-short-documentation-group well-doc | ||
| 985 | @dots{}) | ||
| 986 | |||
| 987 | ;;; well-doc.el ends here | ||
| 988 | @end group | ||
| 989 | @end smallexample | ||
| 990 | |||
| 991 | @findex define-short-documentation-group | ||
| 992 | If you do not intend to support some of the Emacs versions mentioned | ||
| 993 | above, you can safely omit the corresponding forms from the template. | ||
| 994 | If you intend to support only Emacs 31 and newer, you do not need any | ||
| 995 | of the above and can just use @code{define-short-documentation-group}. | ||
| 996 | |||
| 997 | @item | ||
| 998 | @cindex documentation group keywords, compatibility | ||
| 999 | Newer Emacs versions might introduce newer documentation group features | ||
| 1000 | and keywords. However, these features or keywords will never break the | ||
| 1001 | display of a documentation group in older Emacs versions. Suppose you | ||
| 1002 | use a hypothetical group keyword @code{:super-pretty-print}, available | ||
| 1003 | in some future Emacs version, like this in your Lisp package | ||
| 1004 | @file{well-doc.el}: | ||
| 1005 | |||
| 1006 | @smallexample | ||
| 1007 | @group | ||
| 1008 | (define-short-documentation-group well-doc | ||
| 1009 | (well-doc-foo | ||
| 1010 | :eval (well-doc-foo) | ||
| 1011 | :super-pretty-print t)) | ||
| 1012 | @end group | ||
| 1013 | @end smallexample | ||
| 1014 | |||
| 1015 | That future Emacs version will then supposedly super-pretty-print the | ||
| 1016 | example for function @code{well-doc-foo}. Older Emacs versions will | ||
| 1017 | silently ignore keyword @code{:super-pretty-print} and show the example | ||
| 1018 | according to their regular display rules. | ||
| 1019 | @end itemize | ||
| 1020 | |||
| 937 | @node Comment Tips | 1021 | @node Comment Tips |
| 938 | @section Tips on Writing Comments | 1022 | @section Tips on Writing Comments |
| 939 | @cindex comments, Lisp convention for | 1023 | @cindex comments, Lisp convention for |