From 297c0e0306f111c1e7564b2bb49a7e1a925a55bb Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 25 Feb 2021 20:45:40 +0200 Subject: New variable 'use-short-answers' to use 'y-or-n-p' instead of 'yes-or-no-p' * lisp/cus-start.el: Add use-short-answers. * lisp/emacs-lisp/map-ynp.el (read-answer): Handle use-short-answers. (read-answer-short): Add use-short-answers to docstring. * src/fns.c (Fyes_or_no_p): Call y-or-n-p if use_short_answers is true. (syms_of_fns): Add DEFVAR_BOOL use-short-answers (bug#46594). --- lisp/cus-start.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp/cus-start.el') diff --git a/lisp/cus-start.el b/lisp/cus-start.el index c0a4a6dda06..7b05f5796a4 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -302,6 +302,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of ;; fns.c (use-dialog-box menu boolean "21.1") (use-file-dialog menu boolean "22.1") + (use-short-answers menu boolean "28.1") (focus-follows-mouse frames (choice (const :tag "Off (nil)" :value nil) -- cgit v1.2.3 From 6d580dee309187ac0e5922215e133883e15718f9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 5 Mar 2021 23:33:21 -0500 Subject: * * lisp/cedet/semantic: Use lexical-binding in the generated grammars * admin/grammars/c.by (typesimple): Bind `semantic-c-classname` dynamically. * lisp/cedet/semantic/bovine.el: Use lexical-binding. (semantic-lambda): Silence warnings if the `vals` arg is not used. * lisp/cedet/semantic/grammar-wy.el: Re-generate. * lisp/cedet/semantic/bovine/grammar.el: Use lexical-binding. (bovine-grammar-expand-action): Silence warnings if some of the `vals`, `start`, or `end` args is not used. (bovine--make-parser-1): Use lexical-binding in the generated files. * lisp/cedet/semantic/wisent/grammar.el: Use lexical-binding. (wisent--make-parser-1): Use lexical-binding in the generated files. --- admin/grammars/c.by | 2 +- lisp/cedet/ede/custom.el | 4 +- lisp/cedet/semantic/bovine.el | 3 +- lisp/cedet/semantic/bovine/grammar.el | 8 +- lisp/cedet/semantic/grammar-wy.el | 424 +++++++++++++++++----------------- lisp/cedet/semantic/wisent/grammar.el | 7 +- lisp/cus-start.el | 2 +- 7 files changed, 232 insertions(+), 218 deletions(-) (limited to 'lisp/cus-start.el') diff --git a/admin/grammars/c.by b/admin/grammars/c.by index 2d04c999aca..289081e3ced 100644 --- a/admin/grammars/c.by +++ b/admin/grammars/c.by @@ -415,7 +415,7 @@ typesimple : struct-or-class opt-class opt-name opt-template-specifier opt-class-parents semantic-list (TYPE-TAG (car $3) (car $1) - (let ((semantic-c-classname (cons (car ,$3) (car ,$1)))) + (dlet ((semantic-c-classname (cons (car ,$3) (car ,$1)))) (EXPANDFULL $6 classsubparts)) $5 :template-specifier $4 diff --git a/lisp/cedet/ede/custom.el b/lisp/cedet/ede/custom.el index aada872cd0a..a128f9e1241 100644 --- a/lisp/cedet/ede/custom.el +++ b/lisp/cedet/ede/custom.el @@ -53,7 +53,7 @@ (setq-local eieio-ede-old-variables ov))) ;;;###autoload -(defalias 'customize-project 'ede-customize-project) +(defalias 'customize-project #'ede-customize-project) ;;;###autoload (defun ede-customize-current-target() @@ -65,7 +65,7 @@ (ede-customize-target ede-object)) ;;;###autoload -(defalias 'customize-target 'ede-customize-current-target) +(defalias 'customize-target #'ede-customize-current-target) (defun ede-customize-target (obj) "Edit fields of the current target through EIEIO & Custom. diff --git a/lisp/cedet/semantic/bovine.el b/lisp/cedet/semantic/bovine.el index 65d7868588e..b585e387fed 100644 --- a/lisp/cedet/semantic/bovine.el +++ b/lisp/cedet/semantic/bovine.el @@ -1,4 +1,4 @@ -;;; semantic/bovine.el --- LL Parser/Analyzer core. +;;; semantic/bovine.el --- LL Parser/Analyzer core -*- lexical-binding: t; -*- ;; Copyright (C) 1999-2004, 2006-2007, 2009-2021 Free Software ;; Foundation, Inc. @@ -54,6 +54,7 @@ Use this to detect infinite recursion during a parse.") "Create a lambda expression to return a list including RETURN-VAL. The return list is a lambda expression to be used in a bovine table." `(lambda (vals start end) + (ignore vals) (append ,@return-val (list start end)))) ;;; Semantic Bovination diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el index 4914ec9b124..e3df7b12ab6 100644 --- a/lisp/cedet/semantic/bovine/grammar.el +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -1,4 +1,4 @@ -;;; semantic/bovine/grammar.el --- Bovine's input grammar mode +;;; semantic/bovine/grammar.el --- Bovine's input grammar mode -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. ;; @@ -243,7 +243,8 @@ QUOTEMODE is the mode in which quoted symbols are slurred." (insert "\n") (cond ((eq (car sexp) 'EXPAND) - (insert ",(lambda (vals start end)") + (insert ",(lambda (vals start end)" + "\n(ignore vals start end)") ;; The EXPAND macro definition is mandatory (bovine-grammar-expand-form (apply (cdr (assq 'EXPAND bovine--grammar-macros)) (cdr sexp)) @@ -520,7 +521,8 @@ Menu items are appended to the common grammar menu.") (goto-char (point-min)) (delete-region (point-min) (line-end-position)) (insert ";;; " packagename - " --- Generated parser support file") + " --- Generated parser support file " + "-*- lexical-binding:t -*-") (delete-trailing-whitespace) (re-search-forward ";;; \\(.*\\) ends here") (replace-match packagename nil nil nil 1))))) diff --git a/lisp/cedet/semantic/grammar-wy.el b/lisp/cedet/semantic/grammar-wy.el index 12c9c047fc5..9a7f393072f 100644 --- a/lisp/cedet/semantic/grammar-wy.el +++ b/lisp/cedet/semantic/grammar-wy.el @@ -1,6 +1,6 @@ -;;; semantic/grammar-wy.el --- Generated parser support file +;;; semantic/grammar-wy.el --- Generated parser support file -*- lexical-binding:t -*- -;; Copyright (C) 2002-2004, 2009-2021 Free Software Foundation, Inc. +;; Copyright (C) 2002-2021 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -23,8 +23,9 @@ ;;; Code: -(require 'semantic) - +(require 'semantic/lex) +(eval-when-compile (require 'semantic/bovine)) + ;;; Prologue ;; (defvar semantic-grammar-lex-c-char-re) @@ -36,16 +37,20 @@ ;;; Declarations ;; +(eval-and-compile (defconst semantic-grammar-wy--expected-conflicts + nil + "The number of expected shift/reduce conflicts in this grammar.")) + (defconst semantic-grammar-wy--keyword-table (semantic-lex-make-keyword-table '(("%default-prec" . DEFAULT-PREC) ("%no-default-prec" . NO-DEFAULT-PREC) ("%keyword" . KEYWORD) - ("%expectedconflicts" . EXPECTEDCONFLICTS) ("%languagemode" . LANGUAGEMODE) ("%left" . LEFT) ("%nonassoc" . NONASSOC) ("%package" . PACKAGE) + ("%expectedconflicts" . EXPECTEDCONFLICTS) ("%provide" . PROVIDE) ("%prec" . PREC) ("%put" . PUT) @@ -111,239 +116,239 @@ (eval-when-compile (require 'semantic/wisent/comp)) (wisent-compile-grammar - '((DEFAULT-PREC NO-DEFAULT-PREC KEYWORD LANGUAGEMODE EXPECTEDCONFLICTS LEFT NONASSOC PACKAGE PROVIDE PREC PUT QUOTEMODE RIGHT SCOPESTART START TOKEN TYPE USE-MACROS STRING SYMBOL PERCENT_PERCENT CHARACTER PREFIXED_LIST SEXP PROLOGUE EPILOGUE PAREN_BLOCK BRACE_BLOCK LPAREN RPAREN LBRACE RBRACE COLON SEMI OR LT GT) + '((DEFAULT-PREC NO-DEFAULT-PREC KEYWORD LANGUAGEMODE LEFT NONASSOC PACKAGE EXPECTEDCONFLICTS PROVIDE PREC PUT QUOTEMODE RIGHT SCOPESTART START TOKEN TYPE USE-MACROS STRING SYMBOL PERCENT_PERCENT CHARACTER PREFIXED_LIST SEXP PROLOGUE EPILOGUE PAREN_BLOCK BRACE_BLOCK LPAREN RPAREN LBRACE RBRACE COLON SEMI OR LT GT) nil (grammar - ((prologue)) - ((epilogue)) - ((declaration)) - ((nonterminal)) - ((PERCENT_PERCENT))) + ((prologue)) + ((epilogue)) + ((declaration)) + ((nonterminal)) + ((PERCENT_PERCENT))) (prologue - ((PROLOGUE) - (wisent-raw-tag + ((PROLOGUE) + (wisent-raw-tag (semantic-tag-new-code "prologue" nil)))) (epilogue - ((EPILOGUE) - (wisent-raw-tag + ((EPILOGUE) + (wisent-raw-tag (semantic-tag-new-code "epilogue" nil)))) (declaration - ((decl) - (eval $1))) + ((decl) + (eval $1))) (decl - ((default_prec_decl)) - ((no_default_prec_decl)) - ((languagemode_decl)) - ((expectedconflicts_decl)) - ((package_decl)) - ((provide_decl)) - ((precedence_decl)) - ((put_decl)) - ((quotemode_decl)) - ((scopestart_decl)) - ((start_decl)) - ((keyword_decl)) - ((token_decl)) - ((type_decl)) - ((use_macros_decl))) + ((default_prec_decl)) + ((no_default_prec_decl)) + ((languagemode_decl)) + ((package_decl)) + ((expectedconflicts_decl)) + ((provide_decl)) + ((precedence_decl)) + ((put_decl)) + ((quotemode_decl)) + ((scopestart_decl)) + ((start_decl)) + ((keyword_decl)) + ((token_decl)) + ((type_decl)) + ((use_macros_decl))) (default_prec_decl - ((DEFAULT-PREC) + ((DEFAULT-PREC) `(wisent-raw-tag (semantic-tag "default-prec" 'assoc :value '("t"))))) (no_default_prec_decl - ((NO-DEFAULT-PREC) - `(wisent-raw-tag + ((NO-DEFAULT-PREC) + `(wisent-raw-tag (semantic-tag "default-prec" 'assoc :value - '("nil"))))) + '("nil"))))) (languagemode_decl - ((LANGUAGEMODE symbols) - `(wisent-raw-tag - (semantic-tag ',(car $2) - 'languagemode :rest ',(cdr $2))))) - (expectedconflicts_decl - ((EXPECTEDCONFLICTS symbols) - `(wisent-raw-tag + ((LANGUAGEMODE symbols) + `(wisent-raw-tag (semantic-tag ',(car $2) - 'expectedconflicts :rest ',(cdr $2))))) + 'languagemode :rest ',(cdr $2))))) (package_decl - ((PACKAGE SYMBOL) - `(wisent-raw-tag + ((PACKAGE SYMBOL) + `(wisent-raw-tag (semantic-tag-new-package ',$2 nil)))) + (expectedconflicts_decl + ((EXPECTEDCONFLICTS symbols) + `(wisent-raw-tag + (semantic-tag ',(car $2) + 'expectedconflicts :rest ',(cdr $2))))) (provide_decl - ((PROVIDE SYMBOL) - `(wisent-raw-tag + ((PROVIDE SYMBOL) + `(wisent-raw-tag (semantic-tag ',$2 'provide)))) (precedence_decl - ((associativity token_type_opt items) - `(wisent-raw-tag + ((associativity token_type_opt items) + `(wisent-raw-tag (semantic-tag ',$1 'assoc :type ',$2 :value ',$3)))) (associativity - ((LEFT) - (progn "left")) - ((RIGHT) - (progn "right")) - ((NONASSOC) - (progn "nonassoc"))) + ((LEFT) + (progn "left")) + ((RIGHT) + (progn "right")) + ((NONASSOC) + (progn "nonassoc"))) (put_decl - ((PUT put_name put_value) - `(wisent-raw-tag + ((PUT put_name put_value) + `(wisent-raw-tag (semantic-tag ',$2 'put :value ',(list $3)))) - ((PUT put_name put_value_list) - `(wisent-raw-tag + ((PUT put_name put_value_list) + `(wisent-raw-tag (semantic-tag ',$2 'put :value ',$3))) - ((PUT put_name_list put_value) - `(wisent-raw-tag + ((PUT put_name_list put_value) + `(wisent-raw-tag (semantic-tag ',(car $2) - 'put :rest ',(cdr $2) - :value ',(list $3)))) - ((PUT put_name_list put_value_list) - `(wisent-raw-tag + 'put :rest ',(cdr $2) + :value ',(list $3)))) + ((PUT put_name_list put_value_list) + `(wisent-raw-tag (semantic-tag ',(car $2) - 'put :rest ',(cdr $2) - :value ',$3)))) + 'put :rest ',(cdr $2) + :value ',$3)))) (put_name_list - ((BRACE_BLOCK) - (mapcar 'semantic-tag-name - (semantic-parse-region + ((BRACE_BLOCK) + (mapcar 'semantic-tag-name + (semantic-parse-region (car $region1) (cdr $region1) 'put_names 1)))) (put_names - ((LBRACE) - nil) - ((RBRACE) - nil) - ((put_name) - (wisent-raw-tag + ((LBRACE) + nil) + ((RBRACE) + nil) + ((put_name) + (wisent-raw-tag (semantic-tag $1 'put-name)))) (put_name - ((SYMBOL)) - ((token_type))) + ((SYMBOL)) + ((token_type))) (put_value_list - ((BRACE_BLOCK) - (mapcar 'semantic-tag-code-detail - (semantic-parse-region + ((BRACE_BLOCK) + (mapcar 'semantic-tag-code-detail + (semantic-parse-region (car $region1) (cdr $region1) 'put_values 1)))) (put_values - ((LBRACE) - nil) - ((RBRACE) - nil) - ((put_value) - (wisent-raw-tag + ((LBRACE) + nil) + ((RBRACE) + nil) + ((put_value) + (wisent-raw-tag (semantic-tag-new-code "put-value" $1)))) (put_value - ((SYMBOL any_value) - (cons $1 $2))) + ((SYMBOL any_value) + (cons $1 $2))) (scopestart_decl - ((SCOPESTART SYMBOL) - `(wisent-raw-tag + ((SCOPESTART SYMBOL) + `(wisent-raw-tag (semantic-tag ',$2 'scopestart)))) (quotemode_decl - ((QUOTEMODE SYMBOL) - `(wisent-raw-tag + ((QUOTEMODE SYMBOL) + `(wisent-raw-tag (semantic-tag ',$2 'quotemode)))) (start_decl - ((START symbols) - `(wisent-raw-tag + ((START symbols) + `(wisent-raw-tag (semantic-tag ',(car $2) - 'start :rest ',(cdr $2))))) + 'start :rest ',(cdr $2))))) (keyword_decl - ((KEYWORD SYMBOL string_value) - `(wisent-raw-tag + ((KEYWORD SYMBOL string_value) + `(wisent-raw-tag (semantic-tag ',$2 'keyword :value ',$3)))) (token_decl - ((TOKEN token_type_opt SYMBOL string_value) - `(wisent-raw-tag + ((TOKEN token_type_opt SYMBOL string_value) + `(wisent-raw-tag (semantic-tag ',$3 ',(if $2 'token 'keyword) - :type ',$2 :value ',$4))) - ((TOKEN token_type_opt symbols) - `(wisent-raw-tag + :type ',$2 :value ',$4))) + ((TOKEN token_type_opt symbols) + `(wisent-raw-tag (semantic-tag ',(car $3) - 'token :type ',$2 :rest ',(cdr $3))))) + 'token :type ',$2 :rest ',(cdr $3))))) (token_type_opt - (nil) - ((token_type))) + (nil) + ((token_type))) (token_type - ((LT SYMBOL GT) - (progn $2))) + ((LT SYMBOL GT) + (progn $2))) (type_decl - ((TYPE token_type plist_opt) - `(wisent-raw-tag + ((TYPE token_type plist_opt) + `(wisent-raw-tag (semantic-tag ',$2 'type :value ',$3)))) (plist_opt - (nil) - ((plist))) + (nil) + ((plist))) (plist - ((plist put_value) - (append + ((plist put_value) + (append (list $2) $1)) - ((put_value) - (list $1))) + ((put_value) + (list $1))) (use_name_list - ((BRACE_BLOCK) - (mapcar 'semantic-tag-name - (semantic-parse-region + ((BRACE_BLOCK) + (mapcar 'semantic-tag-name + (semantic-parse-region (car $region1) (cdr $region1) 'use_names 1)))) (use_names - ((LBRACE) - nil) - ((RBRACE) - nil) - ((SYMBOL) - (wisent-raw-tag + ((LBRACE) + nil) + ((RBRACE) + nil) + ((SYMBOL) + (wisent-raw-tag (semantic-tag $1 'use-name)))) (use_macros_decl - ((USE-MACROS SYMBOL use_name_list) - `(wisent-raw-tag + ((USE-MACROS SYMBOL use_name_list) + `(wisent-raw-tag (semantic-tag "macro" 'macro :type ',$2 :value ',$3)))) (string_value - ((STRING) - (read $1))) + ((STRING) + (read $1))) (any_value - ((SYMBOL)) - ((STRING)) - ((PAREN_BLOCK)) - ((PREFIXED_LIST)) - ((SEXP))) + ((SYMBOL)) + ((STRING)) + ((PAREN_BLOCK)) + ((PREFIXED_LIST)) + ((SEXP))) (symbols - ((lifo_symbols) - (nreverse $1))) + ((lifo_symbols) + (nreverse $1))) (lifo_symbols - ((lifo_symbols SYMBOL) - (cons $2 $1)) - ((SYMBOL) - (list $1))) + ((lifo_symbols SYMBOL) + (cons $2 $1)) + ((SYMBOL) + (list $1))) (nonterminal - ((SYMBOL + ((SYMBOL (setq semantic-grammar-wy--nterm $1 semantic-grammar-wy--rindx 0) COLON rules SEMI) - (wisent-raw-tag + (wisent-raw-tag (semantic-tag $1 'nonterminal :children $4)))) (rules - ((lifo_rules) - (apply 'nconc - (nreverse $1)))) + ((lifo_rules) + (apply 'nconc + (nreverse $1)))) (lifo_rules - ((lifo_rules OR rule) - (cons $3 $1)) - ((rule) - (list $1))) + ((lifo_rules OR rule) + (cons $3 $1)) + ((rule) + (list $1))) (rule - ((rhs) - (let* + ((rhs) + (let* ((nterm semantic-grammar-wy--nterm) (rindx semantic-grammar-wy--rindx) (rhs $1) comps prec action elt) (setq semantic-grammar-wy--rindx - (1+ semantic-grammar-wy--rindx)) + (1+ semantic-grammar-wy--rindx)) (while rhs (setq elt (car rhs) @@ -359,10 +364,10 @@ (if (or action comps) (setq comps - (cons elt comps) - semantic-grammar-wy--rindx - (1+ semantic-grammar-wy--rindx)) - (setq action + (cons elt comps) + semantic-grammar-wy--rindx + (1+ semantic-grammar-wy--rindx)) + (setq action (car elt)))) (t (setq comps @@ -375,46 +380,46 @@ (if comps "group" "empty") :value comps :prec prec :expr action)))))) (rhs - (nil) - ((rhs item) - (cons $2 $1)) - ((rhs action) - (cons + (nil) + ((rhs item) + (cons $2 $1)) + ((rhs action) + (cons (list $2) $1)) - ((rhs PREC item) - (cons + ((rhs PREC item) + (cons (vector $3) $1))) (action - ((PAREN_BLOCK)) - ((PREFIXED_LIST)) - ((BRACE_BLOCK) - (format "(progn\n%s)" - (let + ((PAREN_BLOCK)) + ((PREFIXED_LIST)) + ((BRACE_BLOCK) + (format "(progn\n%s)" + (let ((s $1)) (if - (string-match "^{[\r\n\t ]*" s) + (string-match "^{[ \n ]*" s) (setq s (substring s - (match-end 0)))) + (match-end 0)))) (if - (string-match "[\r\n\t ]*}$" s) + (string-match "[ \n ]*}$" s) (setq s (substring s 0 - (match-beginning 0)))) + (match-beginning 0)))) s)))) (items - ((lifo_items) - (nreverse $1))) + ((lifo_items) + (nreverse $1))) (lifo_items - ((lifo_items item) - (cons $2 $1)) - ((item) - (list $1))) + ((lifo_items item) + (cons $2 $1)) + ((item) + (list $1))) (item - ((SYMBOL)) - ((CHARACTER)))) + ((SYMBOL)) + ((CHARACTER)))) '(grammar prologue epilogue declaration nonterminal rule put_names put_values use_names))) "Parser table.") @@ -423,25 +428,26 @@ (semantic-install-function-overrides '((semantic-parse-stream . wisent-parse-stream))) (setq semantic-parser-name "LALR" - semantic--parse-table semantic-grammar-wy--parse-table - semantic-debug-parser-source "grammar.wy" - semantic-flex-keywords-obarray semantic-grammar-wy--keyword-table - semantic-lex-types-obarray semantic-grammar-wy--token-table) + semantic--parse-table semantic-grammar-wy--parse-table + semantic-debug-parser-source "grammar.wy" + semantic-flex-keywords-obarray semantic-grammar-wy--keyword-table + semantic-lex-types-obarray semantic-grammar-wy--token-table) ;; Collect unmatched syntax lexical tokens (add-hook 'wisent-discarding-token-functions - 'wisent-collect-unmatched-syntax nil t)) + 'wisent-collect-unmatched-syntax nil t)) ;;; Analyzers ;; -(define-lex-block-type-analyzer semantic-grammar-wy---block-analyzer - "block analyzer for tokens." - "\\s(\\|\\s)" - '((("(" LPAREN PAREN_BLOCK) - ("{" LBRACE BRACE_BLOCK)) - (")" RPAREN) - ("}" RBRACE)) - ) +(define-lex-regex-type-analyzer semantic-grammar-wy---regexp-analyzer + "regexp analyzer for tokens." + ":?\\(\\sw\\|\\s_\\)+" + '((PERCENT_PERCENT . "\\`%%\\'")) + 'SYMBOL) + +(define-lex-keyword-type-analyzer semantic-grammar-wy---keyword-analyzer + "keyword analyzer for tokens." + "\\(\\sw\\|\\s_\\)+") (define-lex-regex-type-analyzer semantic-grammar-wy---regexp-analyzer "regexp analyzer for tokens." @@ -449,21 +455,19 @@ nil 'CHARACTER) -(define-lex-regex-type-analyzer semantic-grammar-wy---regexp-analyzer - "regexp analyzer for tokens." - ":?\\(\\sw\\|\\s_\\)+" - '((PERCENT_PERCENT . "\\`%%\\'")) - 'SYMBOL) - (define-lex-sexp-type-analyzer semantic-grammar-wy---sexp-analyzer "sexp analyzer for tokens." "\\s'\\s-*(" 'PREFIXED_LIST) -(define-lex-sexp-type-analyzer semantic-grammar-wy---sexp-analyzer - "sexp analyzer for tokens." - "\\s\"" - 'STRING) +(define-lex-block-type-analyzer semantic-grammar-wy---block-analyzer + "block analyzer for tokens." + "\\s(\\|\\s)" + '((("(" LPAREN PAREN_BLOCK) + ("{" LBRACE BRACE_BLOCK)) + (")" RPAREN) + ("}" RBRACE)) + ) (define-lex-string-type-analyzer semantic-grammar-wy---string-analyzer "string analyzer for tokens." @@ -475,9 +479,10 @@ (COLON . ":")) 'punctuation) -(define-lex-keyword-type-analyzer semantic-grammar-wy---keyword-analyzer - "keyword analyzer for tokens." - "\\(\\sw\\|\\s_\\)+") +(define-lex-sexp-type-analyzer semantic-grammar-wy---sexp-analyzer + "sexp analyzer for tokens." + "\\s\"" + 'STRING) (define-lex-sexp-type-analyzer semantic-grammar-wy---sexp-analyzer "sexp analyzer for tokens." @@ -493,4 +498,9 @@ (provide 'semantic/grammar-wy) +;; Local Variables: +;; version-control: never +;; no-update-autoloads: t +;; End: + ;;; semantic/grammar-wy.el ends here diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el index cfd4899186b..edc5c5c7029 100644 --- a/lisp/cedet/semantic/wisent/grammar.el +++ b/lisp/cedet/semantic/wisent/grammar.el @@ -1,4 +1,4 @@ -;;; semantic/wisent/grammar.el --- Wisent's input grammar mode +;;; semantic/wisent/grammar.el --- Wisent's input grammar mode -*- lexical-binding: t; -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. ;; @@ -228,7 +228,7 @@ Keep order of declaration in the WY file without duplicates." Return the expanded expression." (if (or (atom expr) (semantic-grammar-quote-p (car expr))) expr ;; Just return atom or quoted expression. - (let* ((expr (mapcar 'wisent-grammar-expand-macros expr)) + (let* ((expr (mapcar #'wisent-grammar-expand-macros expr)) (macro (assq (car expr) wisent--grammar-macros))) (if macro ;; Expand Semantic built-in. (apply (cdr macro) (cdr expr)) @@ -514,7 +514,8 @@ Menu items are appended to the common grammar menu.") (goto-char (point-min)) (delete-region (point-min) (line-end-position)) (insert ";;; " packagename - " --- Generated parser support file") + " --- Generated parser support file " + "-*- lexical-binding:t -*-") (re-search-forward ";;; \\(.*\\) ends here") (replace-match packagename nil nil nil 1) (delete-trailing-whitespace)))))) diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 7b05f5796a4..b7afef6516d 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -36,7 +36,7 @@ (defun minibuffer-prompt-properties--setter (symbol value) (set-default symbol value) (if (memq 'cursor-intangible value) - (add-hook 'minibuffer-setup-hook 'cursor-intangible-mode) + (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) ;; Removing it is a bit trickier since it could have been added by someone ;; else as well, so let's just not bother. )) -- cgit v1.2.3 From aaa32f39420826bdbca30a3bc6212c38c267cda6 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 2 Jul 2021 10:01:46 +0200 Subject: Fix a problem of cus-start.el for remote default directories * lisp/cus-start.el: Bind `default-directory' to "/" when calling `shell-command-to-string' for a local value on DARWIN. --- lisp/cus-start.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp/cus-start.el') diff --git a/lisp/cus-start.el b/lisp/cus-start.el index b7afef6516d..3c2625a8c31 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -285,6 +285,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") ;; See bug#7135. (let* (file-name-handler-alist + (default-directory "/") (tmp (ignore-errors (shell-command-to-string "getconf DARWIN_USER_TEMP_DIR")))) -- cgit v1.2.3 From a98bf3e7d713cb944c38ae6f784dc26d532b8e71 Mon Sep 17 00:00:00 2001 From: Illia Ostapyshyn Date: Wed, 21 Jul 2021 23:53:17 +0200 Subject: * lisp/cus-start.el: Add mode-line-compact to Customize * lisp/cus-start.el (standard): Make `mode-line-compact' into a user option (bug#49687). Copyright-paperwork-exempt: yes --- lisp/cus-start.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp/cus-start.el') diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 3c2625a8c31..50a6bd2f752 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -631,6 +631,12 @@ since it could result in memory overflow and make Emacs crash." ;; The whitespace group is for whitespace.el. (show-trailing-whitespace editing-basics boolean nil :safe booleanp) + (mode-line-compact + mode-line + (choice (const :tag "Never (nil)" :value nil) + (const :tag "Only if wider than window (long)" :value long) + (const :tag "Always (t)" :value t)) + "28.1") (scroll-step windows integer) (scroll-conservatively windows integer) (scroll-margin windows integer) -- cgit v1.2.3 From 0dcc4449812658ab289c26e2b11c0d5bbf69a2cc Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 22 Jul 2021 14:14:33 +0200 Subject: Remove the (value) bits from cus-start Customize strings * lisp/cus-start.el (standard): Don't mention the Lisp values in the choice strings, because that's just confusing in the Customize interface (bug#49687). --- lisp/cus-start.el | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'lisp/cus-start.el') diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 50a6bd2f752..7df70d704ef 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -306,8 +306,8 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (use-short-answers menu boolean "28.1") (focus-follows-mouse frames (choice - (const :tag "Off (nil)" :value nil) - (const :tag "On (t)" :value t) + (const :tag "Off" :value nil) + (const :tag "On" :value t) (const :tag "Auto-raise" :value auto-raise)) "26.1") ;; fontset.c ;; FIXME nil is the initial value, fontset.el setqs it. @@ -603,27 +603,29 @@ since it could result in memory overflow and make Emacs crash." (next-screen-context-lines windows integer) (scroll-preserve-screen-position windows (choice - (const :tag "Off (nil)" :value nil) - (const :tag "Full screen (t)" :value t) - (other :tag "Always" 1)) "22.1") + (const :tag "Off" :value nil) + (const :tag "Full screen" :value t) + (other :tag "Always" 1)) + "22.1") (recenter-redisplay windows (choice - (const :tag "Never (nil)" :value nil) + (const :tag "Never" :value nil) (const :tag "Only on ttys" :value tty) - (other :tag "Always" t)) "23.1") + (other :tag "Always" t)) + "23.1") (window-combination-resize windows boolean "24.1") (window-combination-limit windows (choice - (const :tag "Never (nil)" :value nil) - (const :tag "If requested via buffer display alist (window-size)" + (const :tag "Never" :value nil) + (const :tag "If requested via buffer display alist" :value window-size) - (const :tag "With Temp Buffer Resize mode (temp-buffer-resize)" + (const :tag "With Temp Buffer Resize mode" :value temp-buffer-resize) - (const :tag "For temporary buffers (temp-buffer)" + (const :tag "For temporary buffers" :value temp-buffer) - (const :tag "For buffer display (display-buffer)" + (const :tag "For buffer display" :value display-buffer) - (other :tag "Always (t)" :value t)) + (other :tag "Always" :value t)) "26.1") (fast-but-imprecise-scrolling scrolling boolean "25.1") (window-resize-pixelwise windows boolean "24.4") @@ -633,9 +635,9 @@ since it could result in memory overflow and make Emacs crash." :safe booleanp) (mode-line-compact mode-line - (choice (const :tag "Never (nil)" :value nil) - (const :tag "Only if wider than window (long)" :value long) - (const :tag "Always (t)" :value t)) + (choice (const :tag "Never" :value nil) + (const :tag "Only if wider than window" :value long) + (const :tag "Always" :value t)) "28.1") (scroll-step windows integer) (scroll-conservatively windows integer) @@ -674,7 +676,7 @@ since it could result in memory overflow and make Emacs crash." (underline-minimum-offset display integer "23.1") (mouse-autoselect-window display (choice - (const :tag "Off (nil)" :value nil) + (const :tag "Off" :value nil) (const :tag "Immediate" :value t) (number :tag "Delay by secs" :value 0.5)) "22.1") (tool-bar-style @@ -719,15 +721,15 @@ since it could result in memory overflow and make Emacs crash." (hourglass-delay cursor number) (resize-mini-windows windows (choice - (const :tag "Off (nil)" :value nil) - (const :tag "Fit (t)" :value t) + (const :tag "Off" :value nil) + (const :tag "Fit" :value t) (const :tag "Grow only" :value grow-only)) "25.1") (display-raw-bytes-as-hex display boolean "26.1") (display-line-numbers display-line-numbers (choice - (const :tag "Off (nil)" :value nil) + (const :tag "Off" :value nil) (const :tag "Absolute line numbers" :value t) (const :tag "Relative line numbers" -- cgit v1.2.3 From 51583a0f9f75950933a342a09ea3d317a528581e Mon Sep 17 00:00:00 2001 From: martin rudalics Date: Wed, 4 Aug 2021 08:48:18 +0200 Subject: Add new user option 'read-minibuffer-restore-windows' * doc/lispref/minibuf.texi (Text from Minibuffer): Document it (bug#45072). * lisp/cus-start.el (standard): Add. * src/minibuf.c (syms_of_minibuf): New variable 'read-minibuffer-restore-windows'. --- doc/lispref/minibuf.texi | 12 ++++++++++++ etc/NEWS | 3 +++ lisp/cus-start.el | 1 + src/minibuf.c | 18 +++++++++++++++--- 4 files changed, 31 insertions(+), 3 deletions(-) (limited to 'lisp/cus-start.el') diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 196dd990767..d54c654562f 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -469,6 +469,18 @@ If @var{default} is a non-@code{nil} list, the first element of the list is used in the prompt. @end defun +@defvar read-minibuffer-restore-windows +If this option is non-@code{nil} (the default), getting input from the +minibuffer will restore, on exit, the window configurations of the frame +where the minibuffer was entered from and, if it is different, the frame +that owns the minibuffer window. This means that if, for example, a +user splits a window while getting input from the minibuffer on the same +frame, that split will be undone when exiting the minibuffer. + +If this option is @code{nil}, no such restorations are done. Hence, the +window split mentioned above will persist after exiting the minibuffer. +@end defvar + @node Object from Minibuffer @section Reading Lisp Objects with the Minibuffer @cindex minibuffer input, reading lisp objects diff --git a/etc/NEWS b/etc/NEWS index 86aeea69ca1..18cca8b4ab3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -178,6 +178,9 @@ behavior, which mixed these two, can be approximated by customizing 'minibuffer-follows-selected-frame' to a value which is neither nil nor t. ++++ +** New user option 'read-minibuffer-restore-windows'. + +++ ** New system for displaying documentation for groups of functions. This can either be used by saying 'M-x shortdoc-display-group' and diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 7df70d704ef..27b98f2d809 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -431,6 +431,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of "21.1" :set minibuffer-prompt-properties--setter) (minibuffer-auto-raise minibuffer boolean) + (read-minibuffer-restore-windows boolean "28.1") ;; options property set at end (read-buffer-function minibuffer (choice (const nil) diff --git a/src/minibuf.c b/src/minibuf.c index 0f4349e70b8..3ee0dca5e05 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -689,12 +689,15 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, call1 (Qpush_window_buffer_onto_prev, minibuf_window); record_unwind_protect_void (minibuffer_unwind); - record_unwind_protect (restore_window_configuration, - list3 (Fcurrent_window_configuration (Qnil), Qt, Qt)); + if (read_minibuffer_restore_windows) + record_unwind_protect (restore_window_configuration, + list3 (Fcurrent_window_configuration (Qnil), + Qt, Qt)); /* If the minibuffer window is on a different frame, save that frame's configuration too. */ - if (!EQ (mini_frame, selected_frame)) + if (read_minibuffer_restore_windows && + !EQ (mini_frame, selected_frame)) record_unwind_protect (restore_window_configuration, list3 (Fcurrent_window_configuration (mini_frame), Qnil, Qt)); @@ -2527,6 +2530,15 @@ for instance when running a headless Emacs server. Functions like instead. */); inhibit_interaction = 0; + DEFVAR_BOOL ("read-minibuffer-restore-windows", read_minibuffer_restore_windows, + doc: /* Non-nil means restore window configurations on exit from minibuffer. +If this is non-nil (the default), reading input with the minibuffer will +restore, on exit, the window configurations of the frame where the +minibuffer was entered from and, if it is different, the frame that owns +the associated minibuffer window. If this is nil, no such restorations +are done. */); + read_minibuffer_restore_windows = true; + defsubr (&Sactive_minibuffer_window); defsubr (&Sset_minibuffer_window); defsubr (&Sread_from_minibuffer); -- cgit v1.2.3 From 50d3178a4fa6fbfaaaeee7025e8d9ad3a070aea0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 4 Aug 2021 17:42:55 -0700 Subject: * lisp/cus-start.el (read-minibuffer-restore-windows): Fix entry. --- lisp/cus-start.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/cus-start.el') diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 27b98f2d809..19975307894 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -431,7 +431,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of "21.1" :set minibuffer-prompt-properties--setter) (minibuffer-auto-raise minibuffer boolean) - (read-minibuffer-restore-windows boolean "28.1") + (read-minibuffer-restore-windows minibuffer boolean "28.1") ;; options property set at end (read-buffer-function minibuffer (choice (const nil) -- cgit v1.2.3