diff options
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/smie.el | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/syntax.el | 107 | ||||
| -rw-r--r-- | lisp/eshell/esh-util.el | 2 | ||||
| -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 | ||||
| -rw-r--r-- | src/gtkutil.c | 5 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/subr-x-tests.el | 9 |
9 files changed, 113 insertions, 62 deletions
| @@ -51,6 +51,12 @@ sets the XTerm window title. The default is to set the window title. | |||
| 51 | ** The FILENAME argument to 'file-name-base' is now mandatory and no | 51 | ** The FILENAME argument to 'file-name-base' is now mandatory and no |
| 52 | longer defaults to 'buffer-file-name'. | 52 | longer defaults to 'buffer-file-name'. |
| 53 | 53 | ||
| 54 | --- | ||
| 55 | ** 'eldoc-message' only accepts one argument now. Programs that | ||
| 56 | called it with multiple arguments before should pass them through | ||
| 57 | 'format' first. Even that is discouraged: for ElDoc support, you | ||
| 58 | should set 'eldoc-documentation-function' instead of calling | ||
| 59 | 'eldoc-message' directly. | ||
| 54 | 60 | ||
| 55 | * Lisp Changes in Emacs 27.1 | 61 | * Lisp Changes in Emacs 27.1 |
| 56 | 62 | ||
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 87c4782e217..da1e12b1408 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el | |||
| @@ -1956,7 +1956,7 @@ E.g. provided via a file-local call to `smie-config-local'.") | |||
| 1956 | (defvar smie-config--modefuns nil) | 1956 | (defvar smie-config--modefuns nil) |
| 1957 | 1957 | ||
| 1958 | (defun smie-config--setter (var value) | 1958 | (defun smie-config--setter (var value) |
| 1959 | (setq-default var value) | 1959 | (set-default var value) |
| 1960 | (let ((old-modefuns smie-config--modefuns)) | 1960 | (let ((old-modefuns smie-config--modefuns)) |
| 1961 | (setq smie-config--modefuns nil) | 1961 | (setq smie-config--modefuns nil) |
| 1962 | (pcase-dolist (`(,mode . ,rules) value) | 1962 | (pcase-dolist (`(,mode . ,rules) value) |
| @@ -1982,7 +1982,7 @@ value with which to replace it." | |||
| 1982 | ;; FIXME improve value-type. | 1982 | ;; FIXME improve value-type. |
| 1983 | :type '(choice (const nil) | 1983 | :type '(choice (const nil) |
| 1984 | (alist :key-type symbol)) | 1984 | (alist :key-type symbol)) |
| 1985 | :initialize 'custom-initialize-default | 1985 | :initialize 'custom-initialize-set |
| 1986 | :set #'smie-config--setter) | 1986 | :set #'smie-config--setter) |
| 1987 | 1987 | ||
| 1988 | (defun smie-config-local (rules) | 1988 | (defun smie-config-local (rules) |
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index f6137837858..9eb6bde7454 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el | |||
| @@ -381,10 +381,26 @@ This function should move the cursor back to some syntactically safe | |||
| 381 | point (where the PPSS is equivalent to nil).") | 381 | point (where the PPSS is equivalent to nil).") |
| 382 | (make-obsolete-variable 'syntax-begin-function nil "25.1") | 382 | (make-obsolete-variable 'syntax-begin-function nil "25.1") |
| 383 | 383 | ||
| 384 | (defvar-local syntax-ppss-cache nil | 384 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 385 | "List of (POS . PPSS) pairs, in decreasing POS order.") | 385 | ;; Several caches. |
| 386 | (defvar-local syntax-ppss-last nil | 386 | ;; |
| 387 | "Cache of (LAST-POS . LAST-PPSS).") | 387 | ;; Because `syntax-ppss' is equivalent to (parse-partial-sexp |
| 388 | ;; (POINT-MIN) x), we need either to empty the cache when we narrow | ||
| 389 | ;; the buffer, which is suboptimal, or we need to use several caches. | ||
| 390 | ;; We use two of them, one for widened buffer, and one for narrowing. | ||
| 391 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 392 | |||
| 393 | (defvar-local syntax-ppss-wide nil | ||
| 394 | "Cons of two elements (LAST . CACHE). | ||
| 395 | Where LAST is a pair (LAST-POS . LAST-PPS) caching the last invocation | ||
| 396 | and CACHE is a list of (POS . PPSS) pairs, in decreasing POS order. | ||
| 397 | These are valid when the buffer has no restriction.") | ||
| 398 | |||
| 399 | (defvar-local syntax-ppss-narrow nil | ||
| 400 | "Same as `syntax-ppss-wide' but for a narrowed buffer.") | ||
| 401 | |||
| 402 | (defvar-local syntax-ppss-narrow-start nil | ||
| 403 | "Start position of the narrowing for `syntax-ppss-narrow'.") | ||
| 388 | 404 | ||
| 389 | (defalias 'syntax-ppss-after-change-function 'syntax-ppss-flush-cache) | 405 | (defalias 'syntax-ppss-after-change-function 'syntax-ppss-flush-cache) |
| 390 | (defun syntax-ppss-flush-cache (beg &rest ignored) | 406 | (defun syntax-ppss-flush-cache (beg &rest ignored) |
| @@ -392,24 +408,29 @@ point (where the PPSS is equivalent to nil).") | |||
| 392 | ;; Set syntax-propertize to refontify anything past beg. | 408 | ;; Set syntax-propertize to refontify anything past beg. |
| 393 | (setq syntax-propertize--done (min beg syntax-propertize--done)) | 409 | (setq syntax-propertize--done (min beg syntax-propertize--done)) |
| 394 | ;; Flush invalid cache entries. | 410 | ;; Flush invalid cache entries. |
| 395 | (while (and syntax-ppss-cache (> (caar syntax-ppss-cache) beg)) | 411 | (dolist (cell (list syntax-ppss-wide syntax-ppss-narrow)) |
| 396 | (setq syntax-ppss-cache (cdr syntax-ppss-cache))) | 412 | (pcase cell |
| 397 | ;; Throw away `last' value if made invalid. | 413 | (`(,last . ,cache) |
| 398 | (when (< beg (or (car syntax-ppss-last) 0)) | 414 | (while (and cache (> (caar cache) beg)) |
| 399 | ;; If syntax-begin-function jumped to BEG, then the old state at BEG can | 415 | (setq cache (cdr cache))) |
| 400 | ;; depend on the text after BEG (which is presumably changed). So if | 416 | ;; Throw away `last' value if made invalid. |
| 401 | ;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the | 417 | (when (< beg (or (car last) 0)) |
| 402 | ;; assumed nil state at BEG may not be valid any more. | 418 | ;; If syntax-begin-function jumped to BEG, then the old state at BEG can |
| 403 | (if (<= beg (or (syntax-ppss-toplevel-pos (cdr syntax-ppss-last)) | 419 | ;; depend on the text after BEG (which is presumably changed). So if |
| 404 | (nth 3 syntax-ppss-last) | 420 | ;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the |
| 405 | 0)) | 421 | ;; assumed nil state at BEG may not be valid any more. |
| 406 | (setq syntax-ppss-last nil) | 422 | (if (<= beg (or (syntax-ppss-toplevel-pos (cdr last)) |
| 407 | (setcar syntax-ppss-last nil))) | 423 | (nth 3 last) |
| 408 | ;; Unregister if there's no cache left. Sadly this doesn't work | 424 | 0)) |
| 409 | ;; because `before-change-functions' is temporarily bound to nil here. | 425 | (setq last nil) |
| 410 | ;; (unless syntax-ppss-cache | 426 | (setcar last nil))) |
| 411 | ;; (remove-hook 'before-change-functions 'syntax-ppss-flush-cache t)) | 427 | ;; Unregister if there's no cache left. Sadly this doesn't work |
| 412 | ) | 428 | ;; because `before-change-functions' is temporarily bound to nil here. |
| 429 | ;; (unless cache | ||
| 430 | ;; (remove-hook 'before-change-functions 'syntax-ppss-flush-cache t)) | ||
| 431 | (setcar cell last) | ||
| 432 | (setcdr cell cache))) | ||
| 433 | )) | ||
| 413 | 434 | ||
| 414 | (defvar syntax-ppss-stats | 435 | (defvar syntax-ppss-stats |
| 415 | [(0 . 0.0) (0 . 0.0) (0 . 0.0) (0 . 0.0) (0 . 0.0) (1 . 2500.0)]) | 436 | [(0 . 0.0) (0 . 0.0) (0 . 0.0) (0 . 0.0) (0 . 0.0) (1 . 2500.0)]) |
| @@ -423,6 +444,17 @@ point (where the PPSS is equivalent to nil).") | |||
| 423 | (defvar-local syntax-ppss-table nil | 444 | (defvar-local syntax-ppss-table nil |
| 424 | "Syntax-table to use during `syntax-ppss', if any.") | 445 | "Syntax-table to use during `syntax-ppss', if any.") |
| 425 | 446 | ||
| 447 | (defun syntax-ppss--data () | ||
| 448 | (if (eq (point-min) 1) | ||
| 449 | (progn | ||
| 450 | (unless syntax-ppss-wide | ||
| 451 | (setq syntax-ppss-wide (cons nil nil))) | ||
| 452 | syntax-ppss-wide) | ||
| 453 | (unless (eq syntax-ppss-narrow-start (point-min)) | ||
| 454 | (setq syntax-ppss-narrow-start (point-min)) | ||
| 455 | (setq syntax-ppss-narrow (cons nil nil))) | ||
| 456 | syntax-ppss-narrow)) | ||
| 457 | |||
| 426 | (defun syntax-ppss (&optional pos) | 458 | (defun syntax-ppss (&optional pos) |
| 427 | "Parse-Partial-Sexp State at POS, defaulting to point. | 459 | "Parse-Partial-Sexp State at POS, defaulting to point. |
| 428 | The returned value is the same as that of `parse-partial-sexp' | 460 | The returned value is the same as that of `parse-partial-sexp' |
| @@ -439,10 +471,13 @@ running the hook." | |||
| 439 | (syntax-propertize pos) | 471 | (syntax-propertize pos) |
| 440 | ;; | 472 | ;; |
| 441 | (with-syntax-table (or syntax-ppss-table (syntax-table)) | 473 | (with-syntax-table (or syntax-ppss-table (syntax-table)) |
| 442 | (let ((old-ppss (cdr syntax-ppss-last)) | 474 | (let* ((cell (syntax-ppss--data)) |
| 443 | (old-pos (car syntax-ppss-last)) | 475 | (ppss-last (car cell)) |
| 444 | (ppss nil) | 476 | (ppss-cache (cdr cell)) |
| 445 | (pt-min (point-min))) | 477 | (old-ppss (cdr ppss-last)) |
| 478 | (old-pos (car ppss-last)) | ||
| 479 | (ppss nil) | ||
| 480 | (pt-min (point-min))) | ||
| 446 | (if (and old-pos (> old-pos pos)) (setq old-pos nil)) | 481 | (if (and old-pos (> old-pos pos)) (setq old-pos nil)) |
| 447 | ;; Use the OLD-POS if usable and close. Don't update the `last' cache. | 482 | ;; Use the OLD-POS if usable and close. Don't update the `last' cache. |
| 448 | (condition-case nil | 483 | (condition-case nil |
| @@ -475,7 +510,7 @@ running the hook." | |||
| 475 | ;; The OLD-* data can't be used. Consult the cache. | 510 | ;; The OLD-* data can't be used. Consult the cache. |
| 476 | (t | 511 | (t |
| 477 | (let ((cache-pred nil) | 512 | (let ((cache-pred nil) |
| 478 | (cache syntax-ppss-cache) | 513 | (cache ppss-cache) |
| 479 | (pt-min (point-min)) | 514 | (pt-min (point-min)) |
| 480 | ;; I differentiate between PT-MIN and PT-BEST because | 515 | ;; I differentiate between PT-MIN and PT-BEST because |
| 481 | ;; I feel like it might be important to ensure that the | 516 | ;; I feel like it might be important to ensure that the |
| @@ -491,7 +526,7 @@ running the hook." | |||
| 491 | (if cache (setq pt-min (caar cache) ppss (cdar cache))) | 526 | (if cache (setq pt-min (caar cache) ppss (cdar cache))) |
| 492 | 527 | ||
| 493 | ;; Setup the before-change function if necessary. | 528 | ;; Setup the before-change function if necessary. |
| 494 | (unless (or syntax-ppss-cache syntax-ppss-last) | 529 | (unless (or ppss-cache ppss-last) |
| 495 | (add-hook 'before-change-functions | 530 | (add-hook 'before-change-functions |
| 496 | 'syntax-ppss-flush-cache t t)) | 531 | 'syntax-ppss-flush-cache t t)) |
| 497 | 532 | ||
| @@ -541,7 +576,7 @@ running the hook." | |||
| 541 | pt-min (setq pt-min (/ (+ pt-min pos) 2)) | 576 | pt-min (setq pt-min (/ (+ pt-min pos) 2)) |
| 542 | nil nil ppss)) | 577 | nil nil ppss)) |
| 543 | (push (cons pt-min ppss) | 578 | (push (cons pt-min ppss) |
| 544 | (if cache-pred (cdr cache-pred) syntax-ppss-cache))) | 579 | (if cache-pred (cdr cache-pred) ppss-cache))) |
| 545 | 580 | ||
| 546 | ;; Compute the actual return value. | 581 | ;; Compute the actual return value. |
| 547 | (setq ppss (parse-partial-sexp pt-min pos nil nil ppss)) | 582 | (setq ppss (parse-partial-sexp pt-min pos nil nil ppss)) |
| @@ -562,13 +597,15 @@ running the hook." | |||
| 562 | (if (> (- (caar cache-pred) pos) syntax-ppss-max-span) | 597 | (if (> (- (caar cache-pred) pos) syntax-ppss-max-span) |
| 563 | (push pair (cdr cache-pred)) | 598 | (push pair (cdr cache-pred)) |
| 564 | (setcar cache-pred pair)) | 599 | (setcar cache-pred pair)) |
| 565 | (if (or (null syntax-ppss-cache) | 600 | (if (or (null ppss-cache) |
| 566 | (> (- (caar syntax-ppss-cache) pos) | 601 | (> (- (caar ppss-cache) pos) |
| 567 | syntax-ppss-max-span)) | 602 | syntax-ppss-max-span)) |
| 568 | (push pair syntax-ppss-cache) | 603 | (push pair ppss-cache) |
| 569 | (setcar syntax-ppss-cache pair))))))))) | 604 | (setcar ppss-cache pair))))))))) |
| 570 | 605 | ||
| 571 | (setq syntax-ppss-last (cons pos ppss)) | 606 | (setq ppss-last (cons pos ppss)) |
| 607 | (setcar cell ppss-last) | ||
| 608 | (setcdr cell ppss-cache) | ||
| 572 | ppss) | 609 | ppss) |
| 573 | (args-out-of-range | 610 | (args-out-of-range |
| 574 | ;; If the buffer is more narrowed than when we built the cache, | 611 | ;; If the buffer is more narrowed than when we built the cache, |
| @@ -582,7 +619,7 @@ running the hook." | |||
| 582 | (defun syntax-ppss-debug () | 619 | (defun syntax-ppss-debug () |
| 583 | (let ((pt nil) | 620 | (let ((pt nil) |
| 584 | (min-diffs nil)) | 621 | (min-diffs nil)) |
| 585 | (dolist (x (append syntax-ppss-cache (list (cons (point-min) nil)))) | 622 | (dolist (x (append (cdr (syntax-ppss--data)) (list (cons (point-min) nil)))) |
| 586 | (when pt (push (- pt (car x)) min-diffs)) | 623 | (when pt (push (- pt (car x)) min-diffs)) |
| 587 | (setq pt (car x))) | 624 | (setq pt (car x))) |
| 588 | min-diffs)) | 625 | min-diffs)) |
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index c204ec869b5..8b24ec3c430 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el | |||
| @@ -142,7 +142,7 @@ function `string-to-number'." | |||
| 142 | (defmacro eshell-condition-case (tag form &rest handlers) | 142 | (defmacro eshell-condition-case (tag form &rest handlers) |
| 143 | "If `eshell-handle-errors' is non-nil, this is `condition-case'. | 143 | "If `eshell-handle-errors' is non-nil, this is `condition-case'. |
| 144 | Otherwise, evaluates FORM with no error handling." | 144 | Otherwise, evaluates FORM with no error handling." |
| 145 | (declare (indent 2)) | 145 | (declare (indent 2) (debug (sexp form &rest form))) |
| 146 | (if eshell-handle-errors | 146 | (if eshell-handle-errors |
| 147 | `(condition-case-unless-debug ,tag | 147 | `(condition-case-unless-debug ,tag |
| 148 | ,form | 148 | ,form |
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)) |
diff --git a/src/gtkutil.c b/src/gtkutil.c index f3e89c82c66..46d3d1d93d2 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1224,7 +1224,10 @@ xg_create_frame_widgets (struct frame *f) | |||
| 1224 | with regular X drawing primitives, so from a GTK/GDK point of | 1224 | with regular X drawing primitives, so from a GTK/GDK point of |
| 1225 | view, the widget is totally blank. When an expose comes, this | 1225 | view, the widget is totally blank. When an expose comes, this |
| 1226 | will make the widget blank, and then Emacs redraws it. This flickers | 1226 | will make the widget blank, and then Emacs redraws it. This flickers |
| 1227 | a lot, so we turn off double buffering. */ | 1227 | a lot, so we turn off double buffering. |
| 1228 | FIXME: gtk_widget_set_double_buffered is deprecated and might stop | ||
| 1229 | working in the future. We need to migrate away from combining | ||
| 1230 | X and GTK+ drawing to a pure GTK+ build. */ | ||
| 1228 | gtk_widget_set_double_buffered (wfixed, FALSE); | 1231 | gtk_widget_set_double_buffered (wfixed, FALSE); |
| 1229 | 1232 | ||
| 1230 | #if ! GTK_CHECK_VERSION (3, 22, 0) | 1233 | #if ! GTK_CHECK_VERSION (3, 22, 0) |
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el index 2c6740a96cf..0e8871d9a9c 100644 --- a/test/lisp/emacs-lisp/subr-x-tests.el +++ b/test/lisp/emacs-lisp/subr-x-tests.el | |||
| @@ -397,9 +397,14 @@ | |||
| 397 | (should (equal 1 (let ((x 1)) (and-let* (x))))) | 397 | (should (equal 1 (let ((x 1)) (and-let* (x))))) |
| 398 | (should (equal nil (and-let* ((x nil))))) | 398 | (should (equal nil (and-let* ((x nil))))) |
| 399 | (should (equal 1 (and-let* ((x 1))))) | 399 | (should (equal 1 (and-let* ((x 1))))) |
| 400 | (should-error (and-let* (nil (x 1))) :type 'setting-constant) | 400 | ;; The error doesn't trigger when compiled: the compiler will give |
| 401 | ;; a warning and then drop the erroneous code. Therefore, use | ||
| 402 | ;; `eval' to avoid compilation. | ||
| 403 | (should-error (eval '(and-let* (nil (x 1))) lexical-binding) | ||
| 404 | :type 'setting-constant) | ||
| 401 | (should (equal nil (and-let* ((nil) (x 1))))) | 405 | (should (equal nil (and-let* ((nil) (x 1))))) |
| 402 | (should-error (and-let* (2 (x 1))) :type 'wrong-type-argument) | 406 | (should-error (eval (and-let* (2 (x 1))) lexical-binding) |
| 407 | :type 'wrong-type-argument) | ||
| 403 | (should (equal 1 (and-let* ((2) (x 1))))) | 408 | (should (equal 1 (and-let* ((2) (x 1))))) |
| 404 | (should (equal 2 (and-let* ((x 1) (2))))) | 409 | (should (equal 2 (and-let* ((x 1) (2))))) |
| 405 | (should (equal nil (let ((x nil)) (and-let* (x) x)))) | 410 | (should (equal nil (let ((x nil)) (and-let* (x) x)))) |