diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/custom.el | 21 | ||||
| -rw-r--r-- | lisp/emacs-lisp/lisp.el | 21 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 3 | ||||
| -rw-r--r-- | lisp/term.el | 6 |
4 files changed, 30 insertions, 21 deletions
diff --git a/lisp/custom.el b/lisp/custom.el index 53b8045f058..29bf9e570a8 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -56,8 +56,14 @@ Otherwise, if symbol has a `saved-value' property, it will evaluate the car of that and use it as the default binding for symbol. Otherwise, EXP will be evaluated and used as the default binding for symbol." - (eval `(defvar ,symbol ,(let ((sv (get symbol 'saved-value))) - (if sv (car sv) exp))))) + (condition-case nil + (default-toplevel-value symbol) ;Test presence of default value. + (void-variable + ;; The var is not initialized yet. + (set-default-toplevel-value + symbol (eval (let ((sv (get symbol 'saved-value))) + (if sv (car sv) exp)) + t))))) (defun custom-initialize-set (symbol exp) "Initialize SYMBOL based on EXP. @@ -188,18 +194,13 @@ set to nil, as the value is no longer rogue." (t (custom-handle-keyword symbol keyword value 'custom-variable)))))) + ;; Set the docstring, record the var on load-history, as well + ;; as set the special-variable-p flag. + (internal--define-uninitialized-variable symbol doc) (put symbol 'custom-requests requests) ;; Do the actual initialization. (unless custom-dont-initialize (funcall initialize symbol default))) - ;; Use defvar to set the docstring as well as the special-variable-p flag. - ;; FIXME: We should reproduce more of `defvar's behavior, such as the warning - ;; when the var is currently let-bound. - (if (not (default-boundp symbol)) - ;; Don't use defvar to avoid setting a default-value when undesired. - (when doc (put symbol 'variable-documentation doc)) - (eval `(defvar ,symbol nil ,@(when doc (list doc))))) - (push symbol current-load-list) (run-hooks 'custom-define-hook) symbol) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index f73dbb269d8..38df920f17a 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -645,14 +645,8 @@ Interactively, the behavior depends on `narrow-to-defun-include-comments'." (re-search-backward "^\n" (- (point) 1) t) (narrow-to-region beg end)))) -(defvar insert-pair-alist - (append '((?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\')) - (let (alist) - (map-char-table - (lambda (open close) - (when (< open close) (push (list open close) alist))) - (unicode-property-table-internal 'paired-bracket)) - (nreverse alist))) +(defcustom insert-pair-alist + '((?\( ?\)) (?\[ ?\]) (?\{ ?\}) (?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\')) "Alist of paired characters inserted by `insert-pair'. Each element looks like (OPEN-CHAR CLOSE-CHAR) or (COMMAND-CHAR OPEN-CHAR CLOSE-CHAR). The characters OPEN-CHAR and CLOSE-CHAR @@ -661,7 +655,16 @@ or without modifiers, are inserted by `insert-pair'. If COMMAND-CHAR is specified, it is a character that triggers the insertion of the open/close pair, and COMMAND-CHAR itself isn't -inserted.") +inserted." + :type '(repeat (choice (list :tag "Pair" + (character :tag "Open") + (character :tag "Close")) + (list :tag "Triple" + (character :tag "Command") + (character :tag "Open") + (character :tag "Close")))) + :group 'lisp + :version "27.1") (defun insert-pair (&optional arg open close) "Enclose following ARG sexps in a pair of OPEN and CLOSE characters. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 7e6a46ea6e0..a2762ca2097 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -1143,6 +1143,9 @@ comment at the start of cc-engine.el for more info." ;; Have we moved into a macro? ((and (not macro-start) (c-beginning-of-macro)) + (save-excursion + (c-backward-syntactic-ws) + (setq before-sws-pos (point))) ;; Have we crossed a statement boundary? If not, ;; keep going back until we find one or a "real" sexp. (and diff --git a/lisp/term.el b/lisp/term.el index 586a887a29f..283e5684b72 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2935,7 +2935,8 @@ See `term-prompt-regexp'." (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) - (put-text-property (1- (point)) (point) 'term-line-wrap t) + (add-text-properties (1- (point)) (point) + '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) @@ -3754,7 +3755,8 @@ all pending output has been dealt with.")) (when (not (bolp)) (let ((old-point (point))) (insert-before-markers ?\n) - (put-text-property old-point (point) 'term-line-wrap t)))) + (add-text-properties old-point (point) + '(term-line-wrap t rear-nonsticky t))))) (defun term-erase-in-line (kind) (when (= kind 1) ;; erase left of point |
