1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 22:41:06 -08:00
Commit graph

17 commits

Author SHA1 Message Date
Eli Zaretskii
191b4cd9a7 ; Fix compilation warning in string-edit.el
* lisp/textmodes/string-edit.el (string-edit): Avoid shadowing the
global 'major-mode'.
2025-04-26 18:01:42 +03:00
Spencer Baugh
8f58f55551 Improve help-fns-edit-variable for Lisp editing
Before d50c82f3e9 ("Simplify
'help-enable-variable-value-editing' using 'string-edit'"),
'help-fns-edit-variable' would open a buffer in 'emacs-lisp-mode'
and would not allow exiting that buffer with an invalid Lisp
expression.  Restore that functionality by enhancing 'string-edit'
to allow choosing a major mode and allow passing a function to
validate the buffer contents before returning.
* lisp/help-fns.el (help-fns-edit-variable): Call 'string-edit',
passing 'emacs-lisp-mode' and 'read'.
* lisp/textmodes/string-edit.el (string-edit--read): Add.
(string-edit): Add :major-mode and :read arguments and avoid
passive voice.
(read-string-from-buffer): Avoid passive voice in docs.
(string-edit-mode-map, string-edit-minor-mode-map)
(string-edit-mode, string-edit-minor-mode): Move 'string-edit'
keybindings to a minor mode.
(string-edit-done): Call 'string-edit--read' before exiting.
(Bug#77834)
2025-04-26 14:53:18 +03:00
Eli Zaretskii
59d1aac49d Document return values of the various read-* functions
* lisp/textmodes/string-edit.el (read-string-from-buffer):
* lisp/simple.el (read-from-kill-ring, read-shell-command)
(read-signal-name):
* lisp/replace.el (read-regexp-case-fold-search):
* lisp/auth-source.el (read-passwd):
* lisp/subr.el (read-key, read-number):
* lisp/minibuffer.el (read-file-name, read-no-blanks-input):
* lisp/international/mule-cmds.el (read-multilingual-string):
* lisp/language/japan-util.el (read-hiragana-string):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-mode, read-file-local-variable-value):
* lisp/faces.el (read-face-font, read-face-name):
* lisp/simple.el (read-extended-command):
* lisp/env.el (read-envvar-name):
* lisp/files.el (read-directory-name):
* lisp/faces.el (read-color):
* lisp/international/mule-diag.el (read-charset):
* lisp/emacs-lisp/map-ynp.el (read-answer):
* src/coding.c (Fread_coding_system)
(Fread_non_nil_coding_system):
* src/minibuf.c (Fread_command, Fread_from_minibuffer):
* src/lread.c (Fread_char, Fread_char_exclusive, Fread_event): Doc
fixes.
2025-03-09 15:02:39 +02:00
Stefan Kangas
7fa975adbc Update copyright year to 2025
Run "TZ=UTC0 admin/update-copyright".
2025-01-02 18:39:42 +01:00
Eli Zaretskii
6d12157fa8 Prevent deletion of separator in *edit string* buffer
* lisp/textmodes/string-edit.el (string-edit): Make the separator
line read-only.  (Bug#71405)
2024-06-15 11:37:34 +03:00
Eli Zaretskii
bd50c804ec Fix 'string-edit' when abort-callback is omitted
* lisp/textmodes/string-edit.el (string-edit): Set
'string-edit--abort-callback' even if ABORT-CALLBACK is nil.
(Bug#71406)
2024-06-08 16:07:24 +03:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Lars Ingebrigtsen
820e6f399d Fix thinko in read-string-from-buffer
* lisp/textmodes/string-edit.el (string-edit-done): Return an empty
string when the user has entered no text.
2022-10-12 13:40:51 +02:00
Lars Ingebrigtsen
5724ee6131 Make read-string-from-buffer and string-edit mention each other
* lisp/textmodes/string-edit.el (read-string-from-buffer)
(string-edit): Mention each other in the doc strings.
2022-10-11 13:02:27 +02:00
Juri Linkov
c8141f7675 * lisp/textmodes/string-edit.el: Improvements for pop-to-buffer (bug#33007)
* lisp/textmodes/string-edit.el (string-edit): Use pop-to-buffer
with fit-window-to-buffer after the buffer is filled with text.
(string-edit-done, string-edit-abort): Use (quit-window 'kill).
2022-05-11 10:50:12 +03:00
Lars Ingebrigtsen
9e24255bc5 Change parameter order for string-edit functions
* lisp/textmodes/string-edit.el (string-edit)
(read-string-from-buffer): Rework the function arguments so that
they're more similar to `read-string'.  Rename symbols throughout
the file from help-text to prompt.
2022-04-27 19:11:20 +02:00
Lars Ingebrigtsen
1f659cd336 Add autoload cookies to string-edit
* lisp/textmodes/string-edit.el (string-edit)
(read-string-from-buffer): Autoload.
2022-04-27 19:03:49 +02:00
Lars Ingebrigtsen
0613e7c33d Add an instruction header line to string-edit
* lisp/textmodes/string-edit.el (string-edit): Add a header line
with instructions.
2022-04-27 14:08:49 +02:00
Lars Ingebrigtsen
e1d0632003 Fix up some string-edit.el strings
* lisp/textmodes/string-edit.el (string-edit)
(read-string-from-buffer): Make doc strings use dynamic key
bindings.
(string-edit): Fix message at the end.
2022-04-25 09:47:54 +02:00
Lars Ingebrigtsen
1a6fa4c5d5 Use C-c C-k' instead of C-c C-d' to abort in string-edit
* lisp/textmodes/string-edit.el (string-edit-mode-map): Use `C-c
C-k' to abort.
2022-04-24 16:06:43 +02:00
Lars Ingebrigtsen
8ee21db4af Add new function `read-string-from-buffer'.
* doc/lispref/minibuf.texi (Text from Minibuffer): Document it.
* lisp/textmodes/string-edit.el: New file.
2022-04-24 15:16:00 +02:00