aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge from origin/emacs-28Paul Eggert2021-10-131-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | efb1cd7fa9 ; * etc/charsets/README: Update the format documentation. cc796b7409 Tramp doc cleanup a338d46060 Make emacs-lisp-byte-compile-and-load load the .elc file a... 3eac7dc780 Fix point movement in image-dired 4e9452a399 Improve shortdoc for vector f223ac6ef9 Fix test bug when calloc returns null ebeaa54f19 Pacify GCC 11 -fanalyzer on x86-64 56d1f42f30 Improve handling of non-character events in input methods 3fbe6fd367 ; Fix mistakes in last doc rewording about shorthands
| * Pacify GCC 11 -fanalyzer on x86-64Paul Eggert2021-10-121-1/+3
| | | | | | | | | | | | * src/buffer.c (fix_overlays_before): Redo slightly to work around GCC bug 102692 <https://gcc.gnu.org/bugzilla//show_bug.cgi?id=102692>.
* | Merge from origin/emacs-28Glenn Morris2021-10-081-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | af01b674ce (origin/emacs-28) ; Fix spacing in previous commit 915e044d60 Use the correct label in the warning 6e83a4100a ; * admin/make-tarball.txt: Should configure --with-native... 525602d682 ; * etc/TODO (display): Add entry about Default_Ignorables. 65de510c16 ; Fix 'restore-buffer-modified-p' doc string typo 9d8202b45e Add Emacs 27 compatibility hack 89d64fca75 Pacify GCC 10.3 -Wmaybe-uninitialized bb8ef1aa30 * lisp/tab-bar.el (tab-detach, tab-window-detach): New ali... 7ae70054aa ; * src/composite.h (LGSTRING_FONT): Add comment about its... 1af00e67d6 Include the refcards in the release tarball 3c29fb705c ; * src/Makefile.in (../native-lisp): Make the long recipe...
| * ; Fix 'restore-buffer-modified-p' doc string typoStephen Gildea2021-10-071-1/+1
| | | | | | | | | | | | * src/buffer.c (restore-buffer-modified-p): Fix typo in doc string: "and" for "or" regarding lock/unlock. Note that 'set-buffer-modified-p' doc string already uses the correct "or".
* | Add an optional parameter to kill-all-local-variablesLars Ingebrigtsen2021-10-061-5/+7
|/ | | | | | | | | | | * doc/lispref/variables.texi (Creating Buffer-Local): Document it (bug#30204). * src/buffer.c (Fkill_all_local_variables): Allow killing permanent local variables, too. * src/print.c (temp_output_buffer_setup): * src/minibuf.c (set_minibuffer_mode): Adjust callers.
* Improve documentation of line truncation and wrappingEli Zaretskii2021-09-041-1/+4
| | | | | | | | | | | | * doc/emacs/display.texi (Line Truncation, Visual Line Mode): * doc/lispref/display.texi (Truncation): Document that turning on line truncation disables wrapping, and vice versa. * src/buffer.c (syms_of_buffer) <truncate-lines>: * src/xdisp.c (syms_of_xdisp) <truncate-partial-width-windows>: Warn against turning on when 'visual-line-mode' is in effect. * lisp/simple.el (visual-line-mode): Document that this mode disables line truncation. (Bug#29664)
* Fix up deleting auto-save/killing buffer wrt. `auto-save-visited-mode'Lars Ingebrigtsen2021-08-251-3/+7
| | | | * src/buffer.c (Fkill_buffer): Respect `auto-save-visited-mode'.
* Further checks for kill-buffer-delete-auto-save-filesLars Ingebrigtsen2021-08-251-0/+2
| | | | | * src/buffer.c (Fkill_buffer): Check that the auto-save file exists before asking whether to delete it.
* Add new variable 'kill-buffer/delete-auto-save-files'Lars Ingebrigtsen2021-08-231-20/+29
| | | | | | | | | | | | | | | * doc/emacs/files.texi (Auto Save Files): Document it. * lisp/cus-start.el (standard): Add customize form. * lisp/files.el (delete-auto-save-files): Move definition to C (since it's used in the C layer). * src/buffer.c (Fkill_buffer): Use the new variable (and remove the old code that apparently didn't trigger for kill-buffer/delete-auto-save-files. (syms_of_buffer): Add new variable kill-buffer-delete-auto-save-files and move definition of delete-auto-save-files here (bug#21612).
* Make overlays-in treat zero-length overlays at point-max consistentlyLars Ingebrigtsen2021-08-161-2/+3
| | | | | | | | * doc/lispref/display.texi (Finding Overlays): Adjust documentation. * src/buffer.c (overlays_in): Treat the end of the buffer and the end of the narrowed-to buffer the same (bug#19422). (Foverlays_in): Adjust doc string.
* Make `kill-all-local-variables' also remove lambda from hooksjakanakaevangeli2021-07-201-6/+6
| | | | | * src/buffer.c (reset_buffer_local_variables): Also remove non-symbol elements from hook variables (bug#46407).
* Mention `overlays-in' in the `overlays-at' doc stringLars Ingebrigtsen2021-07-201-1/+5
| | | | | * src/buffer.c (Foverlays_at): Mention `overlays-in' in the doc string (bug#459).
* Fix typos in a recent changeEli Zaretskii2021-07-191-1/+1
| | | | | | | * src/buffer.c (Fmake_indirect_buffer): Fix a typo in a recent change. * doc/lispref/buffers.texi (Indirect Buffers): Fix punctuation.
* Add inhibit-buffer-hooks to `make-indirect-buffer'Lars Ingebrigtsen2021-07-191-4/+11
| | | | | | | * doc/lispref/buffers.texi (Indirect Buffers): Document it (bug#49160). * src/buffer.c (Fmake_indirect_buffer): Allow controlling whether to inhibit buffer hooks.
* Make make-indirect-buffer inherit inhibit-buffer-hook from base bufferdickmao2021-07-191-0/+1
| | | | | | | * src/buffer.c (Fmake_indirect_buffer): Match base buffer's inhibit-buffer-hooks. * test/src/buffer-tests.el (buffer-tests-inhibit-buffer-hooks-indirect): Add a test (bug#49160).
* * src/buffer.c (kill-buffer): Fix a typo.Matthew White2021-07-111-1/+1
| | | | * src/buffer.c (Fkill_buffer): Fix typo in comment.
* Further cleanup for file locksMichael Albinus2021-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/tramp.texi (Top, Configuration): Adapt node name for file locks. (Auto-save File Lock and Backup): Rename node name and section title. Add file-lock to @cindex. Describe file locks. * lisp/dired.el (dired-trivial-filenames): Add lock files. (dired-font-lock-keywords): Move files suffixed with `completion-ignored-extensions' up. Add lock files to these checks. * lisp/net/tramp.el (tramp-get-lock-file, tramp-handle-unlock-file): Use `when-let' (tramp-lock-file-info-regexp): Rename from `tramp-lock-file-contents-regexp'. (tramp-handle-file-locked-p, tramp-handle-lock-file): Adapt callees. (tramp-handle-lock-file): Set file modes of lockname. * src/buffer.c (Frestore_buffer_modified_p): * src/fileio.c (write_region): * src/insdel.c (prepare_to_modify_buffer_1): Call Flock_file. * src/filelock.c (Qmake_lock_file_name): Declare symbol. (make_lock_file_name): Use it. Don't check Fboundp, it doesn't work for interned symbols. (lock_file): Return a Lisp_Object. Don't check create_lockfiles. Remove MSDOS version of the function. (Flock_file): Check create_lockfiles. (Flock_buffer): Call Flock_file. * src/lisp.h (lock_file): Remove. * test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo) (shadow-test09-shadow-copy-files): Let-bind `create-lockfiles'. * test/lisp/net/tramp-tests.el (create-lockfiles): Don't set it globally. (tramp-test39-lock-file): Check also for `set-visited-file-name'.
* Code cleanup wrt file locksMichael Albinus2021-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/files.el (make-lock-file-name): Fix docstring. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): * lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist): * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): * lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): Add `make-lock-file-name'. * lisp/net/tramp.el (tramp-file-name-for-operation): Add `make-lock-file-name'. (tramp-handle-unlock-file): Call `userlock--handle-unlock-error' in case of error. * src/buffer.c (Frestore_buffer_modified_p): * src/editfns.c (Freplace_buffer_contents): * src/fileio.c (Finsert_file_contents, write_region): Call Funlock_file. * src/filelock.c (unlock_file): Rename from unlock_file_body. Remove the other declarations of unlock_file. Move file name handler check to ... (Funlock_file): ... here. Adapt argument numbers. Call unlock_file wrapped by internal_condition_case. (Flock_file): Adapt argument numbers. (unlock_all_files, Funlock_buffer, unlock_buffer): Call Funlock_file. * src/lisp.h (unlock_file): Remove.
* Merge from origin/emacs-27Glenn Morris2021-05-221-4/+4
|\ | | | | | | | | 30e5d93ee1 (origin/emacs-27) Improve documentation of display tables 8804ac857b * src/buffer.c (syms_of_buffer) <ctl-arrow>: Doc fix. (Bu...
| * * src/buffer.c (syms_of_buffer) <ctl-arrow>: Doc fix. (Bug#48539)Eli Zaretskii2021-05-211-4/+4
| |
* | Merge from origin/emacs-27Glenn Morris2021-05-041-3/+6
|\ \ | |/ | | | | | | | | | | 101a049f55 Improve doc string of 'tab-width'. 43c154404e * lisp/emacs-lisp/elp.el: Doc fixes. 1984213f62 * lisp/emacs-lisp/pp.el: Doc fixes. 6486c9dc73 * admin/make-tarball.txt: Note to update more files on web...
| * Improve doc string of 'tab-width'.Eli Zaretskii2021-04-301-3/+6
| | | | | | | | | | * src/buffer.c (syms_of_buffer) <tab-width>: Clarify doc string. (Bug#48058)
| * Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | Fix the unexec build on MS-WindowsEli Zaretskii2021-04-301-2/+9
| | | | | | | | | | | | | | * src/buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: If dumped with unexec, be sure to map new memory also for the " prin1" buffer. For the reasons and discussion, see https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg01401.html.
* | * src/buffer.c (Fbuffer_swap_text): Swap `mark-active` as wellStefan Monnier2021-03-091-0/+1
| | | | | | | | | | This avoids undesirable situations where `mark-active` is set even though the `mark` isn't.
* | Call the set_buffer_overlays_ settersMatt Armstrong2021-03-041-2/+2
| | | | | | | | | | | | * src/buffer.c (Fkill_buffer): Call set_buffer_overlays_before and set_buffer_overlays_after instead of setting the fields directly (bug#46914).
* | Rename minor-modes to local-minor-modesLars Ingebrigtsen2021-02-151-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Minor Modes): Update documentation. * lisp/simple.el (completion-with-modes-p): Change usage. * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Change usage. * src/buffer.c: Rename from minor_modes to local_minor_modes throughout. (syms_of_buffer): Rename minor-modes to local-minor-modes. * src/buffer.h (struct buffer): Rename minor_modes_. * src/pdumper.c (dump_buffer): Update hash and usage.
* | Add a new buffer-local variable `minor-modes'Lars Ingebrigtsen2021-02-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Keep `minor-modes' updated. * src/buffer.c (bset_minor_modes, Fmake_indirect_buffer) (reset_buffer, init_buffer_once): Initialise `minor-modes'. (syms_of_buffer): Add `minor-modes' as a new permanently-local variable. * src/buffer.h (struct buffer): Add minor_modes_.
* | Add functions to open a file without quitting.Philipp Stephani2021-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some situations, e.g. when the Lisp machinery isn't available, we can't quit. Don't check the quit flags in such situations, in case they contain garbage. * src/sysdep.c (emacs_open_noquit, emacs_openat_noquit): New variants of 'emacs_open' and 'emacs_openat' that don't check the quit flags. * src/emacs.c (main, Fdaemon_initialized): * src/pdumper.c (pdumper_load): * src/w32term.c (w32_initialize): * src/buffer.c (mmap_init): * src/callproc.c (emacs_spawn): Use them where we can't quit.
* | * lisp/subr.el (ctl-x-map): Initialize inside the declaration.Stefan Monnier2021-01-041-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/command.h (control_x_map): * src/keymap.c (control_x_map): Delete variable. (syms_of_keymap): * src/keyboard.c (keys_of_keyboard): * src/casefiddle.c (keys_of_casefiddle): * src/window.c (keys_of_window): Move initialization of ctl-x-map to subr.el. * src/lisp.h (syms_of_buffer): * src/buffer.c (keys_of_buffer): Delete function. * src/emacs.c (main): Don't call it.
* | * src/buffer.c (Fset_buffer_multibyte): Remove dead codeStefan Monnier2021-01-031-5/+0
| |
* | Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | Inhibit buffer hooks in temporary buffersBasil L. Contovounesios2020-12-201-38/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give get-buffer-create an optional argument to inhibit buffer hooks in internal or temporary buffers for efficiency (bug#34765). * etc/NEWS: Announce new parameter of get-buffer-create and generate-new-buffer, and that with-temp-buffer and with-temp-file now inhibit buffer hooks. * doc/lispref/buffers.texi (Buffer Names): Fix typo. (Creating Buffers): Document new parameter of get-buffer-create and generate-new-buffer. (Buffer List, Killing Buffers): Document when buffer hooks are inhibited. (Current Buffer): * doc/lispref/files.texi (Writing to Files): Document that with-temp-buffer and with-temp-file inhibit buffer hooks. * doc/lispref/internals.texi (Buffer Internals): Document inhibit_buffer_hooks flag. Remove stale comment. * doc/misc/gnus-faq.texi (FAQ 5-8): * lisp/simple.el (shell-command-on-region): Fix indentation. * lisp/files.el (kill-buffer-hook): Document when hook is inhibited. (create-file-buffer): * lisp/gnus/gnus-uu.el (gnus-uu-unshar-article): * lisp/international/mule.el (load-with-code-conversion): * lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image): * lisp/net/imap.el (imap-open): * lisp/net/mailcap.el (mailcap-maybe-eval): * lisp/progmodes/flymake-proc.el (flymake-proc--read-file-to-temp-buffer) (flymake-proc--copy-buffer-to-temp-buffer): Simplify. * lisp/subr.el (generate-new-buffer): Forward new optional argument to inhibit buffer hooks to get-buffer-create. (with-temp-file, with-temp-buffer, with-output-to-string): * lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer used. * src/buffer.c (run_buffer_list_update_hook): New helper function. (Fget_buffer_create): Use it. Add optional argument to set inhibit_buffer_hooks flag instead of comparing the buffer name to Vcode_conversion_workbuf_name. All callers changed. (Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal) (record_buffer): Use run_buffer_list_update_hook. (Fkill_buffer): Document when buffer hooks are inhibited. Use run_buffer_list_update_hook. (init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer. (Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document when hooks are inhibited. * src/buffer.h (struct buffer): Update inhibit_buffer_hooks commentary. * src/coding.h (Vcode_conversion_workbuf_name): * src/coding.c (Vcode_conversion_workbuf_name): Make static again since it is no longer needed in src/buffer.c. (code_conversion_restore, code_conversion_save, syms_of_coding): Prefer boolean over integer constants. * src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in " *code-converting-work*" buffer. * src/window.c (Fselect_window): Fix grammar. Mention window-selection-change-functions alongside buffer-list-update-hook. * test/src/buffer-tests.el: Fix requires. (buffer-tests-inhibit-buffer-hooks): New test.
* | Fix my two most common causes of all windows/frames redisplayStefan Monnier2020-12-171-1/+1
| | | | | | | | | | * src/buffer.c (Fkill_all_local_variables): Only redisplay the buffer. * src/window.c (set_window_scroll_bars): Only redisplay the window.
* | Merge from origin/emacs-27Glenn Morris2020-12-011-2/+3
|\ \ | |/ | | | | | | | | 749e4b7e0b Reset xref-show-xrefs-function temporarily 3e6525d69f Don't show in 'view-lossage' responses to xterm feature qu... 9fbff9c35c ; * src/buffer.c: Fix comment describing 'buffer_defaults'.
| * ; * src/buffer.c: Fix comment describing 'buffer_defaults'.Eli Zaretskii2020-11-301-2/+3
| |
* | * src/buffer.h (struct buffer): Remove unused field `minor_modes`Stefan Monnier2020-11-191-7/+0
| | | | | | | | | | * src/buffer.c (bset_minor_modes): Remove function. (reset_buffer_local_variables, init_buffer_once): Don't set `minor_modes`.
* | Merge from origin/emacs-27Glenn Morris2020-11-021-0/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | 1fc9de4b81 Improve reproducibility of generated -pkg.el files da6234e2df Make sure pixel sizes are zero when setting window size fo... 2d15296db1 Fix failure of 'emacs --daemon' on Cygwin 8abce5b0c6 CC Mode: Only recognize foo (*bar) as a function pointer w... 85d1d8d768 Fix NEWS entry for fix of Bug#44080 2443b15a91 * src/buffer.c (syms_of_buffer) <fill-column>: Improve doc... # Conflicts: # etc/NEWS
| * * src/buffer.c (syms_of_buffer) <fill-column>: Improve doc string.Eli Zaretskii2020-10-271-0/+3
| |
* | Simplify use of __lsan_ignore_objectPaul Eggert2020-08-031-6/+0
| | | | | | | | | | | | | | | | | | * configure.ac: Use AC_CHECK_FUNCS_ONCE for __lsan_ignore_object. * src/buffer.c, src/data.c, src/emacs-module.c, src/regex-emacs.c: * src/search.c: Use __lsan_ignore_object unconditionally, and don’t include sanitizer/lsan_interface.h. * src/lisp.h (__lsan_ignore_object): Provide a dummy in the typical case where leak sanitization is not available.
* | Use a more precise check for '__lsan_ignore_object'Philipp Stephani2020-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | * configure.ac: Add check for __lsan_ignore_object. * src/buffer.c (enlarge_buffer_text): * src/data.c (make_blv): * src/emacs-module.c (Fmodule_load, initialize_environment): * src/regex-emacs.c (regex_compile): * src/search.c (newline_cache_on_off): Use new configuration macro.
* | Suppress leak detector in some casesPhilipp Stephani2020-08-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We intentionally leak some objects. Prevent the ASan leak detector from raising false alarms in these cases. * configure.ac: Search for lsan_interface.h header. * src/data.c (make_blv): Allow leaking of buffer-local values. * src/buffer.c (enlarge_buffer_text): Allow leaking of buffer text. * src/emacs-module.c (Fmodule_load, initialize_environment): Allow intentional leak of runtime and environment objects if module assertions are enabled.
* | Restore buffer-undo-list to buffer-local-variablesGlenn Morris2020-05-181-10/+30
| | | | | | | | | | | | | | | | It has been missing since 2012-07-03 (Emacs 24.3) "Cleanup basic buffer management", when undo_list was moved to the end of struct buffer. (Bug#33492) * src/buffer.c (buffer_local_variables_1): New function. (Fbuffer_local_variables): Explicitly add buffer-undo-list.
* | Fix string-to-multibyte overlong sequence bugPaul Eggert2020-04-201-2/+1
| | | | | | | | | | | | | | | | | | * src/character.h (MULTIBYTE_LENGTH, MULTIBYTE_LENGTH_NO_CHECK): Remove, replacing with ... (multibyte_length): ... this new function. All callers changed. The new function rejects overlong multibyte forms. * test/src/buffer-tests.el (buffer-multibyte-overlong-sequences): New test.
* | Prefer more inline functions in character.hPaul Eggert2020-04-171-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/buffer.h (fetch_char_advance, fetch_char_advance_no_check) (buf_next_char_len, next_char_len, buf_prev_char_len) (prev_char_len, inc_both, dec_both): New inline functions, replacing the old character.h macros FETCH_CHAR_ADVANCE, FETCH_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS, INC_POS, BUF_DEC_POS, DEC_POS, INC_BOTH, DEC_BOTH respectively. All callers changed. These new functions all assume buffer primitives and so need to be here rather than in character.h. * src/casefiddle.c (make_char_unibyte): New static function, replacing the old MAKE_CHAR_UNIBYTE macro. All callers changed. (do_casify_unibyte_string): Use SINGLE_BYTE_CHAR_P instead of open-coding it. * src/ccl.c (GET_TRANSLATION_TABLE): New static function, replacing the old macro of the same name. * src/character.c (string_char): Omit 2nd arg. 3rd arg can no longer be NULL. All callers changed. * src/character.h (SINGLE_BYTE_CHAR_P): Move up. (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE, PREV_CHAR_BOUNDARY) (STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE) (FETCH_STRING_CHAR_ADVANCE) (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE) (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE) (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH) (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): Remove. (make_char_multibyte): New static function, replacing the old macro MAKE_CHAR_MULTIBYTE. All callers changed. (CHAR_STRING_ADVANCE): Remove; all callers changed to use CHAR_STRING. (NEXT_CHAR_BOUNDARY): Remove; it was unused. (raw_prev_char_len): New inline function, replacing the old PREV_CHAR_BOUNDARY macro. All callers changed. (string_char_and_length): New inline function, replacing the old STRING_CHAR_AND_LENGTH macro. All callers changed. (STRING_CHAR): Rewrite in terms of string_char_and_length. (string_char_advance): New inline function, replacing the old STRING_CHAR_ADVANCE macro. All callers changed. (fetch_string_char_advance): New inline function, replacing the old FETCH_STRING_CHAR_ADVANCE macro. All callers changed. (fetch_string_char_as_multibyte_advance): New inline function, replacing the old FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE macro. All callers changed. (fetch_string_char_advance_no_check): New inline function, replacing the old FETCH_STRING_CHAR_ADVANCE_NO_CHECK macro. All callers changed. * src/regex-emacs.c (HEAD_ADDR_VSTRING): Remove; no longer used. * src/syntax.c (scan_lists): Use dec_bytepos instead of open-coding it. * src/xdisp.c (string_char_and_length): Rename from string_char_and_length to avoid name conflict with new function in character.h. All callers changed.
* | Merge from origin/emacs-27Glenn Morris2020-04-051-4/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | 6de20c7eab (origin/emacs-27) Fix syntax error in man page. f8607d3c03 Handle filling of indented ChangeLog function entries 7e78f0d1b2 Fix void-variable n-reb in re-builder (Bug#40409) 452d776a5d Fix small bug in copy_string_contents. fa823653ff Fix invocations of gpg from Gnus d4f51d0a2e Don't draw GTK's internal border and tab bar on top of eac... 38731d504e ; * src/buffer.c (syms_of_buffer) <inhibit-read-only>: Doc... 44ac9e48bb Tweak htmlfontify's generated output
| * ; * src/buffer.c (syms_of_buffer) <inhibit-read-only>: Doc fix.Eli Zaretskii2020-04-031-4/+4
| |
* | Remove `all_buffers` and the associated `next` field of buffersStefan Monnier2020-03-311-30/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (enum mem_type): Remove MEM_TYPE_BUFFER. (allocate_buffer): Allocate like any other pseudovector. Don't register on `all_buffers` any more. (live_buffer_holding, live_buffer_p): Delete functions. (mark_maybe_object, valid_lisp_object_p): Don't pay attention to MEM_TYPE_BUFFER any more. (garbage_collect): Only compact the live buffers. (mark_buffer): Mark the undo_list of dead buffers here. (mark_object): Buffers are normal pseudovectors now. (sweep_buffers): Don't do the actual sweep here, just cleanup the markers and only for live buffers. * src/buffer.c (all_buffers): Remove variable. (Fkill_buffer): Don't check indirect dead buffers. Set the undo_list before we remove ourselves from the list of live buffers. (Fbuffer_swap_text, Fset_buffer_multibyte): Don't check indirect dead buffers. (init_buffer_once): Don't set `all_buffers`. (init_buffer): Don't map new memory for dead buffers. * src/buffer.h (struct buffer): Remove `next` field. (FOR_EACH_BUFFER): Remove macro. * src/pdumper.c (dump_buffer): Don't dump the `next` field.
* | Avoid assertion violation at startup in pdumped EmacsEli Zaretskii2020-03-301-11/+0
| | | | | | | | | | | | | | | | | | * src/buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Remove the assertion that ensured all buffers in pdumped Emacs have non-NULL pointer to buffer text. That was false when Emacs was pdumped with killed buffer(s) in the all_buffers linked list. See https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00800.html for more details.
* | Treat out-of-range positions consistentlyPaul Eggert2020-03-271-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a position argument to get-byte etc. is an out-of-range integer, treat it the same regardless of whether it is a fixnum or a bignum. * src/buffer.c (fix_position): New function. * src/buffer.c (validate_region): * src/character.c (Fget_byte): * src/coding.c (Ffind_coding_systems_region_internal) (Fcheck_coding_systems_region): * src/composite.c (Ffind_composition_internal): * src/editfns.c (Fposition_bytes, Fchar_after, Fchar_before) (Finsert_buffer_substring, Fcompare_buffer_substrings) (Fnarrow_to_region): * src/fns.c (Fsecure_hash_algorithms): * src/font.c (Finternal_char_font, Ffont_at): * src/fringe.c (Ffringe_bitmaps_at_pos): * src/search.c (search_command): * src/textprop.c (get_char_property_and_overlay): * src/window.c (Fpos_visible_in_window_p): * src/xdisp.c (Fwindow_text_pixel_size): Use it instead of CHECK_FIXNUM_COERCE_MARKER, so that the code is simpler and treats bignums consistently with fixnums. * src/buffer.h (CHECK_FIXNUM_COERCE_MARKER): Define here rather than in lisp.h, and reimplement in terms of fix_position so that it treats bignums consistently with fixnums. * src/lisp.h (CHECK_FIXNUM_COERCE_MARKER): Move to buffer.h. * src/textprop.c (validate_interval_range): Signal with original bounds rather than modified ones.