1. 07 May, 2019 1 commit
    • John Shahid's avatar
      Fix setting and resetting of scroll-with-delete · e44b56d1
      John Shahid authored
      The start and end lines of the scroll region must to be in the range
      [0,term-height).  There are few placees that incorrectly set the end
      line of the scroll region to term-height which is outside the valid
      range.  Combined with another off-by-one error in
      term-set-scroll-region's clamping logic, this would cause
      term-scroll-with-delete to be unnecessarily turned on.
      * lisp/term.el (term-scroll-start,term-scroll-end): Use defvar-local
      to define the variables and document the valid range of values that
      the variables can take.
      (term--last-line): New function to calculate the 0-based index of the
      last line.
      (term--reset-scroll-region): New function to reset the scroll region
      to the full height of the terminal.
      (term-mode,term-reset-size,term-reset-terminal): Call
      term--reset-scroll-region to reset the scroll region.
      (term-set-scroll-region): Fix the off-by-one error in the clamping
      logic which allowed term-scroll-end to have values outside the valid
      range [0,term-height).
  2. 06 May, 2019 1 commit
  3. 19 Mar, 2019 1 commit
    • Paul Eggert's avatar
      Fix more regular expression typos · bc2a93d5
      Paul Eggert authored
      Problem reported by Mattias Engdegård in:
      except that I didn’t address the issues involving Hebrew,
      or involving comint-prompt-regexp.
      * lisp/align.el (align-rules-list, align-exclude-rules-list):
      * lisp/auth-source-pass.el (auth-source-pass--parse-secret)
      * lisp/cedet/data-debug.el (data-debug-next)
      (data-debug-prev, data-debug-expand-or-contract):
      * lisp/comint.el (comint-within-quotes):
      * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
      * lisp/emulation/viper-ex.el (ex-cmd-complete):
      * lisp/gnus/gnus-cite.el (gnus-message-search-citation-line):
      * lisp/gnus/nnir.el (nnir-imap-end-of-input):
      * lisp/mail/mail-extr.el (mail-extr-all-letters):
      * lisp/minibuffer.el (minibuffer-maybe-quote-filename):
      * lisp/nxml/rng-nxml.el (rng-complete-tag)
      (rng-complete-end-tag, rng-complete-attribute-name):
      * lisp/obsolete/vip.el (vip-get-ex-token, vip-get-ex-pat):
      * lisp/org/org-pcomplete.el (org-thing-at-point):
      * lisp/org/org.el (org-set-tags)
      * lisp/pcomplete.el (pcomplete-parse-comint-arguments):
      * lisp/progmodes/ada-mode.el (ada-compile-goto-error):
      * lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
      (cperl-find-pods-heres, cperl-not-bad-style-regexp)
      * lisp/progmodes/ebnf-yac.el (ebnf-yac-skip-spaces):
      * lisp/progmodes/flymake-proc.el (flymake-proc-master-tex-init):
      * lisp/progmodes/flymake.el (flymake-diag-region):
      * lisp/progmodes/fortran.el (fortran-current-line-indentation):
      * lisp/progmodes/idlw-complete-structtag.el:
      * lisp/progmodes/idlwave.el (idlwave-complete-sysvar-or-tag):
      * lisp/progmodes/prolog.el (prolog-pred-end)
      * lisp/progmodes/ruby-mode.el (ruby-forward-sexp)
      * lisp/progmodes/verilog-mode.el (verilog-repair-open-comma):
      * lisp/term.el (term-within-quotes):
      * lisp/textmodes/bib-mode.el (bib-capitalize-title-stop-words):
      * lisp/textmodes/refbib.el (r2b-capitalize-title-stop-words):
      * lisp/textmodes/reftex-parse.el (reftex-nth-arg):
      * lisp/textmodes/rst.el (rst-svn-rev):
      * lisp/url/url-http.el (url-http-parse-response):
      * test/lisp/progmodes/f90-tests.el (f90-test-bug3730):
      Fix regular expression typos.
  4. 27 Feb, 2019 1 commit
  5. 24 Feb, 2019 2 commits
    • Stefan Monnier's avatar
      * lisp/term.el: Fix minor compilation issues with cl-lib and lexbind · 5653b76d
      Stefan Monnier authored
      Remove left-over comment from the bulk comint->term query/replace.
      (term-command-function): Rename from term-command-hook.
      Give it a global default value.
      (term-suppress-hard-newline): Mark it as generally obsolete.
      (term-mode): Don't manually make hooks buffer-local.
      (term--remove-fake-newlines): Fix assert -> cl-assert.
      (term-char-mode): Use add-function.
      (term-send-input): Use run-hook-with-args.
      (term-dynamic-complete): Use run-hook-with-args-until-success.
      (term-dynamic-simple-complete): Completion tables can be plain lists.
      (serial-read-name): Simplify and fix misuse of `set`.
    • John Shahid's avatar
      Adjust line wrapping on window resize and killing text · 467e6ccb
      John Shahid authored
      * lisp/term.el (term-mode): Advice filter-buffer-substring-function to
      remove line unwrapping from killed text.
      (term-reset-size): Add or remove line unwrapping depending on the new
      terminal width.
      (term-suppress-hard-newline): Mark obsolete.
      (term-unwrap-line): Use text properties to be able to find the
      newlines later.
  6. 01 Jan, 2019 1 commit
  7. 30 Jul, 2018 1 commit
  8. 23 Jul, 2018 1 commit
    • Tino Calancha's avatar
      Prevent line-mode term from showing user passwords · 2b70b547
      Tino Calancha authored
      For buffers whose mode derive from comint-mode, the user password is
      read from the minibuffer and it's hidden.  A buffer in term-mode and
      line submode, instead shows the passwords.  Make buffers in line
      term-mode to hide passwords too (Bug#30190).
      * lisp/term.el (term-send-invisible): Prefer the more robust
      `read-passwd' instead of `term-read-noecho'.
      (term-watch-for-password-prompt): New function.
      (term-emulate-terminal): Call it each time we receive non-escape
      sequence output.
      Co-authored-by: default avatarNoam Postavsky <npostavs@gmail.com>
  9. 14 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Don’t set EMACS=t if Bash is 4.4 or newer · b635c548
      Paul Eggert authored
      (Backport from master.)
      (Thanks to Stefan Monnier for improvements to this patch.)
      * lisp/term.el (term--bash-needs-EMACS-status): New var.
      (term--bash-needs-EMACSp): New function.
      (term-exec-1): Use it instead of always setting EMACS.
  10. 10 Jun, 2018 1 commit
  11. 03 Jun, 2018 1 commit
    • Phil Sainty's avatar
      Fix remote-host directory tracking for shells in `term' buffers · 03697e64
      Phil Sainty authored
      * lisp/term.el (term-handle-ansi-terminal-messages): Use an explicit
      tramp method when constructing the tramp path for a non-local host,
      as this is now mandatory.  "-" is a pseudo-method for the user's
      `tramp-default-method'.  (Bug#31355)
      Specify the remote username explicitly in all cases, as
      `tramp-default-user' and `tramp-default-user-alist' could cause the
      previous logic to fail.
      Minor related improvements to the commentary.
  12. 02 Jun, 2018 1 commit
  13. 26 May, 2018 1 commit
    • Paul Eggert's avatar
      Don’t set EMACS=t if Bash is 4.4 or newer · 6fcab836
      Paul Eggert authored
      (Thanks to Stefan Monnier for improvements to this patch.)
      * lisp/term.el (term--bash-needs-EMACS-status): New var.
      (term--bash-needs-EMACSp): New function.
      (term-exec-1): Use it instead of always setting EMACS.
  14. 22 Apr, 2018 1 commit
    • Karl Otness's avatar
      Fix pre- and post-command-hook errors in term.el · d6e2c593
      Karl Otness authored
      Before this patch, after the terminal process dies the command
      hooks added in term-mode's char mode would produce errors.
      This fix removes these hooks when the process dies.
      * lisp/term.el (term-handle-exit): Remove pre-command-hook and
      post-command-hook because the process is dead.  (Bug#31236)
      Copyright-paperwork-exempt: yes
  15. 18 Apr, 2018 1 commit
    • Noam Postavsky's avatar
      Don't assume term-current-row cache is valid (Bug#31193) · b89ff0ef
      Noam Postavsky authored
      * lisp/term.el (term-down): Call `term-current-row' instead of
      directly accessing the variable `term-current-row.  Following a resize
      of the terminal's window, `term-current-row' is reset to nil, so it is
      not safe to assume it is a number.
  16. 02 Apr, 2018 1 commit
  17. 14 Mar, 2018 1 commit
    • Noam Postavsky's avatar
      Fix line-wrapping for term.el (Bug#30775) · 4c33ad4a
      Noam Postavsky authored
      * lisp/term.el (term-emulate-terminal): Leave line-wrapping state if
      point was moved after we entered it.
      * test/lisp/term-tests.el (term-line-wrapping-then-motion): New test.
  18. 09 Mar, 2018 1 commit
  19. 05 Mar, 2018 1 commit
  20. 31 Jan, 2018 1 commit
  21. 21 Jan, 2018 1 commit
  22. 19 Jan, 2018 3 commits
    • Noam Postavsky's avatar
      Switch term.el to lexical binding, and clean up code a bit · 47019a52
      Noam Postavsky authored
      * lisp/term.el (term-terminal-state): Remove.
      (term-do-line-wrapping): New variable, equivalent to state 1.
      (term-terminal-previous-parameter, term-terminal-parameter)
      (term-terminal-previous-parameter-4): Remove.
      (term-move-to-column): New function, for absolute column movement.
      (term-control-seq-regexp, term-control-seq-prefix-regexp): New
      (term-emulate-terminal, term-pager-discard): Use them via string-match
      instead of implementing a state machine in elisp.  Handle all
      unprocessed input via term-terminal-undecoded-bytes (this solves
      (term-handle-ansi-escape): Take a list of escape sequence parameters
      as an argument, rather than via dynamic variables.
      (term-erase-in-display): Consult the argument, not the dynamically
      bound term-terminal-parameter (which happened to be the same as the
      argument up until now).
    • Noam Postavsky's avatar
      Add tests for term.el · 1d50c185
      Noam Postavsky authored
      * lisp/term.el (term-mode): Add `name' attribute to
      window-adjust-process-window-size-function value, so that it can be
      removed easily by tests.
      * test/lisp/term-tests.el: New tests.
    • Callum Cameron's avatar
      Handle split AnSiT messages for term.el (Bug#17231) · 5472568a
      Callum Cameron authored
      Check to see if there is an incomplete command at the end of
      term-emulate-terminal's input string, and, if so, save it so the whole
      command can be processed when the next string arrives.
      * lisp/term.el (term-partial-ansi-terminal-message): New variable.
      (term-mode): Make it buffer local.
      (term-handle-ansi-terminal-messages): Prepend it to the received
      message, and set it if a partial message was received.
      Copyright-paperwork-exempt: yes
      Do not merge to master, it will be solved differently there, see
      "Switch term.el to lexical binding, and clean up code a bit".
  23. 01 Jan, 2018 1 commit
  24. 21 Oct, 2017 1 commit
    • Phil Sainty's avatar
      Avoid creating inconsistent buffer states in term-char-mode · 0d8e4f45
      Phil Sainty authored
      * lisp/term.el (term-mode, term-char-mode, term-line-mode)
      (term-emulate-terminal): Make buffer read-only in 'term-char-mode',
      except for the process filter's output.  Use 'read-only-mode-hook' to
      track and restore the user-set state of 'buffer-read-only' for
      'term-line-mode'.  (Bug#24837)
      (term-char-mode-buffer-read-only): New user option.
      (term-line-mode-buffer-read-only): New buffer-local variable.
      (term-line-mode-buffer-read-only-update): New function.
      (term-char-mode, term-line-mode): Use 'term-set-goto-process-mark'
      in pre-command-hook, and 'term-goto-process-mark-maybe' in
      post-command-hook to counter-act unexpected changes to point when
      using 'term-char-mode'.
      (term-char-mode-point-at-process-mark): New user option.
      (term-goto-process-mark): New buffer-local variable.
      (term-set-goto-process-mark): New function.
      (term-goto-process-mark-maybe): New function.
      (term-process-mark): New function.
      * etc/NEWS: Mention the new behavior and user options.
  25. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
  26. 20 Aug, 2017 1 commit
  27. 04 Aug, 2017 1 commit
  28. 27 Jan, 2017 1 commit
  29. 05 Jan, 2017 1 commit
    • Johan Claesson's avatar
      Fix term.el handling of ^Z-sequences spanning chunks · d88cdad2
      Johan Claesson authored
      Bash will after each command send ?\032 and the current directory "/tmp"
      to inform term.el.  Bash output is buffered in 4096 bytes chunks.  If a
      command outputs roughly 4096 bytes then the end of the first chunk will
      be "/tm" (Bug#13350).
      * lisp/term.el (term-emulate-terminal): Change the regexp to find the
      end of the ?\032 sequence to use \n instead of $, the latter can match
      end of string as well.
      Copyright-paperwork-exempt: yes
  30. 03 Jan, 2017 1 commit
    • Noam Postavsky's avatar
      Handle multibyte chars spanning chunks in term.el · 134e86b3
      Noam Postavsky authored
      * lisp/term.el (term-terminal-undecoded-bytes): New variable.
      (term-mode): Make it buffer local.  Don't make `term-terminal-parameter'
      buffer-local twice.
      (term-emulate-terminal): Check for bytes of incompletely decoded
      characters, and save them until the next call when they can be fully
      decoded (Bug#25288).
  31. 01 Jan, 2017 1 commit
  32. 10 Nov, 2016 1 commit
  33. 03 Nov, 2016 1 commit
  34. 15 Oct, 2016 2 commits
    • Philipp Stephani's avatar
      Disable bracketed paste in a terminal in char mode · cf566b46
      Philipp Stephani authored
      In char mode, a terminal doesn't accept bracketed paste events,
      therefore we should disable them; see Bug#24639.  To decouple the XTerm
      management from term.el, introduce a per-buffer setting to disable
      bracketed paste for that buffer.  If bracketed paste is inhiited for at
      least one buffer in a terminal, it is disabled for the whole terminal.
      * term/xterm.el (xterm-inhibit-bracketed-paste-mode): New mode to
      inhibit XTerm bracketed paste per buffer.
      (xterm--buffer-terminals, xterm--update-bracketed-paste)
      (xterm--bracketed-paste-possible, xterm--is-xterm): New helper
      (xterm--init-bracketed-paste-mode): Remove unused helper
      (terminal-init-xterm): Update bracketed paste status when
      initializing an XTerm and on window configuration change.
      * term.el (term-char-mode, term-line-mode): Inhibit XTerm
      bracketed paste in char mode.
    • Eli Zaretskii's avatar
      Keep point when switching from and to *terminal* buffer · 528997da
      Eli Zaretskii authored
      * lisp/term.el (term-reset-size): Don't reset the size if it
      didn't change.  If the size did change, restore point after
      adjusting the size.  (Bug#24465)
  35. 26 Jun, 2016 2 commits