aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/objects.texi (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-05-16Minor fixups for mutability docPaul Eggert1-8/+7
* doc/lispref/objects.texi (Mutability): Minor fixups in response to a comment by Dmitry Gutov (Bug#40671#477).
2020-05-16Don’t use “constant” for values you shouldn’t changePaul Eggert1-47/+51
Inspired by patch proposed by Dmitry Gutov (Bug#40671#393) and by further comments by him and by Michael Heerdegen in the same bug report. * doc/lispintro/emacs-lisp-intro.texi (setcar): Don’t push mutability here. * doc/lispref/eval.texi (Self-Evaluating Forms, Quoting) (Backquote): * doc/lispref/lists.texi (Modifying Lists): * doc/lispref/objects.texi (Lisp Data Types, Mutability): * doc/lispref/sequences.texi (Array Functions, Vectors): * doc/lispref/strings.texi (String Basics, Modifying Strings): Don’t use the word “constant” to describe all values that a program should not change. * doc/lispref/objects.texi (Mutability): Rename from “Constants and Mutability”. All uses changed. In a footnote, contrast the Emacs behavior with that of Common Lisp, Python, etc. for clarity, and say the goal is to be nicer.
2020-04-25Remove doc duplicationPaul Eggert1-2/+1
* doc/lispref/objects.texi (Constants and Mutability): Remove duplication. From a suggestion by Andreas Schwab (Bug#40671#150).
2020-04-24Tweak mutability doc a bit morePaul Eggert1-2/+2
Inspired by a comment from Michael Heerdegen (Bug#40671#114). * doc/lispref/objects.texi (Constants and Mutability): Tweak further.
2020-04-22Improve wording about constantsPaul Eggert1-7/+14
Thanks to Štěpán Němec and Drew Adams for reviews of recent changes. * doc/lispref/eval.texi (Quoting): Give an example. * doc/lispref/lists.texi (Association Lists): Simplify example code. * doc/lispref/objects.texi (Lisp Data Types) (Constants and Mutability): Clarify wording.
2020-04-19Tweak wording re constant variablesPaul Eggert1-1/+2
* doc/lispref/objects.texi (Constants and Mutability): Tweak. Problem reported by Michael Heerdegen (Bug#40693#44).
2020-04-19Fix mutability glitches reported by Drew AdamsPaul Eggert1-4/+6
See Bug#40693#32. * doc/lispref/eval.texi (Self-Evaluating Forms, Backquote): Say that these yield constant conses, vectors and strings, not constant symbols. * doc/lispref/objects.texi (Constants and Mutability): Say that an attempt to modify a constant variable signals an error, instead of saying that it has undefined behavior.
2020-04-19Improve mutability documentationPaul Eggert1-0/+45
This change was inspired by comments from Štěpán Němec in: https://lists.gnu.org/r/emacs-devel/2020-04/msg01063.html * doc/lispref/objects.texi (Lisp Data Types): Mention mutability. (Constants and mutability): New section. * doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed) (Indent Tabs Mode): Improve wording. * doc/lispref/eval.texi (Self-Evaluating Forms): Say that they return constants. * doc/lispref/lists.texi (Sets And Lists): Fix memql mistake/confusion that I recently introduced.
2020-01-24Improve doc of eq on bignums etc.Paul Eggert1-15/+17
* doc/lispref/numbers.texi (Integer Basics): * doc/lispref/objects.texi (Integer Type, Equality Predicates): Be clearer about eq vs eql vs = on bignums, floats, and strings.
2020-01-07Fix sxhash-equal on bytecodes, markers, etc.Paul Eggert1-2/+6
Problem reported by Pip Cet (Bug#38912#14). * doc/lispref/objects.texi (Equality Predicates): Document better when ‘equal’ looks inside objects. * doc/lispref/windows.texi (Window Configurations): Don’t say that ‘equal’ looks inside window configurations. * etc/NEWS: Mention the change. * src/fns.c (internal_equal): Do not look inside window configurations. (sxhash_obj): Hash markers, byte-code function objects, char-tables, and font objects consistently with Fequal. * src/window.c (compare_window_configurations): Now static. Remove last argument. Caller changed. * test/lisp/ffap-tests.el (ffap-other-window--bug-25352): Use compare-window-configurations, not ‘equal’. * test/src/fns-tests.el (test-sxhash-equal): New test.
2020-01-01Update copyright year to 2020Paul Eggert1-1/+1
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2019-12-24Fix manual typo in Special Read SyntaxLars Ingebrigtsen1-1/+1
* doc/lispref/objects.texi (Special Read Syntax): Fix typo.
2019-11-28Improve errors & warnings due to fancy quoted vars (Bug#32939)Noam Postavsky1-1/+5
Add some hints to the message for byte compiler free & unused variable warnings, and 'void-variable' errors where the variable has confusable quote characters in it. * lisp/help.el (uni-confusables), uni-confusables-regexp): New constants. (help-command-error-confusable-suggestions): New function, added to `command-error-function'. (help-uni-confusable-suggestions): New function. * lisp/emacs-lisp/bytecomp.el (byte-compile-variable-ref): * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Use it. * lisp/emacs-lisp/lisp-mode.el (lisp--match-confusable-symbol-character): New function. (lisp-fdefs): Use it to fontify confusable characters with font-lock-warning-face when they occur in symbol names. * doc/lispref/modes.texi (Faces for Font Lock): * doc/lispref/objects.texi (Basic Char Syntax): Recommend backslash escaping of confusable characters, and mention new fontification. * etc/NEWS: Announce the new fontification behavior. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-fontify-confusables): New test.
2019-11-21Fix a recent change in ELisp manualEli Zaretskii1-3/+1
* doc/lispref/objects.texi (Special Read Syntax): Fix wording of the last change: don't document #' twice. (Bug#38278)
2019-11-21Fix up previous #' documentation additionLars Ingebrigtsen1-1/+1
* doc/lispref/objects.texi (Special Read Syntax): Add an xref for the #' (bug#38278).
2019-11-21Document the #' syntaxLars Ingebrigtsen1-0/+5
* doc/lispref/objects.texi (Special Read Syntax): Document the #' syntax (bug#38278).
2019-10-12; Remove unneeded @samp from a @tableEli Zaretskii1-2/+2
* doc/lispref/objects.texi (Special Read Syntax): Remove @samp from @item's.
2019-10-12Fix recent changes in ELisp manualEli Zaretskii1-15/+15
* doc/lispref/objects.texi (Special Read Syntax): Use @samp in @table. * doc/lispref/elisp.texi (Top): Update the detailed menu due to a recent addition.
2019-10-12Document #$ in the overviewLars Ingebrigtsen1-3/+10
* doc/lispref/objects.texi (Special Read Syntax): Add #$.
2019-10-12Add a lispref node to list special read syntax formsLars Ingebrigtsen1-0/+64
* doc/lispref/objects.texi (Special Read Syntax): Add a node to list all the special read syntax forms (bug#18957).
2019-06-27Improve ‘equal’ and array docPaul Eggert1-6/+9
* doc/lispref/objects.texi (Array Type): Array sizes are nonnegative fixnums, not arbitrary integers. (Equality Predicates): Do not say that ‘eq’ equals ‘=’ on bignums. Do not imply that ‘equal’ must signal an error on circular lists.
2019-01-01Update copyright year to 2019Paul Eggert1-1/+1
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2018-08-21Move bignump, fixnump from C to LispPaul Eggert1-3/+4
* doc/lispref/objects.texi (Integer Type): Mention most-negative-fixnum and most-positive-fixnum as alternatives to fixnump and bignump. * lisp/subr.el (fixnump, bignump): Now written in Lisp. * src/data.c (Ffixnump, Fbignump): No longer written in C, as these new functions are not crucial for performance.
2018-07-12Document bignumsTom Tromey1-8/+18
* doc/lispref/numbers.texi (Numbers, Integer Basics) (Predicates on Numbers, Comparison of Numbers) (Arithmetic Operations, Bitwise Operations): Update for bignums. * doc/lispref/objects.texi (Integer Type, Type Predicates): Update for bignums. * etc/NEWS: Update for bigums.
2018-06-20Change index of ";" to better reflect it's usage (Bug#31623)Noam Postavsky1-9/+9
* doc/lispref/objects.texi (Comments): "; for commenting" fits better with the following text about how a semicolon begins a comment. Also mention that only unescaped semicolons start a comment.
2018-06-08Clarify subtle issues with 'eq' in byte-compiled codeEli Zaretskii1-0/+15
* doc/lispref/objects.texi (Equality Predicates): Explain why byte-compiled code might compare literal objects with identical contents as 'eq'. (Bug#31688)
2018-04-02Clarify eq on floatsPaul Eggert1-0/+10
* doc/lispref/objects.texi (Equality Predicates): Say that two floats with the same values might or might not be eq.
2018-01-26Minor fix in documentation of 'equal'Eli Zaretskii1-3/+2
* doc/lispref/objects.texi (Equality Predicates): Correct the conditions for equality of unibyte and multibyte strings. (Bug#30218)
2018-01-01Update copyright year to 2018Paul Eggert1-1/+1
Run admin/update-copyright.
2017-11-24Reorder type predicates in ELisp manualEli Zaretskii1-21/+12
* doc/lispref/objects.texi (Type Predicates): Restore alphabetical order of listed predicates. (Bug#29411)
2017-07-02Adapt Lisp reference to reader changesPhilipp Stephani1-17/+18
The reader now warns about some unescaped character literals, but still allows them for compatibility reasons. Slightly adapt the manual to forbid them officially. * doc/lispref/objects.texi (Basic Char Syntax): Document that backslashes are now required before some characters.
2017-04-06; Spelling and punctuation fixesPaul Eggert1-2/+2
2017-04-06Update documentation for type semantics of records.Lars Brinkhoff1-1/+15
* objects.texi (Record Type): improve description of what `type-of' returns for records. (Type Descriptors): new section. * elisp.texi: reference it. * records.texi (Records): reference it. Document behaviour when type slot is a record. * alloc.c (Fmake_record, Frecord): mention type desciptors.
2017-04-04Add record objects with user-defined types.Lars Brinkhoff1-3/+21
* src/alloc.c (allocate_record): New function. (Fmake_record, Frecord, Fcopy_record): New functions. (syms_of_alloc): defsubr them. (purecopy): Work with records. * src/data.c (Ftype_of): Return slot 0 for record objects, or type name if record's type holds class. (Frecordp): New function. (syms_of_data): defsubr it. Define `Qrecordp'. (Faref, Faset): Work with records. * src/fns.c (Flength): Work with records. * src/lisp.h (prec_type): Add PVEC_RECORD. (RECORDP, CHECK_RECORD, CHECK_RECORD_TYPE): New functions. * src/lread.c (read1): Add syntax for records. * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Add RECORDP. (print_object): Add syntax for records. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-2): New test. * test/src/alloc-tests.el (record-1, record-2, record-3): New tests. * doc/lispref/elisp.texi, doc/lispref/objects.texi, doc/lispref/records.texi: Add documentation for records.
2017-02-21Hash table threshold is now float, not doublePaul Eggert1-1/+1
Change default from 0.8 to 0.8125 so it fits in float without rounding glitches. * doc/lispref/hash.texi (Creating Hash): * doc/lispref/objects.texi (Hash Table Type): * etc/NEWS: Document change. * src/fns.c (make_hash_table, maybe_resize_hash_table) (Fmake_hash_table): Threshold is now float, not double. Be consistent about how this is rounded. * src/lisp.h (struct Lisp_Hash_Table.rehash_threshold): Change back to float, now that the other code rounds consistently. (DEFAULT_REHASH_THRESHOLD): Now float 0.8125 instead of double 0.8.
2016-12-31Update copyright year to 2017Paul Eggert1-1/+1
Run admin/update-copyright.
2016-12-10Documentation and commentary improvementsEli Zaretskii1-0/+69
* src/lisp.h: * src/regex.c: * src/xgselect.c (xg_select): Improve commentary and formatting. * doc/lispref/objects.texi (Thread Type, Mutex Type) (Condition Variable Type): New subsections. (Type Predicates): Add thread-related predicates. * doc/lispref/objects.texi (Editing Types): * doc/lispref/elisp.texi (Top): Update higher-level menus.
2016-04-21Improve character name escapesPaul Eggert1-26/+26
* doc/lispref/nonascii.texi (Character Properties): Avoid duplication of Unicode names. Reformat examples to fit in narrow pages. * doc/lispref/objects.texi (General Escape Syntax): Simplify and better-organize explanation of \N{...} escapes. * src/character.h (CHAR_SURROGATE_PAIR_P): Remove; unused. (char_surrogate_p): New inline function. * src/lread.c: Do not include string.h; no longer needed. (invalid_character_name, check_scalar_value): Remove; the ideas behind these functions are now bundled into character_name_to_code. (character_name_to_code): Remove undocumented support for "CJK IDEOGRAPH-XXXX" names, as "U+XXXX" suffices. Reject monstrosities like "\N{U+-0}" and null bytes in \N escapes. Reject floating point in \N escapes instead of returning garbage. Use AUTO_STRING_WITH_LEN to lessen pressure on the garbage collector. * test/src/lread-tests.el (lread-char-number, lread-char-name) (lread-string-char-number, lread-string-char-name): Test runtime behavior, not compile-time, as the test framework is not set up to test compile-time. (lread-char-surrogate-1, lread-char-surrogate-2) (lread-char-surrogate-3, lread-char-surrogate-4) (lread-string-char-number-2, lread-string-char-number-3): New tests. (lread-string-char-number-1): Rename from lread-string-char-number.
2016-04-21Add documentation for character name escapesPhilipp Stephani1-0/+10
2016-01-01Update copyright year to 2016Paul Eggert1-1/+1
Run admin/update-copyright.
2015-10-06* doc/lispref/objects.texi (Window Type): Add a cross reference.Xue Fuqiao1-2/+2
2015-10-03Doc fix for `defmacro'Xue Fuqiao1-2/+2
* doc/lispref/objects.texi (Macro Type): `defmacro' is a macro now.
2015-09-16Restore some of the quoting in the manualsEli Zaretskii1-1/+1
* doc/lispref/windows.texi (Coordinates and Windows) (Coordinates and Windows): * doc/lispref/variables.texi (Lexical Binding) (File Local Variables): * doc/lispref/text.texi (Format Properties): * doc/lispref/symbols.texi (Symbol Components): * doc/lispref/strings.texi (Creating Strings): * doc/lispref/sequences.texi (Sequence Functions): * doc/lispref/searching.texi (Regexp Special, Regexp Search) (Search and Replace): * doc/lispref/processes.texi (Bindat Spec): * doc/lispref/os.texi (Idle Timers): * doc/lispref/objects.texi (Basic Char Syntax): * doc/lispref/numbers.texi (Float Basics, Random Numbers): * doc/lispref/nonascii.texi (Character Properties): * doc/lispref/modes.texi (Major Mode Conventions, Mode Hooks) (Mode Line Variables): * doc/lispref/minibuf.texi (Text from Minibuffer): * doc/lispref/loading.texi (Autoload): * doc/lispref/keymaps.texi (Controlling Active Maps): * doc/lispref/frames.texi (Frame Layout, Size and Position) (Size Parameters, Implied Frame Resizing): * doc/lispref/files.texi (Changing Files, Magic File Names): * doc/lispref/eval.texi (Self-Evaluating Forms): * doc/lispref/display.texi (Progress, Abstract Display) (Abstract Display Example, Bidirectional Display): * doc/lispref/commands.texi (Event Mod): * doc/emacs/windows.texi (Displaying Buffers): * doc/emacs/trouble.texi (Bug Criteria, Checklist): * doc/emacs/text.texi (Enriched Text): * doc/emacs/programs.texi (MixedCase Words): * doc/emacs/picture-xtra.texi (Insert in Picture) (Tabs in Picture): * doc/emacs/misc.texi (Emacs Server, Printing): * doc/emacs/mini.texi (Minibuffer History): * doc/emacs/maintaining.texi (Old Revisions, VC Change Log) (Pulling / Pushing): * doc/emacs/killing.texi (Yanking, Cut and Paste, Clipboard): * doc/emacs/help.texi (Help, Help Echo): * doc/emacs/glossary.texi (Glossary): * doc/emacs/frames.texi (Mouse Commands, Creating Frames) (Frame Commands): * doc/emacs/files.texi (Reverting, Saving, Directories): * doc/emacs/entering.texi (Exiting): * doc/emacs/emacs.texi (Top): * doc/emacs/cmdargs.texi (Window Size X, Icons X): * doc/emacs/anti.texi (Antinews): Restore quoting of text where appropriate or replace quoting with @dfn. * doc/misc/ediff.texi (Window and Frame Configuration): * doc/lispref/processes.texi (Network Feature Testing): * doc/lispref/display.texi (Display Margins): Quote the phrase after "a.k.a." where appropriate.
2015-09-15Quote less in manualsPaul Eggert1-16/+16
The manuals often used quotes ``...'' when it is better to use @dfn or @code or capitalized words or no quoting at all. For example, there is no need for the `` and '' in “if a variable has one effect for @code{nil} values and another effect for ``non-@code{nil}'' values”. Reword the Emacs, Lisp intro, and Lisp reference manuals to eliminate unnecessary quoting like this, and to use @dfn etc. instead when called for (Bug#21472).
2015-05-01Prefer plain characters to Texinfo circumlocutionsPaul Eggert1-8/+2
For example, prefer 'François' to 'Fran\c{c}ois', 'Fran\c cois', 'Fran@,{c}ois' or 'Francois' (all of which were used!) in Texinfo sources.
2015-04-10Minor quoting etc. fixes to lispref manualPaul Eggert1-3/+3
* doc/lispref/tips.texi (Documentation Tips): Distinguish more clearly among grave accent, apostrophe, and single quote. * doc/lispref/README, doc/lispref/buffers.texi: * doc/lispref/commands.texi, doc/lispref/control.texi: * doc/lispref/customize.texi, doc/lispref/display.texi: * doc/lispref/elisp.texi, doc/lispref/files.texi: * doc/lispref/frames.texi, doc/lispref/hash.texi: * doc/lispref/help.texi, doc/lispref/internals.texi: * doc/lispref/loading.texi, doc/lispref/makefile.w32-in: * doc/lispref/markers.texi, doc/lispref/modes.texi: * doc/lispref/nonascii.texi, doc/lispref/objects.texi: * doc/lispref/os.texi, doc/lispref/positions.texi: * doc/lispref/strings.texi, doc/lispref/syntax.texi: * doc/lispref/text.texi, doc/lispref/tips.texi: * doc/lispref/two-volume-cross-refs.txt, doc/lispref/windows.texi: Use American-style double quoting in ordinary text, and quote 'like this' when single-quoting in ASCII text. Also, fix some minor spacing issues.
2015-03-24* doc/lispref/objects.texi (Equality Predicates): Fix typo in example.Glenn Morris1-2/+2
2015-03-02Finalizer documentation, minor improvementsDaniel Colascione1-5/+32
* doc/lispref/objects.texi (Finalizer Type): New section (Type Predicates): Mention finalizers in `type-of' documentation. * doc/lispref/elisp.texi (Top): Link to finalizer type. * src/data.c (Ftype_of): Make `type-of' work with finalizers. (syms_of_data): Register Qfinalizer. * src/print.c (print_object): Print whether a finalizer has been called. * test/automated/finalizer-tests.el (finalizer-object-type): Test that `type-of' works correctly for finalizers.
2015-01-01Update copyright year to 2015Paul Eggert1-1/+1
Run admin/update-copyright.
2015-01-01Update copyright year to 2015Paul Eggert1-1/+1
Run admin/update-copyright.