1. 10 Nov, 2019 1 commit
    • Juri Linkov's avatar
      Move read-char-from-minibuffer from simple.el to subr.el and document it. · f216f388
      Juri Linkov authored
      * 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.
      f216f388
  2. 09 Nov, 2019 3 commits
    • Juri Linkov's avatar
      Add CHARS arg to read-char-from-minibuffer compatible with read-char-choice. · 04ab6747
      Juri Linkov authored
      * 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.
      04ab6747
    • Eli Zaretskii's avatar
      Fix last change · 4e444027
      Eli Zaretskii authored
      * 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)
      4e444027
    • Hong Xu's avatar
      Mention future history in history-related minibuffer commands · 15f4c415
      Hong Xu authored
      * 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)
      15f4c415
  3. 31 Oct, 2019 1 commit
    • Mattias Engdegård's avatar
      Inhibit undo-in-region for mouse-drag-region (bug#37700) · d75794fd
      Mattias Engdegård authored
      '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.
      d75794fd
  4. 30 Oct, 2019 1 commit
    • Juri Linkov's avatar
      Rename read-char-with-history to read-char-from-minibuffer (bug#10477) · ba7755bf
      Juri Linkov authored
      * 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.
      ba7755bf
  5. 29 Oct, 2019 1 commit
  6. 28 Oct, 2019 2 commits
  7. 27 Oct, 2019 1 commit
    • Stefan Monnier's avatar
      * lisp/loadup.el: Load minibuffer after cl-generic · 2aaced16
      Stefan Monnier authored
      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.
      2aaced16
  8. 19 Oct, 2019 1 commit
  9. 17 Oct, 2019 2 commits
    • Stefan Kangas's avatar
      Improve documentation of shell-command-prompt-show-cwd · 3cf92da6
      Stefan Kangas authored
      * doc/emacs/misc.texi (Single Shell):
      * lisp/simple.el (shell-command): Document
      'shell-command-prompt-show-cwd'.  (Bug#4987)
      3cf92da6
    • Juanma Barranquero's avatar
      lisp/*.el, src/*.c: Doc fixes related to returning t vs non-nil · 3ad40700
      Juanma Barranquero authored
      * 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.
      3ad40700
  10. 14 Oct, 2019 2 commits
    • Juanma Barranquero's avatar
      lisp/*.el: Force non-nil result to t, to match docstring · d4cfe67e
      Juanma Barranquero authored
      * 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.
      d4cfe67e
    • Lars Ingebrigtsen's avatar
      Allow zap-to-char to use a history · a590a805
      Lars Ingebrigtsen authored
      * 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.
      a590a805
  11. 13 Oct, 2019 1 commit
  12. 11 Oct, 2019 2 commits
  13. 07 Oct, 2019 1 commit
  14. 22 Sep, 2019 1 commit
    • Paul Eggert's avatar
      Avoid crashes when casifying noncontiguous regions · 2f600e97
      Paul Eggert authored
      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.
      2f600e97
  15. 21 Sep, 2019 1 commit
    • Juri Linkov's avatar
      Support rectangular regions in capitalize-region and capitalize-dwim. · 2879c3ec
      Juri Linkov authored
      * 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.
      2879c3ec
  16. 20 Sep, 2019 1 commit
    • Lars Ingebrigtsen's avatar
      Allow `process-contact' not to block · b8e9baac
      Lars Ingebrigtsen authored
      * 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).
      b8e9baac
  17. 23 Aug, 2019 1 commit
  18. 21 Aug, 2019 1 commit
    • Noam Postavsky's avatar
      Respect global-eldoc-mode in minibuffers (Bug#36886) · 7e2090ee
      Noam Postavsky authored
      * 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.
      7e2090ee
  19. 17 Aug, 2019 2 commits
    • Lars Ingebrigtsen's avatar
      Make newline-and-indent take a numeric prefix · 3efe59a8
      Lars Ingebrigtsen authored
      * lisp/simple.el (newline-and-indent): Take a prefix argument to
      say how many times to perform its action (bug#10927).
      3efe59a8
    • Paul Eggert's avatar
      More-compatible subsecond calendrical timestamps · 37257d6a
      Paul Eggert authored
      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.
      37257d6a
  20. 15 Aug, 2019 1 commit
  21. 09 Aug, 2019 1 commit
  22. 06 Aug, 2019 2 commits
    • Mattias Engdegård's avatar
      Add conditional operator xor to subr.el · c676444a
      Mattias Engdegård authored
      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.
      c676444a
    • Paul Eggert's avatar
      decode-time now returns subsec too · b06917a4
      Paul Eggert authored
      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.
      b06917a4
  23. 03 Aug, 2019 2 commits
  24. 31 Jul, 2019 1 commit
  25. 29 Jul, 2019 2 commits
    • Stefan Monnier's avatar
      5483e447
    • Lars Ingebrigtsen's avatar
      Add support for dealing with decoded time structures · 6cfda69d
      Lars Ingebrigtsen authored
      * 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.
      6cfda69d
  26. 27 Jul, 2019 3 commits
  27. 22 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Remove no-longer-needed integer overflow code · c63e7f1b
      Paul Eggert authored
      * 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.
      c63e7f1b
  28. 13 Jul, 2019 1 commit