Commit graph

2097 commits

Author SHA1 Message Date
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
Alex Branham
cb182ce6f8
* lisp/simple.el (undo): Make message less enthusiastic 2019-06-27 19:56:40 -05:00
Dmitry Gutov
8a11e430ec Use default-indent-new-line' instead of indent-new-comment-line'
* lisp/simple.el (default-indent-new-line): Doc string fix.

* lisp/textmodes/refill.el (refill-post-command-function): Make
default-indent-new-line work as indent-new-comment-line.

* lisp/textmodes/refill.el (refill-post-command-function): Bind
`M-C-j' and `M-j' to default-indent-new-line instead of
indent-new-comment-line to allow overriding via
`comment-line-break-function' (bug#12413).
2019-06-27 16:57:47 +02:00
Stefan Monnier
da263640c8 * lisp/simple.el (forward-visible-line, end-of-visible-line): Use invisible-p 2019-06-25 11:35:56 -04:00
Pip Cet
ef744119a7 Fix list-processes typo with thread-name
* lisp/simple.el (list-processes--refresh):
Don’t assume thread-name succeeds (Bug#36163).
2019-06-11 08:25:21 -07:00
Juri Linkov
2aae063055 User-friendly display of error messages at the end of minibuffer
* lisp/simple.el (minibuffer-setup-hook): Add minibuffer-error-initialize.
(minibuffer-error-initialize, minibuffer-error-function): New functions.
(Bug#34939)
2019-06-03 23:27:19 +03:00
Paul Eggert
f744797af1 Go back to "Maintainer: emacs-devel@gnu.org"
Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is
no special maintainer for a file.  Although this wasn't documented
it was common practice and removing the lines didn't have consensus.
2019-05-25 14:25:18 -07:00
Paul Eggert
bef1be8730 Fixes for "Maintainer:" and related lines
Mostly, this just removes "Maintainer: emacs-devel@gnu.org" lines,
which are not that useful.  It also cleans up and regularizes a
few similar lines.
2019-05-19 21:34:27 -07:00
Juri Linkov
df9b56ecff Rename shell-command-width to async-shell-command-width (bug#35055)
* lisp/simple.el (async-shell-command-width):
* lisp/net/tramp.el (tramp-handle-shell-command):
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
* doc/misc/tramp.texi (Remote processes): Rename this variable.

* doc/emacs/misc.texi (Single Shell): Add async-shell-command-width.
2019-05-05 22:27:33 +03:00
Basil L. Contovounesios
7dafbe3ab9 Minor region-noncontiguous-p simplification
* lisp/simple.el (region-noncontiguous-p): Don't needlessly traverse
region-bounds.
2019-05-01 00:39:54 +01:00
Stefan Monnier
ca99c00f75 * lisp/simple.el (eval-expression): Fix paren typo. 2019-04-25 15:34:27 -04:00
Stefan Monnier
e08e0880f9 Use lexical-binding by default for M-:, --eval, and *scratch*
* lisp/startup.el (command-line): Default to lexical-binding in *scratch*.
(normal-no-mouse-startup-screen, command-line-1):
Use startup--get-buffer-create-scratch.
(command-line-1):
* lisp/simple.el (eval-expression):
* lisp/server.el (server-eval-and-print): Use lexical-binding to
evaluate the expression.
(server-execute): Use startup--get-buffer-create-scratch.
* lisp/ielm.el (inferior-emacs-lisp-mode): Default to lexical-binding.
2019-04-25 14:36:03 -04:00
Stephen Leake
5ee5895f9b Merge commit '890440a44c' 2019-04-14 09:24:42 -07:00
Stephen Leake
ca449fb1c1 Rename new user variable next-error-verbosity' to next-error-verbose'
* etc/NEWS: Update entry to match renaming.

* lisp/simple.el (next-error-verbose): Rename.
(next-error, next-error-internal): Match rename.
2019-04-14 09:23:24 -07:00
Eli Zaretskii
29b36a007a Improve documentation of a recent commit
* etc/NEWS: Fix the description of 'shell-command-width'.
Mark the entry as not needing the manual update.

* lisp/simple.el (shell-command-width): Doc fix.  (Bug#35055)
2019-04-14 17:50:12 +03:00
Juri Linkov
3a34f57c7e * lisp/simple.el (shell-command-width): New defcustom.
(shell-command): Use it.  (Bug#35055)
2019-04-14 00:46:38 +03:00
Stephen Leake
7ba7def5ca Merge commit 'de238b39e3' 2019-04-11 14:00:02 -07:00
Stephen Leake
7768581172 Make `next-error' output fewer messages about locus
* lisp/simple.el (next-error-verbosity): New user variable.
(next-error, next-error-internal): Use it to control only outputting
locus message if locus changed.
2019-04-11 13:58:36 -07:00
Glenn Morris
61cdadf5bc Merge from origin/emacs-26
5999401 (origin/emacs-26) Note that choose-completion-string-function...
8d2f1df Address name conflicts in EIEIO documentation (bug#31660)
2019-04-10 09:07:16 -07:00