1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-03 22:20:52 -08:00
emacs/test/src
Basil L. Contovounesios 1a0a11f7d2 Inhibit buffer hooks in temporary buffers
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.
2020-12-20 17:32:24 +00:00
..
emacs-module-resources Document and enforce some properties for strings created by modules. 2020-12-12 23:28:22 +01:00
lread-resources Move some test data to follow our conventions 2020-10-23 16:29:46 +02:00
regex-resources ; Fix more typos 2020-10-03 12:53:51 +02:00
syntax-resources Enhance syntax-tests.el to test nestable comments (Lisp style) 2020-11-17 16:51:49 +00:00
alloc-tests.el Fix crash when sending Gnus message (Bug#39207) 2020-01-22 23:44:34 -08:00
buffer-tests.el Inhibit buffer hooks in temporary buffers 2020-12-20 17:32:24 +00:00
callint-tests.el Adapt some tests for Emacs's excitingly variable quoting format 2020-09-12 11:57:42 -07:00
callproc-tests.el Fix error in 'call-process-region' when START is nil (Bug#40576) 2020-04-12 19:04:11 +02:00
casefiddle-tests.el Fupcase no longer maps ?ß to itself (bug#11309) 2020-12-10 11:02:27 +01:00
charset-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
chartab-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
cmds-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
coding-tests.el Merge from origin/emacs-27 2020-10-02 09:38:24 -07:00
data-tests.el Prefer setq-local in tests 2020-12-08 08:57:22 +01:00
decompress-tests.el Use lexical-binding in most src tests 2020-04-24 18:25:13 +02:00
editfns-tests.el Use lexical-binding in more tests 2020-08-29 22:41:51 +02:00
emacs-module-tests.el Document and enforce some properties for strings created by modules. 2020-12-12 23:28:22 +01:00
eval-tests.el Add new variable to selectively suppress backtraces in batch mode. 2020-12-07 11:59:06 +01:00
fileio-tests.el Fix 'expand-file-name' for remote files 2020-09-03 20:16:33 +03:00
floatfns-tests.el Use lexical-binding in most src tests 2020-04-24 18:25:13 +02:00
fns-tests.el Fix object-interval tests 2020-12-11 15:21:44 +01:00
font-tests.el Use lexical-binding in most src tests 2020-04-24 18:25:13 +02:00
indent-tests.el Fix 'move-to-column' when invisible text follows a TAB 2020-09-30 17:33:58 +03:00
inotify-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
json-tests.el Fix undefined behavior in json.c (Bug#42113) 2020-06-29 12:32:56 +02:00
keyboard-tests.el Give Lisp control on the lossage size 2020-09-17 16:32:18 +02:00
keymap-tests.el Convert apropos-internal from C to Lisp (Bug#44529) 2020-12-19 19:54:46 +01:00
lcms-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
lread-tests.el Move some test data to follow our conventions 2020-10-23 16:29:46 +02:00
marker-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
minibuf-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
print-tests.el Reduce integer-output-format to print-integers-as-characters 2020-11-06 13:55:32 +01:00
process-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
regex-emacs-tests.el Recognise ß properly as a lower-case letter (bug#11309) 2020-12-09 15:29:48 +01:00
syntax-tests.el Enhance syntax-tests.el to test nestable comments (Lisp style) 2020-11-17 16:51:49 +00:00
textprop-tests.el Use lexical-binding in most src tests 2020-04-24 18:25:13 +02:00
thread-tests.el Use lexical-binding in most src tests 2020-04-24 18:25:13 +02:00
timefns-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
undo-tests.el ; Fix license statement in several files 2020-10-28 03:41:55 +01:00
xdisp-tests.el ; Silence byte-compiler warning in xdisp-tests.el 2020-11-05 15:44:17 +01:00
xfaces-tests.el Minor improvements as followup to recent RGB string-parsing change 2020-06-22 18:32:01 +03:00
xml-tests.el Repurpose libxml test for obsolete argument 2020-09-26 11:48:09 +02:00