Commit graph

2115 commits

Author SHA1 Message Date
Paul Eggert
0b47d731c0 * lisp/simple.el (process-file): Clarify doc string. 2019-11-17 15:27:21 -08:00
Stephen Gildea
32d1c1fc1f ; Grammar in simple.el doc strings and comments
* lisp/simple.el: Improve the English grammar in some doc strings
and comments.
2019-11-16 21:19:22 -08:00
Juri Linkov
e4a62f8662 * lisp/simple.el (eval-expression-print-maximum-character): Use choice type.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00433.html
2019-11-17 00:10:19 +02:00
Braun Gábor
c9ede465de Make clone-buffer not unbind global variable
* lisp/simple.el (clone-buffer): Make clone-buffer not globally
unset locally void variable (bug#38179).

Copyright-paperwork-exempt: yes
2019-11-14 06:45:37 +01:00
Paul Eggert
555f5f78f8 Fix a few more minor quoting problems. 2019-11-11 22:54:41 -08:00
Juri Linkov
f216f38870 Move read-char-from-minibuffer from simple.el to subr.el and document it.
* doc/lispref/minibuf.texi (Multiple Queries):
Document read-char-from-minibuffer (bug#10477, bug#38076).

* lisp/subr.el (read-char-history)
(read-char-from-minibuffer-map)
(read-char-from-minibuffer-map-hash)
(read-char-from-minibuffer-insert-char)
(read-char-from-minibuffer-insert-other, empty-history)
(read-char-from-minibuffer): Move from simple.el to subr.el.
2019-11-10 23:06:37 +02:00
Juri Linkov
04ab674707 Add CHARS arg to read-char-from-minibuffer compatible with read-char-choice.
* lisp/simple.el (read-char-history):
Rename from read-char-from-minibuffer-history.  (Bug#38076)
(read-char-from-minibuffer-insert-char):
Rename from read-char-from-minibuffer-self-insert.
(read-char-from-minibuffer-map-hash): New defconst.
(read-char-from-minibuffer-insert-other): New command.
(read-char-from-minibuffer): Add optional args CHARS and HISTORY.
(zap-to-char): Use 'read-char-history as HISTORY arg of
read-char-from-minibuffer.

* lisp/emacs-lisp/map-ynp.el (read-answer): Use sit-for instead of sleep-for.
Replace short answer history yes-or-no-p-history with read-char-history.
2019-11-10 00:21:26 +02:00
Eli Zaretskii
4e4440272e Fix last change
* lisp/simple.el (goto-history-element)
(next-history-element): Fix quoting of "future history".

* doc/lispref/minibuf.texi (Minibuffer Commands)
(Text from Minibuffer): Add index entry and cross-reference
for "future history".  (Bug#38026)
2019-11-09 11:43:19 +02:00
Hong Xu
15f4c4156c Mention future history in history-related minibuffer commands
* lisp/simple.el (goto-history-element):
* doc/lispref/minibuf.texi (Minibuffer Commands): Explain
negative NABS.
* lisp/simple.el (next-history-element):
* doc/lispref/minibuf.texi (Minibuffer Commands): Mention
"future history."  (Bug#38026)
2019-11-09 11:36:35 +02:00
Mattias Engdegård
d75794fd5c Inhibit undo-in-region for mouse-drag-region (bug#37700)
'mouse-drag-region' leaves the region active around the dragged text,
so a straight undo did not revert the entire operation.  To remedy
this, inhibit undo-in-region when the last command was
mouse-drag-region.  (Method suggested by Stefan Monnier.)

* lisp/mouse.el (undo-drag-region): Set the undo-inhibit-region property.
* lisp/simple.el (undo): Inhibit undo-in-region if the last command
had the undo-inhibit-region property set.
* doc/lispref/symbols.texi (Standard Properties):
* doc/lispref/text.texi (Undo): Document undo-inhibit-region.
* etc/NEWS: Announce the property.
2019-10-31 17:41:29 +01:00
Juri Linkov
ba7755bfb7 Rename read-char-with-history to read-char-from-minibuffer (bug#10477)
* lisp/simple.el (read-char-from-minibuffer-history):
Rename from read-char-with-history--history.
(read-char-from-minibuffer-map):
Rename from read-char-with-history--map.
(read-char-from-minibuffer): Rename from read-char-with-history.
(read-char-from-minibuffer-self-insert): New command.
(zap-to-char): Use read-char-from-minibuffer.
2019-10-30 02:00:02 +02:00
Juri Linkov
bafcef87c3 Reimplement read-char-with-history based on read-from-minibuffer
* lisp/simple.el (read-char-with-history): Reimplement based on
read-from-minibuffer.
* lisp/simple.el (read-char-with-history--map): New variable
(bug#10477).
2019-10-30 00:01:11 +01:00
Hong Xu
70578e0777 Add doc for goto-history-element
* doc/lispref/minibuf.texi (Minibuffer Commands): Add
goto-history-element (bug#37948).
* lisp/simple.el (goto-history-element): Clarify NABS.
2019-10-28 16:20:52 +01:00
Lars Ingebrigtsen
3478f2f3d6 Make <up> work in read-char-with-history
* lisp/simple.el (read-char-with-history): Tweak to make
<up>/<down> also traverse the history (bug#10477).
2019-10-28 12:12:00 +01:00
Stefan Monnier
2aaced1686 * lisp/loadup.el: Load minibuffer after cl-generic
This is so minibuffer.el can make use of cl-generic

* lisp/minibuffer.el (minibuffer-local-completion-map):
Move switch-to-completions bindings here from...
* lisp/simple.el (minibuffer-local-completion-map): ... here.
2019-10-27 13:21:21 -04:00
Hong Xu
fc6de411a7 special-mode doc string clarification
* lisp/simple.el (special-mode): Make the doc string explain what
special modes are for (bug#37787).
2019-10-19 10:43:37 +02:00
Stefan Kangas
3cf92da6fa Improve documentation of shell-command-prompt-show-cwd
* doc/emacs/misc.texi (Single Shell):
* lisp/simple.el (shell-command): Document
'shell-command-prompt-show-cwd'.  (Bug#4987)
2019-10-17 12:55:25 +02:00
Juanma Barranquero
3ad407005b lisp/*.el, src/*.c: Doc fixes related to returning t vs non-nil
* lisp/progmodes/flymake-proc.el (flymake-proc--find-buffer-for-file):
Doc fix; return value is a buffer, not t.

* lisp/progmodes/ebrowse.el (ebrowse-member-display-p):
Doc fix; return value is the MEMBER argument, not nil.

* lisp/files.el (hack-one-local-variable-eval-safep):
* lisp/play/doctor.el (doctor-nounp, doctor-pronounp):
* lisp/progmodes/flymake-proc.el (flymake-proc--check-include):
* lisp/progmodes/js.el (js--broken-arrow-terminates-line-p):
Doc fix; a non-nil return value is not always t.

* lisp/image.el (image-type-available-p):
* lisp/simple.el (region-active-p):
* lisp/window.el (frame-root-window-p):
* src/buffer.c (Fbuffer_live_p):
* src/image.c (Finit_image_library):
* src/window.c (Fwindow_minibuffer_p):
Doc fix; a non-nil return value is always t.

* doc/lispref/minibuf.texi (Minibuffer Windows): Doc fix.
2019-10-17 02:45:06 +02:00
Juanma Barranquero
d4cfe67e8a lisp/*.el: Force non-nil result to t, to match docstring
* lisp/ido.el (ido-ignore-item-p):
* lisp/simple.el (use-region-p):
* lisp/whitespace.el (whitespace-style-face-p)
(whitespace-style-mark-p):
* lisp/calendar/cal-islam.el (calendar-islamic-leap-year-p):
* lisp/mail/rmail.el (rmail-is-text-p):
* lisp/mh-e/mh-alias.el (mh-alias-for-from-p):
* lisp/net/imap.el (imap-message-flag-permanent-p):
* lisp/progmodes/tcl.el (tcl-real-comment-p):
* lisp/textmodes/table.el (table--point-in-cell-p):
Normalize boolean result.
2019-10-14 23:53:16 +02:00
Lars Ingebrigtsen
a590a8058d Allow zap-to-char to use a history
* doc/emacs/killing.texi (Other Kill Commands): Document it.

* lisp/simple.el (read-char-with-history): New function (bug#10477).
(zap-to-char): Use it to have a history.
2019-10-14 05:09:32 +02:00
Lars Ingebrigtsen
f4424ca11f Make the previous-matching-history-element prompt clearer
* lisp/simple.el (previous-matching-history-element): Put the
default into the prompt (bug#380).
2019-10-13 07:14:03 +02:00
Stefan Kangas
552c20ce39 Support showing directory in shell command prompt
* lisp/simple.el (shell-command-prompt-show-cwd): New defcustom.
(async-shell-command, shell-command): Show current directory in prompt
when above option is non-nil.  (Bug#4987)
* etc/NEWS: Announce it.
2019-10-11 13:01:13 +02:00
Lars Ingebrigtsen
85b3d56276 New variable amalgamating-undo-limit
* doc/lispref/text.texi (Undo): Document it.

* lisp/simple.el (amalgamating-undo-limit): New variable (bug#31658).
2019-10-11 09:24:30 +02:00
Basil L. Contovounesios
373ffc5931 Clarify docs on newline and auto-fill-mode
* doc/lispref/text.texi (Commands for Insertion):
* lisp/simple.el (newline): Do not mention conditions specific to
'do-auto-fill' under documentation of 'newline' (bug#36702).
2019-10-08 00:10:19 +01:00
Paul Eggert
2f600e97e7 Avoid crashes when casifying noncontiguous regions
This is a followon fix for Bug#37477.
* lisp/simple.el (region-extract-function):
Use setq here, since the var is now defined in C code.
* src/casefiddle.c (casify_pnc_region): New function.
(Fupcase_region, Fdowncase_region, Fcapitalize_region)
(Fupcase_initials_region): Use it.
(Fupcase_initials_region): Add region-noncontiguous-p flag
for consistency with the others.  All uses changed.
(syms_of_casefiddle): Define Qbounds, Vregion_extract_function.
* src/insdel.c (prepare_to_modify_buffer_1):
* src/keyboard.c (command_loop_1):
Use Vregion_extraction_function.
* src/insdel.c (syms_of_insdel): No need to define
Qregion_extract_function.
* test/src/casefiddle-tests.el (casefiddle-oldfunc): New var.
(casefiddle-loopfunc, casefiddle-badfunc): New functions.
(casefiddle-invalid-region-extract-function): New test.
2019-09-22 10:45:14 -07:00
Juri Linkov
2879c3ec1b Support rectangular regions in capitalize-region and capitalize-dwim.
* lisp/simple.el (capitalize-dwim): Add arg region-noncontiguous-p
in capitalize-region call.

* src/casefiddle.c (Fcapitalize_region): Add arg region-noncontiguous-p.
If non-nil, operate on multiple chunks.  (Bug#37477)
(Fdowncase_region): Use builtin symbol Qregion_extract_function
rather than calling intern.
2019-09-22 02:00:01 +03:00
Lars Ingebrigtsen
b8e9baac9a Allow `process-contact' not to block
* doc/lispref/processes.texi (Process Information): Document it.

* lisp/simple.el (list-processes--refresh): Don't wait for contact
information for non-setup processes.

* src/process.c (Fprocess_contact): Take an optional parameter to
avoid blocking (bug#37408).
2019-09-20 20:19:28 +02:00
Lars Ingebrigtsen
27988f136c Put error output from M-! at the end of the error buffer
* lisp/simple.el (shell-command-on-region): Put the error output
at the end of the buffer instead of wherever point is (bug#7513).
This avoids interleaving error output.
2019-08-23 10:10:15 +02:00
Noam Postavsky
7e2090ee80 Respect global-eldoc-mode in minibuffers (Bug#36886)
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Accept
a BODY parameter.
* doc/lispref/modes.texi (Defining Minor Modes): Document new
parameter.
* etc/NEWS: Announce it.

* lisp/simple.el (read--expression): Move eldoc-mode setup to...
* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): ... here,
new function.
(global-eldoc-mode): Add or remove it to
eval-expression-minibuffer-setup-hook when enabling or disabling
global-eldoc-mode.  This enables eldoc in the minibuffer (solving
Bug#27202), only when global-eldoc-mode is enabled.
2019-08-20 20:20:52 -04:00
Lars Ingebrigtsen
3efe59a8dd Make newline-and-indent take a numeric prefix
* lisp/simple.el (newline-and-indent): Take a prefix argument to
say how many times to perform its action (bug#10927).
2019-08-17 16:47:16 -07:00
Paul Eggert
37257d6aca More-compatible subsecond calendrical timestamps
Instead of appending a subseconds member to the result of
‘decode-time’, this keeps the format unchanged unless you give
a new optional argument to ‘decode-time’.  Also, the augmented
format now puts the subsecond info in the SECONDS element, so
the total number of elements is unchanged; this is more
compatible with code that expects the traditional 9 elements,
such as ‘(pcase decoded-time (`(,SEC ,MIN ,HOUR ,DAY ,MON
,YEAR ,DOW ,DST ,ZONE) ...) ...)’.
* doc/lispref/os.texi, doc/misc/emacs-mime.texi, etc/NEWS:
* lisp/net/soap-client.el (soap-decode-date-time):
* lisp/simple.el (decoded-time):
Document the new behavior.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
* lisp/calendar/iso8601.el (iso8601-parse)
(iso8601-parse-time, iso8601-parse-duration)
(iso8601--decoded-time):
* lisp/calendar/parse-time.el (parse-time-string):
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
* lisp/org/org.el (org-parse-time-string):
* lisp/simple.el (decoded-time):
* src/timefns.c (Fdecode_time, Fencode_time):
* test/lisp/calendar/icalendar-tests.el:
(icalendar--decode-isodatetime):
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years)
(test-iso8601-date-dates, test-iso8601-date-obsolete)
(test-iso8601-date-weeks, test-iso8601-date-ordinals)
(test-iso8601-time, test-iso8601-combined)
(test-iso8601-duration, test-iso8601-intervals)
(standard-test-dates, standard-test-time-of-day-fractions)
(standard-test-time-of-day-beginning-of-day)
(standard-test-time-of-day-utc)
(standard-test-time-of-day-zone)
(standard-test-date-and-time-of-day, standard-test-interval):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/src/timefns-tests.el (format-time-string-with-zone)
(encode-time-dst-numeric-zone):
Revert recent changes that added a SUBSECS member to
calendrical timestamps, since that component is no longer
present (the info, if any, is now in the SECONDS member).
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
Support fractional seconds in the new form.  Simplify.
* src/timefns.c (Fdecode_time): Support new arg FORM.
(Fencode_time): Support subsecond resolution.
* test/src/timefns-tests.el (format-time-string-with-zone)
(decode-then-encode-time): Test subsecond calendrical timestamps.
2019-08-16 23:25:07 -07:00
Lars Ingebrigtsen
ec13c46bbd Include port numbers in `M-x list-processes'
* lisp/simple.el (list-processes--refresh): Include the port
numbers in the network connection list (bug#13604).
2019-08-15 00:16:02 -07:00
Glenn Morris
7343474b79 Merge from origin/emacs-26
0860ac0 (origin/emacs-26) Improve documentation of features that use ...
fae1ff6 Fix docstrings in pong
82a2894 Improve doc strings of 'append-to-buffer' and friends
cb0403d Fix octave-mode ElDoc support
691790b Avoid Groff hanging on MS-Windows when invoked by "M-x man"
2019-08-10 08:44:31 -07:00
Glenn Morris
f47fc426df Merge from origin/emacs-26
e7818cb Fix nnmail-expiry-wait docs and custom :types
8b7c776 * lisp/simple.el (kill-do-not-save-duplicates): Doc fix.  (Bu...
2019-08-10 08:44:31 -07:00
Eli Zaretskii
82a2894be4 Improve doc strings of 'append-to-buffer' and friends
* lisp/simple.el (append-to-buffer, prepend-to-buffer)
(copy-to-buffer): Doc fixes.
2019-08-09 10:31:39 +03:00
Mattias Engdegård
c676444a43 Add conditional operator xor to subr.el
Suggested by Oleh Krehel and implemented by Basil Contovounesios in
the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00547.html

* lisp/array.el (xor): Move unused function from here...
* lisp/subr.el: ...to here, and improve.
* lisp/gnus/spam.el (spam-xor):
* lisp/play/5x5.el (5x5-xor):
* lisp/proced.el (proced-xor):
* lisp/progmodes/idlwave.el (idlwave-xor):
* lisp/vc/diff-mode.el (diff-xor): Define as obsolete aliases of,
and replace all uses with, xor.
* lisp/jsonrpc.el: Remove unused dependency on array.el.
* lisp/org/org.el (org-xor): Move from here...
* lisp/org/org-compat.el (org-xor): ...to here, as a compatibility
shim for xor.
* lisp/progmodes/idlw-shell.el (idlwave-shell-enable-all-bp):
* lisp/simple.el (exchange-point-and-mark):
* lisp/windmove.el (windmove-display-in-direction): Use xor.
* lisp/strokes.el (strokes-xor): Remove commented-out xor
implementation.

* doc/lispref/control.texi (Control Structures): Extend menu entry
for new combining condition.
(Combining Conditions):
* etc/NEWS (Lisp Changes): Document xor.

* test/lisp/subr-tests.el (subr-test-xor): New test.
2019-08-06 13:38:47 +02:00
Paul Eggert
b06917a491 decode-time now returns subsec too
The list that decode-time returns now contains an extra
trailing component that counts the subseconds part of the
original timestamp (Bug#36549).
This builds on a suggestion by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00734.html
* doc/lispref/os.texi (Time Conversion):
* doc/misc/emacs-mime.texi (time-date):
* etc/NEWS: Document this.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
* lisp/calendar/iso8601.el (iso8601-parse)
(iso8601-parse-time, iso8601-parse-duration)
(iso8601--decoded-time):
* lisp/calendar/parse-time.el (parse-time-string):
* lisp/calendar/time-date.el (make-decoded-time)
(decoded-time-set-defaults):
* lisp/org/org.el (org-fix-decoded-time)
(org-parse-time-string):
* src/timefns.c (Fdecode_time):
Generate subsec member for decoded time.
* lisp/calendar/time-date.el (decoded-time-add)
Add the decoded subsec too.
* lisp/simple.el (decoded-time): New subsec member.
* src/data.c (Frem): Simplify zero-check to match that of new Fmod.
(integer_mod): New function, with most of the guts of the old Fmod.
Remove redundant zero-check.
(Fmod): Use it.
* src/timefns.c (Fencode_time): Handle new subsec member
or (with the obsolescent calling convention) subsec arg.
It defaults to 0.
* test/lisp/calendar/icalendar-tests.el:
(icalendar--decode-isodatetime):
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years)
(test-iso8601-date-dates, test-iso8601-date-obsolete)
(test-iso8601-date-weeks, test-iso8601-date-ordinals)
(test-iso8601-time, test-iso8601-combined)
(test-iso8601-duration, test-iso8601-intervals)
(standard-test-dates, standard-test-time-of-day-fractions)
(standard-test-time-of-day-beginning-of-day)
(standard-test-time-of-day-utc)
(standard-test-time-of-day-zone)
(standard-test-date-and-time-of-day, standard-test-interval):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/src/timefns-tests.el (format-time-string-with-zone)
(encode-time-dst-numeric-zone):
Adjust to match new behavior.
2019-08-05 18:37:29 -07:00
Lars Ingebrigtsen
2e29a2580e delete-backward/forward-char doc string clarification
* lisp/simple.el (delete-backward-char): Doc string clarification
(bug#18192).
(delete-forward-char): Ditto.
2019-08-03 21:14:23 +02:00
Eli Zaretskii
8b7c7762da * lisp/simple.el (kill-do-not-save-duplicates): Doc fix. (Bug#36827) 2019-08-03 14:21:18 +03:00
Lars Ingebrigtsen
e82ae1db3c decoded-time-dst doc fix
* lisp/simple.el (decoded-time): Doc fix for dst (note -1 value).
2019-07-31 21:47:29 +02:00
Stefan Monnier
5483e44730 * lisp/simple.el (decoded-time): Use cl-defstruct 2019-07-29 11:57:49 -04:00
Lars Ingebrigtsen
6cfda69d72 Add support for dealing with decoded time structures
* doc/lispref/os.texi (Time Conversion): Document the new
functions that work on decoded time.
(Time Calculations): Document new date/time functions.

* lisp/simple.el (decoded-time-second, decoded-time-minute)
(decoded-time-hour, decoded-time-day, decoded-time-month)
(decoded-time-year, decoded-time-weekday, decoded-time-dst)
(decoded-time-zone): New accessor functions for decoded time values.

* lisp/calendar/time-date.el (date-days-in-month)
(date-ordinal-to-time): New functions.
(decoded-time--alter-month, decoded-time--alter-day)
(decoded-time--alter-second, make-decoded-time): New functions
added to manipulate decoded time structures.

* src/timefns.c (Fdecode_time): Mention the new accessors.

* test/lisp/calendar/time-date-tests.el: New file to test the
decoded time functions and the other new functions.
2019-07-29 14:22:38 +02:00
Eli Zaretskii
41c77dc687 Fix documentation of 'redisplay-highlight-region-function'
* lisp/simple.el (redisplay-highlight-region-function): Fix
last change.  (Bug#24701)
2019-07-27 17:52:47 +03:00
Lars Ingebrigtsen
70f83a1410 Add a doc string to redisplay-highlight-region-function
* lisp/simple.el (redisplay-highlight-region-function): Add a doc
string (bug#24701).
2019-07-27 16:25:45 +02:00
Lars Ingebrigtsen
a975c87831 Clarify yank-pop doc string
* lisp/simple.el (yank-pop): Mention `kill-ring' to make it more
clear what the command is doing (bug#25196).
2019-07-27 13:15:09 +02:00
Paul Eggert
c63e7f1bf6 Remove no-longer-needed integer overflow code
* lisp/calculator.el (calculator-number-to-string):
Use truncate, not calculator-truncate, since integer
overflow cannot occur here.
* lisp/calendar/cal-persia.el (calendar-persian-year-from-absolute):
* lisp/gnus/gnus-agent.el (gnus-agent-read-article-number):
* lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum)
(nnmaildir--new-number):
* lisp/scroll-bar.el (scroll-bar-scale):
* lisp/simple.el (beginning-of-buffer, end-of-buffer):
Simplify, now that integer overflow cannot occur.
2019-07-22 16:36:50 -07:00
Lars Ingebrigtsen
ea75c1a78b Mention M-n' for VALUE in the set-variable' command
* lisp/simple.el (set-variable): Mention that the current variable
is accessible in `M-n' (bug#36586).
2019-07-13 06:26:55 +02:00
Michael Albinus
1e4e165eaf * lisp/simple.el (shell-command): Raise a user-error instead of an error. 2019-07-09 20:48:35 +02:00
Lars Ingebrigtsen
f3bd296a3e Make two variables for extended command suggestions mention each other
* lisp/simple.el (suggest-key-bindings):
(extended-command-suggest-shorter): Mention each other, because
they are vaguely related (bug#35309).
2019-07-09 17:13:54 +02:00
Juri Linkov
44f199648b * lisp/minibuffer.el (minibuffer-message-properties): New variable.
(minibuffer-message): Use it to propertize message unless already
propertized by the caller.

* lisp/simple.el (minibuffer-error-function): Propertize the error.

* lisp/isearch.el (isearch-message-properties): New variable.
(isearch--momentary-message, isearch-message-prefix)
(isearch-message-suffix): Use it.  (Bug#21112)
2019-07-05 01:01:01 +03:00