diff options
| author | Paul Eggert | 2017-09-29 22:06:14 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-09-29 22:06:14 -0700 |
| commit | 98ac36efe4ce4bd3a0bca76fc73ce6c7abaa4371 (patch) | |
| tree | 1eae14fbab967d6b257d192ef58921aac05bb98e /lisp/progmodes | |
| parent | 5406be4db6528095b5e5b8bf94b06b2c06610340 (diff) | |
| parent | 1e5949642a19a21fd9d47f66c66fd4d3bd99e910 (diff) | |
| download | emacs-98ac36efe4ce4bd3a0bca76fc73ce6c7abaa4371.tar.gz emacs-98ac36efe4ce4bd3a0bca76fc73ce6c7abaa4371.zip | |
Merge from origin/emacs-26
1e5949642a ; * src/gtkutil.c (xg_create_frame_widgets): Add FIXME re....
e7c8da4d05 bug#28609: simple.el
827db6b559 Use a separate syntax-ppss cache for narrowed buffers
a2244f417a Improve python3-compatibility of fallback completion (Bug#...
79162cb0db Fix subr-x-tests when running from elc
66d35ae49d * lisp/eshell/esh-util.el (eshell-condition-case): Add deb...
f5e72b04d9 Make sh-indentation into an alias for sh-basic-offset (Bug...
a58d0c590a Fix loading of smie-config rules (Bug#24848)
3a68dec327 ; Update NEWS for the change in eldoc-message
5a41dd0a1f Reset default-directory inside *xref-grep* buffer
49cd561dc6 * test/lisp/tramp-tests.el (tramp-test21-file-links): Spec...
b719f6b20b Loosen strict parsing requirement for desktop files
c7a0c13777 * lisp/xdg.el (xdg-thumb-uri): Fix doc string.
dc6b3560e5 Fix documentation of `make-frame' and related variables an...
3d3778d82a Accept new `always' value for option `buffer-offer-save'
638f64c40a Improve new NS scrolling variable names
d93301242f Document 'replace-buffer-contents' in the manual.
00e4e3e9d2 Fix undecorated frame resizing issues on NS (bug#28512)
820739bbb5 ; * doc/emacs/display.texi (Display Custom): Fix wording.
f2b2201594 ; Spelling and URL fixes
0e143b1fc5 Documentation improvements for 'display-line-numbers'
f656ccdb43 ; Fix typo
d64da52d57 Fix last change in bat-mode.el
908af46abd Fix restoring in GUI sessions desktop saved in TTY sessions
51cbd85454 Improve syntax highlighting in bat-mode
0273916618 Document the 'list-FOO' convention
d24ec58540 Expose viewing conditions in CAM02-UCS metric
a81d5a3d3f Revert "Set frame size to actual requested size (bug#18215)"
0bf066d4b2 Add tests for Edebug
68baca3ee1 Catch more messages in ert-with-message-capture
28e0c410c9 ; * lisp/mouse.el (secondary-selection-exist-p): Doc fix.
31e1d9ef2f Support setting region from secondary selection and vice v...
047f02f00f Fix new copy-directory bug with empty dirs
fbd15836af * doc/lispref/strings.texi (Formatting Strings): Improve i...
f16a8d5dbd Fix 2 testsuite tests for MS-Windows
965cffd89c Rename timer-list to list-timers
a5fec62b51 Provide native touchpad scrolling on macOS
7b3d1c6beb Fix MinGW64 build broken by recent MinGW64 import libraries
c83d0c5fdf Fix crashes in 'move-point-visually' in minibuffer windows
7f3d5f929d * src/emacs.c (usage_message): Don't mention 'find-file'.
6845282200 Fix a minor inaccuracy in the Emacs manual
74d7bb9498 Fix errors in flyspell-post-command-hook
40fdbb01d0 Work on Tramp's file-truename
1a01423b3c Fix bug with make-directory on MS-Windows root
066efb8666 Fix log-view-diff-common when point is after last entry
3f006b56cd Adapt fileio-tests--symlink-failure to Cygwin
ee512e9a82 Ignore buffers whose name begins with a space in save-some...
9e1b5bd92c Improve tramp-interrupt-process robustness
8d4223e61b Minor Tramp doc update
331d0e520f Fix gensym
466df76f7d Cleanup in files-tests.el
6359fe630a Remove old cl-assert calls in 'newline'
059184e645 Avoid crash with C-g C-g in GC
541006c536 Fix format-time-string %Z bug with negative tz
679e05eeb9 message-citation-line-format %Z is now tz name
4e8888d438 Use doc-view or pdf-tools on any window-system
5f28f0db73 Fix bug with min and max and NaNs
37b5e661d2 Fix recently-introduced copy-directory bug
6bbbc38b34 Merge from Gnulib
57249fb297 Fix compatibility problem in Tramp
411bec82c4 Avoid GCC 7 compilation warning in eval.c
34a6774daa ; Partially revert c3445aed5194
3003ac0469 Adapt Tramp version. Do not merge
48d39c39e8 Search for Syntax section when viewing MDN
9d101376b4 Allow smerge-keep-current to work for empty hunks
13aba24add Call vc-setup-buffer in vc-git-log-{in,out}going
1d599df5e0 Fix last change to textmodes/page-ext.el
a726e09a9a * test/src/lcms-tests.el (lcms-cri-cam02-ucs): Skip if lcm...
546413e1ac * test/src/lcms-tests.el (lcms-whitepoint): Skip if lcms2 ...
96aaeaaffa ; * src/lcms.c: Minor stylistic changes in comments.
c3df816585 Fix compilation warning in etags.c
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/python.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 34 | ||||
| -rw-r--r-- | lisp/progmodes/xref.el | 2 |
3 files changed, 21 insertions, 21 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f3513ced4bb..365191c56b0 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -4271,8 +4271,10 @@ See `python-check-command' for the default." | |||
| 4271 | import inspect | 4271 | import inspect |
| 4272 | try: | 4272 | try: |
| 4273 | str_type = basestring | 4273 | str_type = basestring |
| 4274 | argspec_function = inspect.getargspec | ||
| 4274 | except NameError: | 4275 | except NameError: |
| 4275 | str_type = str | 4276 | str_type = str |
| 4277 | argspec_function = inspect.getfullargspec | ||
| 4276 | if isinstance(obj, str_type): | 4278 | if isinstance(obj, str_type): |
| 4277 | obj = eval(obj, globals()) | 4279 | obj = eval(obj, globals()) |
| 4278 | doc = inspect.getdoc(obj) | 4280 | doc = inspect.getdoc(obj) |
| @@ -4285,9 +4287,7 @@ See `python-check-command' for the default." | |||
| 4285 | target = obj | 4287 | target = obj |
| 4286 | objtype = 'def' | 4288 | objtype = 'def' |
| 4287 | if target: | 4289 | if target: |
| 4288 | args = inspect.formatargspec( | 4290 | args = inspect.formatargspec(*argspec_function(target)) |
| 4289 | *inspect.getargspec(target) | ||
| 4290 | ) | ||
| 4291 | name = obj.__name__ | 4291 | name = obj.__name__ |
| 4292 | doc = '{objtype} {name}{args}'.format( | 4292 | doc = '{objtype} {name}{args}'.format( |
| 4293 | objtype=objtype, name=name, args=args | 4293 | objtype=objtype, name=name, args=args |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 0bda8bc275d..14598bcafb9 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -593,11 +593,7 @@ sign. See `sh-feature'." | |||
| 593 | (sexp :format "Evaluate: %v")))) | 593 | (sexp :format "Evaluate: %v")))) |
| 594 | :group 'sh-script) | 594 | :group 'sh-script) |
| 595 | 595 | ||
| 596 | 596 | (define-obsolete-variable-alias 'sh-indentation 'sh-basic-offset "26.1") | |
| 597 | (defcustom sh-indentation 4 | ||
| 598 | "The width for further indentation in Shell-Script mode." | ||
| 599 | :type 'integer | ||
| 600 | :group 'sh-script) | ||
| 601 | (put 'sh-indentation 'safe-local-variable 'integerp) | 597 | (put 'sh-indentation 'safe-local-variable 'integerp) |
| 602 | 598 | ||
| 603 | (defcustom sh-remember-variable-min 3 | 599 | (defcustom sh-remember-variable-min 3 |
| @@ -1617,7 +1613,7 @@ with your script for an edit-interpret-debug cycle." | |||
| 1617 | (setq-local skeleton-pair-alist '((?` _ ?`))) | 1613 | (setq-local skeleton-pair-alist '((?` _ ?`))) |
| 1618 | (setq-local skeleton-pair-filter-function 'sh-quoted-p) | 1614 | (setq-local skeleton-pair-filter-function 'sh-quoted-p) |
| 1619 | (setq-local skeleton-further-elements | 1615 | (setq-local skeleton-further-elements |
| 1620 | '((< '(- (min sh-indentation (current-column)))))) | 1616 | '((< '(- (min sh-basic-offset (current-column)))))) |
| 1621 | (setq-local skeleton-filter-function 'sh-feature) | 1617 | (setq-local skeleton-filter-function 'sh-feature) |
| 1622 | (setq-local skeleton-newline-indent-rigidly t) | 1618 | (setq-local skeleton-newline-indent-rigidly t) |
| 1623 | (setq-local defun-prompt-regexp | 1619 | (setq-local defun-prompt-regexp |
| @@ -2012,7 +2008,7 @@ May return nil if the line should not be treated as continued." | |||
| 2012 | (forward-line -1) | 2008 | (forward-line -1) |
| 2013 | (if (sh-smie--looking-back-at-continuation-p) | 2009 | (if (sh-smie--looking-back-at-continuation-p) |
| 2014 | (current-indentation) | 2010 | (current-indentation) |
| 2015 | (+ (current-indentation) sh-indentation)))) | 2011 | (+ (current-indentation) sh-basic-offset)))) |
| 2016 | (t | 2012 | (t |
| 2017 | ;; Just make sure a line-continuation is indented deeper. | 2013 | ;; Just make sure a line-continuation is indented deeper. |
| 2018 | (save-excursion | 2014 | (save-excursion |
| @@ -2033,13 +2029,13 @@ May return nil if the line should not be treated as continued." | |||
| 2033 | ;; check the line before that one. | 2029 | ;; check the line before that one. |
| 2034 | (> ci indent)) | 2030 | (> ci indent)) |
| 2035 | (t ;Previous line is the beginning of the continued line. | 2031 | (t ;Previous line is the beginning of the continued line. |
| 2036 | (setq indent (min (+ ci sh-indentation) max)) | 2032 | (setq indent (min (+ ci sh-basic-offset) max)) |
| 2037 | nil))))) | 2033 | nil))))) |
| 2038 | indent)))))) | 2034 | indent)))))) |
| 2039 | 2035 | ||
| 2040 | (defun sh-smie-sh-rules (kind token) | 2036 | (defun sh-smie-sh-rules (kind token) |
| 2041 | (pcase (cons kind token) | 2037 | (pcase (cons kind token) |
| 2042 | (`(:elem . basic) sh-indentation) | 2038 | (`(:elem . basic) sh-basic-offset) |
| 2043 | (`(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt) | 2039 | (`(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt) |
| 2044 | (sh-var-value 'sh-indent-for-case-label))) | 2040 | (sh-var-value 'sh-indent-for-case-label))) |
| 2045 | (`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case")) | 2041 | (`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case")) |
| @@ -2248,8 +2244,8 @@ Point should be before the newline." | |||
| 2248 | 2244 | ||
| 2249 | (defun sh-smie-rc-rules (kind token) | 2245 | (defun sh-smie-rc-rules (kind token) |
| 2250 | (pcase (cons kind token) | 2246 | (pcase (cons kind token) |
| 2251 | (`(:elem . basic) sh-indentation) | 2247 | (`(:elem . basic) sh-basic-offset) |
| 2252 | ;; (`(:after . "case") (or sh-indentation smie-indent-basic)) | 2248 | ;; (`(:after . "case") (or sh-basic-offset smie-indent-basic)) |
| 2253 | (`(:after . ";") | 2249 | (`(:after . ";") |
| 2254 | (if (smie-rule-parent-p "case") | 2250 | (if (smie-rule-parent-p "case") |
| 2255 | (smie-rule-parent (sh-var-value 'sh-indent-after-case)))) | 2251 | (smie-rule-parent (sh-var-value 'sh-indent-after-case)))) |
| @@ -2490,7 +2486,7 @@ the value thus obtained, and the result is used instead." | |||
| 2490 | 2486 | ||
| 2491 | (defun sh-basic-indent-line () | 2487 | (defun sh-basic-indent-line () |
| 2492 | "Indent a line for Sh mode (shell script mode). | 2488 | "Indent a line for Sh mode (shell script mode). |
| 2493 | Indent as far as preceding non-empty line, then by steps of `sh-indentation'. | 2489 | Indent as far as preceding non-empty line, then by steps of `sh-basic-offset'. |
| 2494 | Lines containing only comments are considered empty." | 2490 | Lines containing only comments are considered empty." |
| 2495 | (interactive) | 2491 | (interactive) |
| 2496 | (let ((previous (save-excursion | 2492 | (let ((previous (save-excursion |
| @@ -2514,9 +2510,9 @@ Lines containing only comments are considered empty." | |||
| 2514 | (delete-region (point) | 2510 | (delete-region (point) |
| 2515 | (progn (beginning-of-line) (point))) | 2511 | (progn (beginning-of-line) (point))) |
| 2516 | (if (eolp) | 2512 | (if (eolp) |
| 2517 | (max previous (* (1+ (/ current sh-indentation)) | 2513 | (max previous (* (1+ (/ current sh-basic-offset)) |
| 2518 | sh-indentation)) | 2514 | sh-basic-offset)) |
| 2519 | (* (1+ (/ current sh-indentation)) sh-indentation)))))) | 2515 | (* (1+ (/ current sh-basic-offset)) sh-basic-offset)))))) |
| 2520 | (if (< (current-column) (current-indentation)) | 2516 | (if (< (current-column) (current-indentation)) |
| 2521 | (skip-chars-forward " \t")))) | 2517 | (skip-chars-forward " \t")))) |
| 2522 | 2518 | ||
| @@ -3594,6 +3590,10 @@ so that `occur-next' and `occur-prev' will work." | |||
| 3594 | (defun sh-learn-buffer-indent (&optional arg) | 3590 | (defun sh-learn-buffer-indent (&optional arg) |
| 3595 | "Learn how to indent the buffer the way it currently is. | 3591 | "Learn how to indent the buffer the way it currently is. |
| 3596 | 3592 | ||
| 3593 | If `sh-use-smie' is non-nil, call `smie-config-guess'. | ||
| 3594 | Otherwise, run the sh-script specific indent learning command, as | ||
| 3595 | decribed below. | ||
| 3596 | |||
| 3597 | Output in buffer \"*indent*\" shows any lines which have conflicting | 3597 | Output in buffer \"*indent*\" shows any lines which have conflicting |
| 3598 | values of a variable, and the final value of all variables learned. | 3598 | values of a variable, and the final value of all variables learned. |
| 3599 | When called interactively, pop to this buffer automatically if | 3599 | When called interactively, pop to this buffer automatically if |
| @@ -3610,8 +3610,7 @@ to the value of variable `sh-learn-basic-offset'. | |||
| 3610 | 3610 | ||
| 3611 | Abnormal hook `sh-learned-buffer-hook' if non-nil is called when the | 3611 | Abnormal hook `sh-learned-buffer-hook' if non-nil is called when the |
| 3612 | function completes. The function is abnormal because it is called | 3612 | function completes. The function is abnormal because it is called |
| 3613 | with an alist of variables learned. This feature may be changed or | 3613 | with an alist of variables learned. |
| 3614 | removed in the future. | ||
| 3615 | 3614 | ||
| 3616 | This command can often take a long time to run." | 3615 | This command can often take a long time to run." |
| 3617 | (interactive "P") | 3616 | (interactive "P") |
| @@ -3809,7 +3808,6 @@ This command can often take a long time to run." | |||
| 3809 | " has" "s have") | 3808 | " has" "s have") |
| 3810 | (if (zerop num-diffs) | 3809 | (if (zerop num-diffs) |
| 3811 | "." ":")))))) | 3810 | "." ":")))))) |
| 3812 | ;; Are abnormal hooks considered bad form? | ||
| 3813 | (run-hook-with-args 'sh-learned-buffer-hook learned-var-list) | 3811 | (run-hook-with-args 'sh-learned-buffer-hook learned-var-list) |
| 3814 | (and (called-interactively-p 'any) | 3812 | (and (called-interactively-p 'any) |
| 3815 | (or sh-popup-occur-buffer (> num-diffs 0)) | 3813 | (or sh-popup-occur-buffer (> num-diffs 0)) |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 623c9c4e07f..80cdcb3f18b 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -928,12 +928,14 @@ IGNORES is a list of glob patterns." | |||
| 928 | files | 928 | files |
| 929 | (expand-file-name dir) | 929 | (expand-file-name dir) |
| 930 | ignores)) | 930 | ignores)) |
| 931 | (def default-directory) | ||
| 931 | (buf (get-buffer-create " *xref-grep*")) | 932 | (buf (get-buffer-create " *xref-grep*")) |
| 932 | (`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist)) | 933 | (`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist)) |
| 933 | (status nil) | 934 | (status nil) |
| 934 | (hits nil)) | 935 | (hits nil)) |
| 935 | (with-current-buffer buf | 936 | (with-current-buffer buf |
| 936 | (erase-buffer) | 937 | (erase-buffer) |
| 938 | (setq default-directory def) | ||
| 937 | (setq status | 939 | (setq status |
| 938 | (call-process-shell-command command nil t)) | 940 | (call-process-shell-command command nil t)) |
| 939 | (goto-char (point-min)) | 941 | (goto-char (point-min)) |