From c6b68a2899a6d42c197b6c84c42eed1c6804b534 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 6 Oct 2012 22:18:03 +0800 Subject: * doc/emacs/mini.texi (Passwords): Fix typo. --- doc/emacs/ChangeLog | 4 ++++ doc/emacs/mini.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 572cc4f5532..60b3bf234f7 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2012-10-06 Chong Yidong + + * mini.texi (Passwords): Fix typo. + 2012-10-02 Glenn Morris * maintaining.texi (VC Directory Commands): diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 5d2fc804498..cb47a966f64 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -727,7 +727,7 @@ completion, and you cannot change windows or perform any other action with Emacs until you have submitted the password. While you are typing the password, you may press @key{DEL} to delete -backwards, removing the last character entered. @key{C-u} deletes +backwards, removing the last character entered. @kbd{C-u} deletes everything you have typed so far. @kbd{C-g} quits the password prompt (@pxref{Quitting}). @kbd{C-y} inserts the current kill into the password (@pxref{Killing}). You may type either @key{RET} or -- cgit v1.2.1 From 9414dd8d50cc49464c97a5cb81f38796ff1fbec1 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 6 Oct 2012 22:18:35 +0800 Subject: Move bovine-grammar and wisent-grammar into lisp/ directory. * lisp/files.el (auto-mode-alist): Add .by and .wy (Semantic grammars). * cedet/semantic/bovine/grammar.el: * cedet/semantic/wisent/grammar.el: Move from admin/grammars. Add autoloads for bovine-grammar-mode and wisent-grammar-mode. --- admin/ChangeLog | 5 + admin/grammars/bovine-grammar.el | 507 -------------------------------- admin/grammars/wisent-grammar.el | 526 ---------------------------------- lisp/ChangeLog | 4 + lisp/cedet/ChangeLog | 6 + lisp/cedet/semantic/bovine/grammar.el | 506 ++++++++++++++++++++++++++++++++ lisp/cedet/semantic/wisent/grammar.el | 526 ++++++++++++++++++++++++++++++++++ lisp/files.el | 2 + 8 files changed, 1049 insertions(+), 1033 deletions(-) delete mode 100644 admin/grammars/bovine-grammar.el delete mode 100644 admin/grammars/wisent-grammar.el create mode 100644 lisp/cedet/semantic/bovine/grammar.el create mode 100644 lisp/cedet/semantic/wisent/grammar.el diff --git a/admin/ChangeLog b/admin/ChangeLog index 2da65523116..8fe82ca36cb 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-10-01 David Engster + + * grammars/bovine-grammar.el: + * grammars/wisent-grammar.el: Move to lisp directory. + 2012-10-01 David Engster * grammars/bovine-grammar.el (bovine--grammar-newstyle-unquote): diff --git a/admin/grammars/bovine-grammar.el b/admin/grammars/bovine-grammar.el deleted file mode 100644 index a7289f6bafe..00000000000 --- a/admin/grammars/bovine-grammar.el +++ /dev/null @@ -1,507 +0,0 @@ -;;; bovine-grammar.el --- Bovine's input grammar mode -;; -;; Copyright (C) 2002-2012 Free Software Foundation, Inc. -;; -;; Author: David Ponce -;; Maintainer: David Ponce -;; Created: 26 Aug 2002 -;; Keywords: syntax - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: -;; -;; Major mode for editing Bovine's input grammar (.by) files. - -;;; History: - -;;; Code: -(require 'semantic) -(require 'semantic/grammar) -(require 'semantic/find) -(require 'semantic/lex) -(require 'semantic/wisent) -(require 'semantic/bovine) - -(defun bovine-grammar-EXPAND (bounds nonterm) - "Expand call to EXPAND grammar macro. -Return the form to parse from within a nonterminal between BOUNDS. -NONTERM is the nonterminal symbol to start with." - `(semantic-bovinate-from-nonterminal - (car ,bounds) (cdr ,bounds) ',nonterm)) - -(defun bovine-grammar-EXPANDFULL (bounds nonterm) - "Expand call to EXPANDFULL grammar macro. -Return the form to recursively parse the area between BOUNDS. -NONTERM is the nonterminal symbol to start with." - `(semantic-parse-region - (car ,bounds) (cdr ,bounds) ',nonterm 1)) - -(defun bovine-grammar-TAG (name class &rest attributes) - "Expand call to TAG grammar macro. -Return the form to create a generic semantic tag. -See the function `semantic-tag' for the meaning of arguments NAME, -CLASS and ATTRIBUTES." - `(semantic-tag ,name ,class ,@attributes)) - -(defun bovine-grammar-VARIABLE-TAG (name type default-value &rest attributes) - "Expand call to VARIABLE-TAG grammar macro. -Return the form to create a semantic tag of class variable. -See the function `semantic-tag-new-variable' for the meaning of -arguments NAME, TYPE, DEFAULT-VALUE and ATTRIBUTES." - `(semantic-tag-new-variable ,name ,type ,default-value ,@attributes)) - -(defun bovine-grammar-FUNCTION-TAG (name type arg-list &rest attributes) - "Expand call to FUNCTION-TAG grammar macro. -Return the form to create a semantic tag of class function. -See the function `semantic-tag-new-function' for the meaning of -arguments NAME, TYPE, ARG-LIST and ATTRIBUTES." - `(semantic-tag-new-function ,name ,type ,arg-list ,@attributes)) - -(defun bovine-grammar-TYPE-TAG (name type members parents &rest attributes) - "Expand call to TYPE-TAG grammar macro. -Return the form to create a semantic tag of class type. -See the function `semantic-tag-new-type' for the meaning of arguments -NAME, TYPE, MEMBERS, PARENTS and ATTRIBUTES." - `(semantic-tag-new-type ,name ,type ,members ,parents ,@attributes)) - -(defun bovine-grammar-INCLUDE-TAG (name system-flag &rest attributes) - "Expand call to INCLUDE-TAG grammar macro. -Return the form to create a semantic tag of class include. -See the function `semantic-tag-new-include' for the meaning of -arguments NAME, SYSTEM-FLAG and ATTRIBUTES." - `(semantic-tag-new-include ,name ,system-flag ,@attributes)) - -(defun bovine-grammar-PACKAGE-TAG (name detail &rest attributes) - "Expand call to PACKAGE-TAG grammar macro. -Return the form to create a semantic tag of class package. -See the function `semantic-tag-new-package' for the meaning of -arguments NAME, DETAIL and ATTRIBUTES." - `(semantic-tag-new-package ,name ,detail ,@attributes)) - -(defun bovine-grammar-CODE-TAG (name detail &rest attributes) - "Expand call to CODE-TAG grammar macro. -Return the form to create a semantic tag of class code. -See the function `semantic-tag-new-code' for the meaning of arguments -NAME, DETAIL and ATTRIBUTES." - `(semantic-tag-new-code ,name ,detail ,@attributes)) - -(defun bovine-grammar-ALIAS-TAG (name aliasclass definition &rest attributes) - "Expand call to ALIAS-TAG grammar macro. -Return the form to create a semantic tag of class alias. -See the function `semantic-tag-new-alias' for the meaning of arguments -NAME, ALIASCLASS, DEFINITION and ATTRIBUTES." - `(semantic-tag-new-alias ,name ,aliasclass ,definition ,@attributes)) - -;; Cache of macro definitions currently in use. -(defvar bovine--grammar-macros nil) - -(defun bovine-grammar-expand-form (form quotemode &optional inplace) - "Expand FORM into a new one suitable to the bovine parser. -FORM is a list in which we are substituting. -Argument QUOTEMODE is non-nil if we are in backquote mode. -When non-nil, optional argument INPLACE indicates that FORM is being -expanded from elsewhere." - (when (eq (car form) 'quote) - (setq form (cdr form)) - (cond - ((and (= (length form) 1) (listp (car form))) - (insert "\n(append") - (bovine-grammar-expand-form (car form) quotemode nil) - (insert ")") - (setq form nil inplace nil) - ) - ((and (= (length form) 1) (symbolp (car form))) - (insert "\n'" (symbol-name (car form))) - (setq form nil inplace nil) - ) - (t - (insert "\n(list") - (setq inplace t) - ))) - (let ((macro (assq (car form) bovine--grammar-macros)) - inlist first n q x) - (if macro - (bovine-grammar-expand-form - (apply (cdr macro) (cdr form)) - quotemode t) - (if inplace (insert "\n(")) - (while form - (setq first (car form) - form (cdr form)) - ;; Hack for dealing with new reading of unquotes outside of - ;; backquote (introduced in rev. 102591 in emacs-bzr). - (when (and (>= emacs-major-version 24) - (listp first) - (or (equal (car first) '\,) - (equal (car first) '\,@))) - (if (listp (cadr first)) - (setq form (append (cdr first) form) - first (car first)) - (setq first (intern (concat (symbol-name (car first)) - (symbol-name (cadr first))))))) - (cond - ((eq first nil) - (when (and (not inlist) (not inplace)) - (insert "\n(list") - (setq inlist t)) - (insert " nil") - ) - ((listp first) - ;;(let ((fn (and (symbolp (caar form)) (fboundp (caar form))))) - (when (and (not inlist) (not inplace)) - (insert "\n(list") - (setq inlist t)) - ;;(if (and inplace (not fn) (not (eq (caar form) 'EXPAND))) - ;; (insert " (append")) - (bovine-grammar-expand-form - first quotemode t) ;;(and fn (not (eq fn 'quote)))) - ;;(if (and inplace (not fn) (not (eq (caar form) 'EXPAND))) - ;; (insert ")")) - ;;) - ) - ((symbolp first) - (setq n (symbol-name first) ;the name - q quotemode ;implied quote flag - x nil) ;expand flag - (if (eq (aref n 0) ?,) - (if quotemode - ;; backquote mode needs the @ - (if (eq (aref n 1) ?@) - (setq n (substring n 2) - q nil - x t) - ;; non backquote mode behaves normally. - (setq n (substring n 1) - q nil)) - (setq n (substring n 1) - x t))) - (if (string= n "") - (progn - ;; We expand only the next item in place (a list?) - ;; A regular inline-list... - (bovine-grammar-expand-form (car form) quotemode t) - (setq form (cdr form))) - (if (and (eq (aref n 0) ?$) - ;; Don't expand $ tokens in implied quote mode. - ;; This acts like quoting in other symbols. - (not q)) - (progn - (cond - ((and (not x) (not inlist) (not inplace)) - (insert "\n(list")) - ((and x inlist (not inplace)) - (insert ")") - (setq inlist nil))) - (insert "\n(nth " (int-to-string - (1- (string-to-number - (substring n 1)))) - " vals)") - (and (not x) (not inplace) - (setq inlist t))) - - (when (and (not inlist) (not inplace)) - (insert "\n(list") - (setq inlist t)) - (or (char-equal (char-before) ?\() - (insert " ")) - (insert (if (or inplace (eq first t)) - "" "'") - n))) ;; " " - ) - (t - (when (and (not inlist) (not inplace)) - (insert "\n(list") - (setq inlist t)) - (insert (format "\n%S" first)) - ) - )) - (if inlist (insert ")")) - (if inplace (insert ")"))) - )) - -(defun bovine-grammar-expand-action (textform quotemode) - "Expand semantic action string TEXTFORM into Lisp code. -QUOTEMODE is the mode in which quoted symbols are slurred." - (if (string= "" textform) - nil - (let ((sexp (read textform))) - ;; We converted the lambda string into a list. Now write it - ;; out as the bovine lambda expression, and do macro-like - ;; conversion upon it. - (insert "\n") - (cond - ((eq (car sexp) 'EXPAND) - (insert ",(lambda (vals start end)") - ;; The EXPAND macro definition is mandatory - (bovine-grammar-expand-form - (apply (cdr (assq 'EXPAND bovine--grammar-macros)) (cdr sexp)) - quotemode t) - ) - ((and (listp (car sexp)) (eq (caar sexp) 'EVAL)) - ;; The user wants to evaluate the following args. - ;; Use a simpler expander - ) - (t - (insert ",(semantic-lambda") - (bovine-grammar-expand-form sexp quotemode) - )) - (insert ")\n"))) -) - -(defun bovine-grammar-parsetable-builder () - "Return the parser table expression as a string value. -The format of a bovine parser table is: - - ( ( NONTERMINAL-SYMBOL1 MATCH-LIST1 ) - ( NONTERMINAL-SYMBOL2 MATCH-LIST2 ) - ... - ( NONTERMINAL-SYMBOLn MATCH-LISTn ) - -Where each NONTERMINAL-SYMBOL is an artificial symbol which can appear -in any child state. As a starting place, one of the NONTERMINAL-SYMBOLS -must be `bovine-toplevel'. - -A MATCH-LIST is a list of possible matches of the form: - - ( STATE-LIST1 - STATE-LIST2 - ... - STATE-LISTN ) - -where STATE-LIST is of the form: - ( TYPE1 [ \"VALUE1\" ] TYPE2 [ \"VALUE2\" ] ... LAMBDA ) - -where TYPE is one of the returned types of the token stream. -VALUE is a value, or range of values to match against. For -example, a SYMBOL might need to match \"foo\". Some TYPES will not -have matching criteria. - -LAMBDA is a lambda expression which is evalled with the text of the -type when it is found. It is passed the list of all buffer text -elements found since the last lambda expression. It should return a -semantic element (see below.) - -For consistency between languages, try to use common return values -from your parser. Please reference the chapter \"Writing Parsers\" in -the \"Language Support Developer's Guide -\" in the semantic texinfo -manual." - (let* ((start (semantic-grammar-start)) - (scopestart (semantic-grammar-scopestart)) - (quotemode (semantic-grammar-quotemode)) - (tags (semantic-find-tags-by-class - 'token (current-buffer))) - (nterms (semantic-find-tags-by-class - 'nonterminal (current-buffer))) - ;; Setup the cache of macro definitions. - (bovine--grammar-macros (semantic-grammar-macros)) - nterm rules items item actn prec tag type regex) - - ;; Check some trivial things - (cond - ((null nterms) - (error "Bad input grammar")) - (start - (if (cdr start) - (message "Extra start symbols %S ignored" (cdr start))) - (setq start (symbol-name (car start))) - (unless (semantic-find-first-tag-by-name start nterms) - (error "start symbol `%s' has no rule" start))) - (t - ;; Default to the first grammar rule. - (setq start (semantic-tag-name (car nterms))))) - (when scopestart - (setq scopestart (symbol-name scopestart)) - (unless (semantic-find-first-tag-by-name scopestart nterms) - (error "scopestart symbol `%s' has no rule" scopestart))) - - ;; Generate the grammar Lisp form. - (with-temp-buffer - (erase-buffer) - (insert "`(") - ;; Insert the start/scopestart rules - (insert "\n(bovine-toplevel \n(" - start - ")\n) ;; end bovine-toplevel\n") - (when scopestart - (insert "\n(bovine-inner-scope \n(" - scopestart - ")\n) ;; end bovine-inner-scope\n")) - ;; Process each nonterminal - (while nterms - (setq nterm (car nterms) - ;; We can't use the override form because the current buffer - ;; is not the originator of the tag. - rules (semantic-tag-components-semantic-grammar-mode nterm) - nterm (semantic-tag-name nterm) - nterms (cdr nterms)) - (when (member nterm '("bovine-toplevel" "bovine-inner-scope")) - (error "`%s' is a reserved internal name" nterm)) - (insert "\n(" nterm) - ;; Process each rule - (while rules - (setq items (semantic-tag-get-attribute (car rules) :value) - prec (semantic-tag-get-attribute (car rules) :prec) - actn (semantic-tag-get-attribute (car rules) :expr) - rules (cdr rules)) - ;; Process each item - (insert "\n(") - (if (null items) - ;; EMPTY rule - (insert ";;EMPTY" (if actn "" "\n")) - ;; Expand items - (while items - (setq item (car items) - items (cdr items)) - (if (consp item) ;; mid-rule action - (message "Mid-rule action %S ignored" item) - (or (char-equal (char-before) ?\() - (insert "\n")) - (cond - ((member item '("bovine-toplevel" "bovine-inner-scope")) - (error "`%s' is a reserved internal name" item)) - ;; Replace ITEM by its %token definition. - ;; If a '%token TYPE ITEM [REGEX]' definition exists - ;; in the grammar, ITEM is replaced by TYPE [REGEX]. - ((setq tag (semantic-find-first-tag-by-name - item tags) - type (semantic-tag-get-attribute tag :type)) - (insert type) - (if (setq regex (semantic-tag-get-attribute tag :value)) - (insert (format "\n%S" regex)))) - ;; Don't change ITEM - (t - (insert (semantic-grammar-item-text item))) - )))) - (if prec - (message "%%prec %S ignored" prec)) - (if actn - (bovine-grammar-expand-action actn quotemode)) - (insert ")")) - (insert "\n) ;; end " nterm "\n")) - (insert ")\n") - (buffer-string)))) - -(defun bovine-grammar-setupcode-builder () - "Return the text of the setup code." - (format - "(setq semantic--parse-table %s\n\ - semantic-debug-parser-source %S\n\ - semantic-debug-parser-class 'semantic-bovine-debug-parser - semantic-flex-keywords-obarray %s\n\ - %s)" - (semantic-grammar-parsetable) - (buffer-name) - (semantic-grammar-keywordtable) - (let ((mode (semantic-grammar-languagemode))) - ;; Is there more than one major mode? - (if (and (listp mode) (> (length mode) 1)) - (format "semantic-equivalent-major-modes '%S\n" mode) - "")))) - -(defvar bovine-grammar-menu - '("BY Grammar" - ) - "BY mode specific grammar menu. -Menu items are appended to the common grammar menu.") - -(define-derived-mode bovine-grammar-mode semantic-grammar-mode "BY" - "Major mode for editing Bovine grammars." - (semantic-grammar-setup-menu bovine-grammar-menu) - (semantic-install-function-overrides - '((grammar-parsetable-builder . bovine-grammar-parsetable-builder) - (grammar-setupcode-builder . bovine-grammar-setupcode-builder) - ))) - -(add-to-list 'auto-mode-alist '("\\.by\\'" . bovine-grammar-mode)) - -(defvar-mode-local bovine-grammar-mode semantic-grammar-macros - '( - (ASSOC . semantic-grammar-ASSOC) - (EXPAND . bovine-grammar-EXPAND) - (EXPANDFULL . bovine-grammar-EXPANDFULL) - (TAG . bovine-grammar-TAG) - (VARIABLE-TAG . bovine-grammar-VARIABLE-TAG) - (FUNCTION-TAG . bovine-grammar-FUNCTION-TAG) - (TYPE-TAG . bovine-grammar-TYPE-TAG) - (INCLUDE-TAG . bovine-grammar-INCLUDE-TAG) - (PACKAGE-TAG . bovine-grammar-PACKAGE-TAG) - (CODE-TAG . bovine-grammar-CODE-TAG) - (ALIAS-TAG . bovine-grammar-ALIAS-TAG) - ) - "Semantic grammar macros used in bovine grammars.") - -(provide 'semantic/bovine/grammar) - -(defun bovine-make-parsers () - "Generate Emacs' built-in Bovine-based parser files." - (interactive) - (semantic-mode 1) - ;; Loop through each .by file in current directory, and run - ;; `semantic-grammar-batch-build-one-package' to build the grammar. - (dolist (f (directory-files default-directory nil "\\.by\\'")) - (let ((packagename - (condition-case err - (with-current-buffer (find-file-noselect f) - (semantic-grammar-create-package)) - (error (message "%s" (error-message-string err)) nil))) - lang filename) - (when (and packagename - (string-match "^.*/\\(.*\\)-by\\.el\\'" packagename)) - (setq lang (match-string 1 packagename)) - (setq filename (concat lang "-by.el")) - (with-temp-buffer - (insert-file-contents filename) - (setq buffer-file-name (expand-file-name filename)) - ;; Fix copyright header: - (goto-char (point-min)) - (re-search-forward "^;; Author:") - (setq copyright-end (match-beginning 0)) - (re-search-forward "^;;; Code:\n") - (delete-region copyright-end (match-end 0)) - (goto-char copyright-end) - (insert ";; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: -;; -;; This file was generated from admin/grammars/" - lang ".by. - -;;; Code: -") - (goto-char (point-min)) - (delete-region (point-min) (line-end-position)) - (insert ";;; " packagename - " --- Generated parser support file") - (delete-trailing-whitespace) - (re-search-forward ";;; \\(.*\\) ends here") - (replace-match packagename nil nil nil 1) - (save-buffer)))))) - -;;; bovine-grammar.el ends here diff --git a/admin/grammars/wisent-grammar.el b/admin/grammars/wisent-grammar.el deleted file mode 100644 index 25dba5be2d8..00000000000 --- a/admin/grammars/wisent-grammar.el +++ /dev/null @@ -1,526 +0,0 @@ -;;; wisent-grammar.el --- Wisent's input grammar mode - -;; Copyright (C) 2002-2012 Free Software Foundation, Inc. -;; -;; Author: David Ponce -;; Maintainer: David Ponce -;; Created: 26 Aug 2002 -;; Keywords: syntax -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: -;; -;; Major mode for editing Wisent's input grammar (.wy) files. - -;;; Code: -(require 'semantic) -(require 'semantic/grammar) -(require 'semantic/find) -(require 'semantic/lex) -(require 'semantic/wisent) -(require 'semantic/bovine) - -(defsubst wisent-grammar-region-placeholder (symb) - "Given a $N placeholder symbol in SYMB, return a $regionN symbol. -Return nil if $N is not a valid placeholder symbol." - (let ((n (symbol-name symb))) - (if (string-match "^[$]\\([1-9][0-9]*\\)$" n) - (intern (concat "$region" (match-string 1 n)))))) - -(defun wisent-grammar-EXPAND (symb nonterm) - "Expand call to EXPAND grammar macro. -Return the form to parse from within a nonterminal. -SYMB is a $I placeholder symbol that gives the bounds of the area to -parse. -NONTERM is the nonterminal symbol to start with." - (unless (member nonterm (semantic-grammar-start)) - (error "EXPANDFULL macro called with %s, but not used with %%start" - nonterm)) - (let (($ri (wisent-grammar-region-placeholder symb))) - (if $ri - `(semantic-bovinate-from-nonterminal - (car ,$ri) (cdr ,$ri) ',nonterm) - (error "Invalid form (EXPAND %s %s)" symb nonterm)))) - -(defun wisent-grammar-EXPANDFULL (symb nonterm) - "Expand call to EXPANDFULL grammar macro. -Return the form to recursively parse an area. -SYMB is a $I placeholder symbol that gives the bounds of the area. -NONTERM is the nonterminal symbol to start with." - (unless (member nonterm (semantic-grammar-start)) - (error "EXPANDFULL macro called with %s, but not used with %%start" - nonterm)) - (let (($ri (wisent-grammar-region-placeholder symb))) - (if $ri - `(semantic-parse-region - (car ,$ri) (cdr ,$ri) ',nonterm 1) - (error "Invalid form (EXPANDFULL %s %s)" symb nonterm)))) - -(defun wisent-grammar-TAG (name class &rest attributes) - "Expand call to TAG grammar macro. -Return the form to create a generic semantic tag. -See the function `semantic-tag' for the meaning of arguments NAME, -CLASS and ATTRIBUTES." - `(wisent-raw-tag - (semantic-tag ,name ,class ,@attributes))) - -(defun wisent-grammar-VARIABLE-TAG (name type default-value &rest attributes) - "Expand call to VARIABLE-TAG grammar macro. -Return the form to create a semantic tag of class variable. -See the function `semantic-tag-new-variable' for the meaning of -arguments NAME, TYPE, DEFAULT-VALUE and ATTRIBUTES." - `(wisent-raw-tag - (semantic-tag-new-variable ,name ,type ,default-value ,@attributes))) - -(defun wisent-grammar-FUNCTION-TAG (name type arg-list &rest attributes) - "Expand call to FUNCTION-TAG grammar macro. -Return the form to create a semantic tag of class function. -See the function `semantic-tag-new-function' for the meaning of -arguments NAME, TYPE, ARG-LIST and ATTRIBUTES." - `(wisent-raw-tag - (semantic-tag-new-function ,name ,type ,arg-list ,@attributes))) - -(defun wisent-grammar-TYPE-TAG (name type members parents &rest attributes) - "Expand call to TYPE-TAG grammar macro. -Return the form to create a semantic tag of class type. -See the function `semantic-tag-new-type' for the meaning of arguments -NAME, TYPE, MEMBERS, PARENTS and ATTRIBUTES." - `(wisent-raw-tag - (semantic-tag-new-type ,name ,type ,members ,parents ,@attributes))) - -(defun wisent-grammar-INCLUDE-TAG (name system-flag &rest attributes) - "Expand call to INCLUDE-TAG grammar macro. -Return the form to create a semantic tag of class include. -See the function `semantic-tag-new-include' for the meaning of -arguments NAME, SYSTEM-FLAG and ATTRIBUTES." - `(wisent-raw-tag - (semantic-tag-new-include ,name ,system-flag ,@attributes))) - -(defun wisent-grammar-PACKAGE-TAG (name detail &rest attributes) - "Expand call to PACKAGE-TAG grammar macro. -Return the form to create a semantic tag of class package. -See the function `semantic-tag-new-package' for the meaning of -arguments NAME, DETAIL and ATTRIBUTES." - `(wisent-raw-tag - (semantic-tag-new-package ,name ,detail ,@attributes))) - -(defun wisent-grammar-CODE-TAG (name detail &rest attributes) - "Expand call to CODE-TAG grammar macro. -Return the form to create a semantic tag of class code. -See the function `semantic-tag-new-code' for the meaning of arguments -NAME, DETAIL and ATTRIBUTES." - `(wisent-raw-tag - (semantic-tag-new-code ,name ,detail ,@attributes))) - -(defun wisent-grammar-ALIAS-TAG (name aliasclass definition &rest attributes) - "Expand call to ALIAS-TAG grammar macro. -Return the form to create a semantic tag of class alias. -See the function `semantic-tag-new-alias' for the meaning of arguments -NAME, ALIASCLASS, DEFINITION and ATTRIBUTES." - `(wisent-raw-tag - (semantic-tag-new-alias ,name ,aliasclass ,definition ,@attributes))) - -(defun wisent-grammar-EXPANDTAG (raw-tag) - "Expand call to EXPANDTAG grammar macro. -Return the form to produce a list of cooked tags from raw form of -Semantic tag RAW-TAG." - `(wisent-cook-tag ,raw-tag)) - -(defun wisent-grammar-AST-ADD (ast &rest nodes) - "Expand call to AST-ADD grammar macro. -Return the form to update the abstract syntax tree AST with NODES. -See also the function `semantic-ast-add'." - `(semantic-ast-add ,ast ,@nodes)) - -(defun wisent-grammar-AST-PUT (ast &rest nodes) - "Expand call to AST-PUT grammar macro. -Return the form to update the abstract syntax tree AST with NODES. -See also the function `semantic-ast-put'." - `(semantic-ast-put ,ast ,@nodes)) - -(defun wisent-grammar-AST-GET (ast node) - "Expand call to AST-GET grammar macro. -Return the form to get, from the abstract syntax tree AST, the value -of NODE. -See also the function `semantic-ast-get'." - `(semantic-ast-get ,ast ,node)) - -(defun wisent-grammar-AST-GET1 (ast node) - "Expand call to AST-GET1 grammar macro. -Return the form to get, from the abstract syntax tree AST, the first -value of NODE. -See also the function `semantic-ast-get1'." - `(semantic-ast-get1 ,ast ,node)) - -(defun wisent-grammar-AST-GET-STRING (ast node) - "Expand call to AST-GET-STRING grammar macro. -Return the form to get, from the abstract syntax tree AST, the value -of NODE as a string. -See also the function `semantic-ast-get-string'." - `(semantic-ast-get-string ,ast ,node)) - -(defun wisent-grammar-AST-MERGE (ast1 ast2) - "Expand call to AST-MERGE grammar macro. -Return the form to merge the abstract syntax trees AST1 and AST2. -See also the function `semantic-ast-merge'." - `(semantic-ast-merge ,ast1 ,ast2)) - -(defun wisent-grammar-SKIP-BLOCK (&optional symb) - "Expand call to SKIP-BLOCK grammar macro. -Return the form to skip a parenthesized block. -Optional argument SYMB is a $I placeholder symbol that gives the -bounds of the block to skip. By default, skip the block at `$1'. -See also the function `wisent-skip-block'." - (let ($ri) - (when symb - (unless (setq $ri (wisent-grammar-region-placeholder symb)) - (error "Invalid form (SKIP-BLOCK %s)" symb))) - `(wisent-skip-block ,$ri))) - -(defun wisent-grammar-SKIP-TOKEN () - "Expand call to SKIP-TOKEN grammar macro. -Return the form to skip the lookahead token. -See also the function `wisent-skip-token'." - `(wisent-skip-token)) - -(defun wisent-grammar-assocs () - "Return associativity and precedence level definitions." - (mapcar - #'(lambda (tag) - (cons (intern (semantic-tag-name tag)) - (mapcar #'semantic-grammar-item-value - (semantic-tag-get-attribute tag :value)))) - (semantic-find-tags-by-class 'assoc (current-buffer)))) - -(defun wisent-grammar-terminals () - "Return the list of terminal symbols. -Keep order of declaration in the WY file without duplicates." - (let (terms) - (mapc - #'(lambda (tag) - (mapcar #'(lambda (name) - (add-to-list 'terms (intern name))) - (cons (semantic-tag-name tag) - (semantic-tag-get-attribute tag :rest)))) - (semantic--find-tags-by-function - #'(lambda (tag) - (memq (semantic-tag-class tag) '(token keyword))) - (current-buffer))) - (nreverse terms))) - -;; Cache of macro definitions currently in use. -(defvar wisent--grammar-macros nil) - -(defun wisent-grammar-expand-macros (expr) - "Expand expression EXPR into a form without grammar macros. -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)) - (macro (assq (car expr) wisent--grammar-macros))) - (if macro ;; Expand Semantic built-in. - (apply (cdr macro) (cdr expr)) - expr)))) - -(defun wisent-grammar-nonterminals () - "Return the list form of nonterminal definitions." - (let ((nttags (semantic-find-tags-by-class - 'nonterminal (current-buffer))) - ;; Setup the cache of macro definitions. - (wisent--grammar-macros (semantic-grammar-macros)) - rltags nterms rules rule elems elem actn sexp prec) - (while nttags - (setq rltags (semantic-tag-components (car nttags)) - rules nil) - (while rltags - (setq elems (semantic-tag-get-attribute (car rltags) :value) - prec (semantic-tag-get-attribute (car rltags) :prec) - actn (semantic-tag-get-attribute (car rltags) :expr) - rule nil) - (when elems ;; not an EMPTY rule - (while elems - (setq elem (car elems) - elems (cdr elems)) - (setq elem (if (consp elem) ;; mid-rule action - (wisent-grammar-expand-macros (read (car elem))) - (semantic-grammar-item-value elem)) ;; item - rule (cons elem rule))) - (setq rule (nreverse rule))) - (if prec - (setq prec (vector (semantic-grammar-item-value prec)))) - (if actn - (setq sexp (wisent-grammar-expand-macros (read actn)))) - (setq rule (if actn - (if prec - (list rule prec sexp) - (list rule sexp)) - (if prec - (list rule prec) - (list rule)))) - (setq rules (cons rule rules) - rltags (cdr rltags))) - (setq nterms (cons (cons (intern (semantic-tag-name (car nttags))) - (nreverse rules)) - nterms) - nttags (cdr nttags))) - (nreverse nterms))) - -(defun wisent-grammar-grammar () - "Return Elisp form of the grammar." - (let* ((terminals (wisent-grammar-terminals)) - (nonterminals (wisent-grammar-nonterminals)) - (assocs (wisent-grammar-assocs))) - (cons terminals (cons assocs nonterminals)))) - -(defun wisent-grammar-parsetable-builder () - "Return the value of the parser table." - `(progn - ;; Ensure that the grammar [byte-]compiler is available. - (eval-when-compile (require 'semantic/wisent/comp)) - (wisent-compile-grammar - ',(wisent-grammar-grammar) - ',(semantic-grammar-start)))) - -(defun wisent-grammar-setupcode-builder () - "Return the parser setup code." - (format - "(semantic-install-function-overrides\n\ - '((parse-stream . wisent-parse-stream)))\n\ - (setq semantic-parser-name \"LALR\"\n\ - semantic--parse-table %s\n\ - semantic-debug-parser-source %S\n\ - semantic-flex-keywords-obarray %s\n\ - semantic-lex-types-obarray %s)\n\ - ;; Collect unmatched syntax lexical tokens\n\ - (semantic-make-local-hook 'wisent-discarding-token-functions)\n\ - (add-hook 'wisent-discarding-token-functions\n\ - 'wisent-collect-unmatched-syntax nil t)" - (semantic-grammar-parsetable) - (buffer-name) - (semantic-grammar-keywordtable) - (semantic-grammar-tokentable))) - -(defvar wisent-grammar-menu - '("WY Grammar" - ["LALR Compiler Verbose" wisent-toggle-verbose-flag - :style toggle :active (boundp 'wisent-verbose-flag) - :selected (and (boundp 'wisent-verbose-flag) - wisent-verbose-flag)] - ) - "WY mode specific grammar menu. -Menu items are appended to the common grammar menu.") - -(define-derived-mode wisent-grammar-mode semantic-grammar-mode "WY" - "Major mode for editing Wisent grammars." - (semantic-grammar-setup-menu wisent-grammar-menu) - (semantic-install-function-overrides - '((grammar-parsetable-builder . wisent-grammar-parsetable-builder) - (grammar-setupcode-builder . wisent-grammar-setupcode-builder) - ))) - -(add-to-list 'auto-mode-alist '("\\.wy\\'" . wisent-grammar-mode)) - -(defvar-mode-local wisent-grammar-mode semantic-grammar-macros - '( - (ASSOC . semantic-grammar-ASSOC) - (EXPAND . wisent-grammar-EXPAND) - (EXPANDFULL . wisent-grammar-EXPANDFULL) - (TAG . wisent-grammar-TAG) - (VARIABLE-TAG . wisent-grammar-VARIABLE-TAG) - (FUNCTION-TAG . wisent-grammar-FUNCTION-TAG) - (TYPE-TAG . wisent-grammar-TYPE-TAG) - (INCLUDE-TAG . wisent-grammar-INCLUDE-TAG) - (PACKAGE-TAG . wisent-grammar-PACKAGE-TAG) - (EXPANDTAG . wisent-grammar-EXPANDTAG) - (CODE-TAG . wisent-grammar-CODE-TAG) - (ALIAS-TAG . wisent-grammar-ALIAS-TAG) - (AST-ADD . wisent-grammar-AST-ADD) - (AST-PUT . wisent-grammar-AST-PUT) - (AST-GET . wisent-grammar-AST-GET) - (AST-GET1 . wisent-grammar-AST-GET1) - (AST-GET-STRING . wisent-grammar-AST-GET-STRING) - (AST-MERGE . wisent-grammar-AST-MERGE) - (SKIP-BLOCK . wisent-grammar-SKIP-BLOCK) - (SKIP-TOKEN . wisent-grammar-SKIP-TOKEN) - ) - "Semantic grammar macros used in wisent grammars.") - -(defvar wisent-make-parsers--emacs-license - ";; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see .") - -(defvar wisent-make-parsers--python-license - ";; It is derived in part from the Python grammar, used under the -;; following license: -;; -;; PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 -;; -------------------------------------------- -;; 1. This LICENSE AGREEMENT is between the Python Software Foundation -;; (\"PSF\"), and the Individual or Organization (\"Licensee\") accessing -;; and otherwise using this software (\"Python\") in source or binary -;; form and its associated documentation. -;; -;; 2. Subject to the terms and conditions of this License Agreement, -;; PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide -;; license to reproduce, analyze, test, perform and/or display -;; publicly, prepare derivative works, distribute, and otherwise use -;; Python alone or in any derivative version, provided, however, that -;; PSF's License Agreement and PSF's notice of copyright, i.e., -;; \"Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -;; 2009, 2010 Python Software Foundation; All Rights Reserved\" are -;; retained in Python alone or in any derivative version prepared by -;; Licensee. -;; -;; 3. In the event Licensee prepares a derivative work that is based -;; on or incorporates Python or any part thereof, and wants to make -;; the derivative work available to others as provided herein, then -;; Licensee hereby agrees to include in any such work a brief summary -;; of the changes made to Python. -;; -;; 4. PSF is making Python available to Licensee on an \"AS IS\" -;; basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -;; IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -;; DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -;; FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT -;; INFRINGE ANY THIRD PARTY RIGHTS. -;; -;; 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -;; FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A -;; RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR -;; ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. -;; -;; 6. This License Agreement will automatically terminate upon a -;; material breach of its terms and conditions. -;; -;; 7. Nothing in this License Agreement shall be deemed to create any -;; relationship of agency, partnership, or joint venture between PSF -;; and Licensee. This License Agreement does not grant permission to -;; use PSF trademarks or trade name in a trademark sense to endorse or -;; promote products or services of Licensee, or any third party. -;; -;; 8. By copying, installing or otherwise using Python, Licensee -;; agrees to be bound by the terms and conditions of this License -;; Agreement.") - -(defvar wisent-make-parsers--ecmascript-license - "\n;; It is derived from the grammar in the ECMAScript Language -;; Specification published at -;; -;; http://www.ecma-international.org/publications/standards/Ecma-262.htm -;; -;; and redistributed under the following license: -;; -;; Redistribution and use in source and binary forms, with or without -;; modification, are permitted provided that the following conditions -;; are met: -;; -;; 1. Redistributions of source code must retain the above copyright -;; notice, this list of conditions and the following disclaimer. -;; -;; 2. Redistributions in binary form must reproduce the above -;; copyright notice, this list of conditions and the following -;; disclaimer in the documentation and/or other materials provided -;; with the distribution. -;; -;; 3. Neither the name of the authors nor Ecma International may be -;; used to endorse or promote products derived from this software -;; without specific prior written permission. THIS SOFTWARE IS -;; PROVIDED BY THE ECMA INTERNATIONAL \"AS IS\" AND ANY EXPRESS OR -;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -;; ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR -;; ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -;; OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -;; DAMAGE.") - -(defvar wisent-make-parsers--parser-file-name - `(("semantic/grammar-wy.el") - ("srecode/srt-wy.el") - ("semantic/wisent/js-wy.el" - "Copyright (C) 1998-2011 Ecma International." - ,wisent-make-parsers--ecmascript-license) - ("semantic/wisent/javat-wy.el") - ("semantic/wisent/python-wy.el" - "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -\;; 2009, 2010 Python Software Foundation; All Rights Reserved" - ,wisent-make-parsers--python-license))) - -(defun wisent-make-parsers () - "Generate Emacs' built-in Wisent-based parser files." - (interactive) - (semantic-mode 1) - ;; Loop through each .wy file in current directory, and run - ;; `semantic-grammar-batch-build-one-package' to build the grammar. - (dolist (f (directory-files default-directory nil "\\.wy\\'")) - (let ((packagename - (condition-case err - (with-current-buffer (find-file-noselect f) - (semantic-grammar-create-package)) - (error (message "%s" (error-message-string err)) nil))) - output-data) - (when (setq output-data (assoc packagename wisent-make-parsers--parser-file-name)) - (let ((additional-copyright (nth 1 output-data)) - (additional-license (nth 2 output-data)) - (filename (progn (string-match ".*/\\(.*\\)" packagename) (match-string 1 packagename))) - copyright-end) - ;; Touch up the generated parsers for Emacs integration. - (with-temp-buffer - (insert-file-contents filename) - ;; Fix copyright header: - (goto-char (point-min)) - (when additional-copyright - (re-search-forward "Copyright (C).*$") - (insert "\n;; " additional-copyright)) - (re-search-forward "^;; Author:") - (setq copyright-end (match-beginning 0)) - (re-search-forward "^;;; Code:\n") - (delete-region copyright-end (match-end 0)) - (goto-char copyright-end) - (insert wisent-make-parsers--emacs-license) - (insert "\n\n;;; Commentary: -;; -;; This file was generated from admin/grammars/" - f ".") - (when additional-license - (insert "\n" additional-license)) - (insert "\n\n;;; Code:\n") - (goto-char (point-min)) - (delete-region (point-min) (line-end-position)) - (insert ";;; " packagename - " --- Generated parser support file") - (re-search-forward ";;; \\(.*\\) ends here") - (replace-match packagename nil nil nil 1) - (delete-trailing-whitespace) - (write-region nil nil (expand-file-name filename)))))))) - -;;; wisent-grammar.el ends here diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 87b54707e0a..5d93a386a21 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-06 Chong Yidong + + * files.el (auto-mode-alist): Add .by and .wy (Semantic grammars). + 2012-10-06 Ikumi Keita (tiny change) * international/characters.el: Fix simple mistake ((car chars) -> diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index e066368d011..9e20b4fbb4e 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,3 +1,9 @@ +2012-10-06 Chong Yidong + + * semantic/bovine/grammar.el: + * semantic/wisent/grammar.el: Move from admin/grammars. Add + autoloads for bovine-grammar-mode and wisent-grammar-mode. + 2012-10-02 Chong Yidong * srecode.el, ede.el: Restore Version header. diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el new file mode 100644 index 00000000000..cc27c5b0646 --- /dev/null +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -0,0 +1,506 @@ +;;; semantic/bovine/grammar.el --- Bovine's input grammar mode +;; +;; Copyright (C) 2002-2012 Free Software Foundation, Inc. +;; +;; Author: David Ponce +;; Maintainer: David Ponce +;; Created: 26 Aug 2002 +;; Keywords: syntax + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; +;; Major mode for editing Bovine's input grammar (.by) files. + +;;; History: + +;;; Code: +(require 'semantic) +(require 'semantic/grammar) +(require 'semantic/find) +(require 'semantic/lex) +(require 'semantic/wisent) +(require 'semantic/bovine) + +(defun bovine-grammar-EXPAND (bounds nonterm) + "Expand call to EXPAND grammar macro. +Return the form to parse from within a nonterminal between BOUNDS. +NONTERM is the nonterminal symbol to start with." + `(semantic-bovinate-from-nonterminal + (car ,bounds) (cdr ,bounds) ',nonterm)) + +(defun bovine-grammar-EXPANDFULL (bounds nonterm) + "Expand call to EXPANDFULL grammar macro. +Return the form to recursively parse the area between BOUNDS. +NONTERM is the nonterminal symbol to start with." + `(semantic-parse-region + (car ,bounds) (cdr ,bounds) ',nonterm 1)) + +(defun bovine-grammar-TAG (name class &rest attributes) + "Expand call to TAG grammar macro. +Return the form to create a generic semantic tag. +See the function `semantic-tag' for the meaning of arguments NAME, +CLASS and ATTRIBUTES." + `(semantic-tag ,name ,class ,@attributes)) + +(defun bovine-grammar-VARIABLE-TAG (name type default-value &rest attributes) + "Expand call to VARIABLE-TAG grammar macro. +Return the form to create a semantic tag of class variable. +See the function `semantic-tag-new-variable' for the meaning of +arguments NAME, TYPE, DEFAULT-VALUE and ATTRIBUTES." + `(semantic-tag-new-variable ,name ,type ,default-value ,@attributes)) + +(defun bovine-grammar-FUNCTION-TAG (name type arg-list &rest attributes) + "Expand call to FUNCTION-TAG grammar macro. +Return the form to create a semantic tag of class function. +See the function `semantic-tag-new-function' for the meaning of +arguments NAME, TYPE, ARG-LIST and ATTRIBUTES." + `(semantic-tag-new-function ,name ,type ,arg-list ,@attributes)) + +(defun bovine-grammar-TYPE-TAG (name type members parents &rest attributes) + "Expand call to TYPE-TAG grammar macro. +Return the form to create a semantic tag of class type. +See the function `semantic-tag-new-type' for the meaning of arguments +NAME, TYPE, MEMBERS, PARENTS and ATTRIBUTES." + `(semantic-tag-new-type ,name ,type ,members ,parents ,@attributes)) + +(defun bovine-grammar-INCLUDE-TAG (name system-flag &rest attributes) + "Expand call to INCLUDE-TAG grammar macro. +Return the form to create a semantic tag of class include. +See the function `semantic-tag-new-include' for the meaning of +arguments NAME, SYSTEM-FLAG and ATTRIBUTES." + `(semantic-tag-new-include ,name ,system-flag ,@attributes)) + +(defun bovine-grammar-PACKAGE-TAG (name detail &rest attributes) + "Expand call to PACKAGE-TAG grammar macro. +Return the form to create a semantic tag of class package. +See the function `semantic-tag-new-package' for the meaning of +arguments NAME, DETAIL and ATTRIBUTES." + `(semantic-tag-new-package ,name ,detail ,@attributes)) + +(defun bovine-grammar-CODE-TAG (name detail &rest attributes) + "Expand call to CODE-TAG grammar macro. +Return the form to create a semantic tag of class code. +See the function `semantic-tag-new-code' for the meaning of arguments +NAME, DETAIL and ATTRIBUTES." + `(semantic-tag-new-code ,name ,detail ,@attributes)) + +(defun bovine-grammar-ALIAS-TAG (name aliasclass definition &rest attributes) + "Expand call to ALIAS-TAG grammar macro. +Return the form to create a semantic tag of class alias. +See the function `semantic-tag-new-alias' for the meaning of arguments +NAME, ALIASCLASS, DEFINITION and ATTRIBUTES." + `(semantic-tag-new-alias ,name ,aliasclass ,definition ,@attributes)) + +;; Cache of macro definitions currently in use. +(defvar bovine--grammar-macros nil) + +(defun bovine-grammar-expand-form (form quotemode &optional inplace) + "Expand FORM into a new one suitable to the bovine parser. +FORM is a list in which we are substituting. +Argument QUOTEMODE is non-nil if we are in backquote mode. +When non-nil, optional argument INPLACE indicates that FORM is being +expanded from elsewhere." + (when (eq (car form) 'quote) + (setq form (cdr form)) + (cond + ((and (= (length form) 1) (listp (car form))) + (insert "\n(append") + (bovine-grammar-expand-form (car form) quotemode nil) + (insert ")") + (setq form nil inplace nil) + ) + ((and (= (length form) 1) (symbolp (car form))) + (insert "\n'" (symbol-name (car form))) + (setq form nil inplace nil) + ) + (t + (insert "\n(list") + (setq inplace t) + ))) + (let ((macro (assq (car form) bovine--grammar-macros)) + inlist first n q x) + (if macro + (bovine-grammar-expand-form + (apply (cdr macro) (cdr form)) + quotemode t) + (if inplace (insert "\n(")) + (while form + (setq first (car form) + form (cdr form)) + ;; Hack for dealing with new reading of unquotes outside of + ;; backquote (introduced in 2010-12-06T16:37:26Z!monnier@iro.umontreal.ca). + (when (and (>= emacs-major-version 24) + (listp first) + (or (equal (car first) '\,) + (equal (car first) '\,@))) + (if (listp (cadr first)) + (setq form (append (cdr first) form) + first (car first)) + (setq first (intern (concat (symbol-name (car first)) + (symbol-name (cadr first))))))) + (cond + ((eq first nil) + (when (and (not inlist) (not inplace)) + (insert "\n(list") + (setq inlist t)) + (insert " nil") + ) + ((listp first) + ;;(let ((fn (and (symbolp (caar form)) (fboundp (caar form))))) + (when (and (not inlist) (not inplace)) + (insert "\n(list") + (setq inlist t)) + ;;(if (and inplace (not fn) (not (eq (caar form) 'EXPAND))) + ;; (insert " (append")) + (bovine-grammar-expand-form + first quotemode t) ;;(and fn (not (eq fn 'quote)))) + ;;(if (and inplace (not fn) (not (eq (caar form) 'EXPAND))) + ;; (insert ")")) + ;;) + ) + ((symbolp first) + (setq n (symbol-name first) ;the name + q quotemode ;implied quote flag + x nil) ;expand flag + (if (eq (aref n 0) ?,) + (if quotemode + ;; backquote mode needs the @ + (if (eq (aref n 1) ?@) + (setq n (substring n 2) + q nil + x t) + ;; non backquote mode behaves normally. + (setq n (substring n 1) + q nil)) + (setq n (substring n 1) + x t))) + (if (string= n "") + (progn + ;; We expand only the next item in place (a list?) + ;; A regular inline-list... + (bovine-grammar-expand-form (car form) quotemode t) + (setq form (cdr form))) + (if (and (eq (aref n 0) ?$) + ;; Don't expand $ tokens in implied quote mode. + ;; This acts like quoting in other symbols. + (not q)) + (progn + (cond + ((and (not x) (not inlist) (not inplace)) + (insert "\n(list")) + ((and x inlist (not inplace)) + (insert ")") + (setq inlist nil))) + (insert "\n(nth " (int-to-string + (1- (string-to-number + (substring n 1)))) + " vals)") + (and (not x) (not inplace) + (setq inlist t))) + + (when (and (not inlist) (not inplace)) + (insert "\n(list") + (setq inlist t)) + (or (char-equal (char-before) ?\() + (insert " ")) + (insert (if (or inplace (eq first t)) + "" "'") + n))) ;; " " + ) + (t + (when (and (not inlist) (not inplace)) + (insert "\n(list") + (setq inlist t)) + (insert (format "\n%S" first)) + ) + )) + (if inlist (insert ")")) + (if inplace (insert ")"))) + )) + +(defun bovine-grammar-expand-action (textform quotemode) + "Expand semantic action string TEXTFORM into Lisp code. +QUOTEMODE is the mode in which quoted symbols are slurred." + (if (string= "" textform) + nil + (let ((sexp (read textform))) + ;; We converted the lambda string into a list. Now write it + ;; out as the bovine lambda expression, and do macro-like + ;; conversion upon it. + (insert "\n") + (cond + ((eq (car sexp) 'EXPAND) + (insert ",(lambda (vals start end)") + ;; The EXPAND macro definition is mandatory + (bovine-grammar-expand-form + (apply (cdr (assq 'EXPAND bovine--grammar-macros)) (cdr sexp)) + quotemode t) + ) + ((and (listp (car sexp)) (eq (caar sexp) 'EVAL)) + ;; The user wants to evaluate the following args. + ;; Use a simpler expander + ) + (t + (insert ",(semantic-lambda") + (bovine-grammar-expand-form sexp quotemode) + )) + (insert ")\n"))) +) + +(defun bovine-grammar-parsetable-builder () + "Return the parser table expression as a string value. +The format of a bovine parser table is: + + ( ( NONTERMINAL-SYMBOL1 MATCH-LIST1 ) + ( NONTERMINAL-SYMBOL2 MATCH-LIST2 ) + ... + ( NONTERMINAL-SYMBOLn MATCH-LISTn ) + +Where each NONTERMINAL-SYMBOL is an artificial symbol which can appear +in any child state. As a starting place, one of the NONTERMINAL-SYMBOLS +must be `bovine-toplevel'. + +A MATCH-LIST is a list of possible matches of the form: + + ( STATE-LIST1 + STATE-LIST2 + ... + STATE-LISTN ) + +where STATE-LIST is of the form: + ( TYPE1 [ \"VALUE1\" ] TYPE2 [ \"VALUE2\" ] ... LAMBDA ) + +where TYPE is one of the returned types of the token stream. +VALUE is a value, or range of values to match against. For +example, a SYMBOL might need to match \"foo\". Some TYPES will not +have matching criteria. + +LAMBDA is a lambda expression which is evalled with the text of the +type when it is found. It is passed the list of all buffer text +elements found since the last lambda expression. It should return a +semantic element (see below.) + +For consistency between languages, try to use common return values +from your parser. Please reference the chapter \"Writing Parsers\" in +the \"Language Support Developer's Guide -\" in the semantic texinfo +manual." + (let* ((start (semantic-grammar-start)) + (scopestart (semantic-grammar-scopestart)) + (quotemode (semantic-grammar-quotemode)) + (tags (semantic-find-tags-by-class + 'token (current-buffer))) + (nterms (semantic-find-tags-by-class + 'nonterminal (current-buffer))) + ;; Setup the cache of macro definitions. + (bovine--grammar-macros (semantic-grammar-macros)) + nterm rules items item actn prec tag type regex) + + ;; Check some trivial things + (cond + ((null nterms) + (error "Bad input grammar")) + (start + (if (cdr start) + (message "Extra start symbols %S ignored" (cdr start))) + (setq start (symbol-name (car start))) + (unless (semantic-find-first-tag-by-name start nterms) + (error "start symbol `%s' has no rule" start))) + (t + ;; Default to the first grammar rule. + (setq start (semantic-tag-name (car nterms))))) + (when scopestart + (setq scopestart (symbol-name scopestart)) + (unless (semantic-find-first-tag-by-name scopestart nterms) + (error "scopestart symbol `%s' has no rule" scopestart))) + + ;; Generate the grammar Lisp form. + (with-temp-buffer + (erase-buffer) + (insert "`(") + ;; Insert the start/scopestart rules + (insert "\n(bovine-toplevel \n(" + start + ")\n) ;; end bovine-toplevel\n") + (when scopestart + (insert "\n(bovine-inner-scope \n(" + scopestart + ")\n) ;; end bovine-inner-scope\n")) + ;; Process each nonterminal + (while nterms + (setq nterm (car nterms) + ;; We can't use the override form because the current buffer + ;; is not the originator of the tag. + rules (semantic-tag-components-semantic-grammar-mode nterm) + nterm (semantic-tag-name nterm) + nterms (cdr nterms)) + (when (member nterm '("bovine-toplevel" "bovine-inner-scope")) + (error "`%s' is a reserved internal name" nterm)) + (insert "\n(" nterm) + ;; Process each rule + (while rules + (setq items (semantic-tag-get-attribute (car rules) :value) + prec (semantic-tag-get-attribute (car rules) :prec) + actn (semantic-tag-get-attribute (car rules) :expr) + rules (cdr rules)) + ;; Process each item + (insert "\n(") + (if (null items) + ;; EMPTY rule + (insert ";;EMPTY" (if actn "" "\n")) + ;; Expand items + (while items + (setq item (car items) + items (cdr items)) + (if (consp item) ;; mid-rule action + (message "Mid-rule action %S ignored" item) + (or (char-equal (char-before) ?\() + (insert "\n")) + (cond + ((member item '("bovine-toplevel" "bovine-inner-scope")) + (error "`%s' is a reserved internal name" item)) + ;; Replace ITEM by its %token definition. + ;; If a '%token TYPE ITEM [REGEX]' definition exists + ;; in the grammar, ITEM is replaced by TYPE [REGEX]. + ((setq tag (semantic-find-first-tag-by-name + item tags) + type (semantic-tag-get-attribute tag :type)) + (insert type) + (if (setq regex (semantic-tag-get-attribute tag :value)) + (insert (format "\n%S" regex)))) + ;; Don't change ITEM + (t + (insert (semantic-grammar-item-text item))) + )))) + (if prec + (message "%%prec %S ignored" prec)) + (if actn + (bovine-grammar-expand-action actn quotemode)) + (insert ")")) + (insert "\n) ;; end " nterm "\n")) + (insert ")\n") + (buffer-string)))) + +(defun bovine-grammar-setupcode-builder () + "Return the text of the setup code." + (format + "(setq semantic--parse-table %s\n\ + semantic-debug-parser-source %S\n\ + semantic-debug-parser-class 'semantic-bovine-debug-parser + semantic-flex-keywords-obarray %s\n\ + %s)" + (semantic-grammar-parsetable) + (buffer-name) + (semantic-grammar-keywordtable) + (let ((mode (semantic-grammar-languagemode))) + ;; Is there more than one major mode? + (if (and (listp mode) (> (length mode) 1)) + (format "semantic-equivalent-major-modes '%S\n" mode) + "")))) + +(defvar bovine-grammar-menu + '("BY Grammar") + "BY mode specific grammar menu. +Menu items are appended to the common grammar menu.") + +;;;###autoload +(define-derived-mode bovine-grammar-mode semantic-grammar-mode "BY" + "Major mode for editing Bovine grammars." + (semantic-grammar-setup-menu bovine-grammar-menu) + (semantic-install-function-overrides + '((grammar-parsetable-builder . bovine-grammar-parsetable-builder) + (grammar-setupcode-builder . bovine-grammar-setupcode-builder)))) + +(add-to-list 'auto-mode-alist '("\\.by\\'" . bovine-grammar-mode)) + +(defvar-mode-local bovine-grammar-mode semantic-grammar-macros + '( + (ASSOC . semantic-grammar-ASSOC) + (EXPAND . bovine-grammar-EXPAND) + (EXPANDFULL . bovine-grammar-EXPANDFULL) + (TAG . bovine-grammar-TAG) + (VARIABLE-TAG . bovine-grammar-VARIABLE-TAG) + (FUNCTION-TAG . bovine-grammar-FUNCTION-TAG) + (TYPE-TAG . bovine-grammar-TYPE-TAG) + (INCLUDE-TAG . bovine-grammar-INCLUDE-TAG) + (PACKAGE-TAG . bovine-grammar-PACKAGE-TAG) + (CODE-TAG . bovine-grammar-CODE-TAG) + (ALIAS-TAG . bovine-grammar-ALIAS-TAG) + ) + "Semantic grammar macros used in bovine grammars.") + +(defun bovine-make-parsers () + "Generate Emacs' built-in Bovine-based parser files." + (interactive) + (semantic-mode 1) + ;; Loop through each .by file in current directory, and run + ;; `semantic-grammar-batch-build-one-package' to build the grammar. + (dolist (f (directory-files default-directory nil "\\.by\\'")) + (let ((packagename + (condition-case err + (with-current-buffer (find-file-noselect f) + (semantic-grammar-create-package)) + (error (message "%s" (error-message-string err)) nil))) + lang filename) + (when (and packagename + (string-match "^.*/\\(.*\\)-by\\.el\\'" packagename)) + (setq lang (match-string 1 packagename)) + (setq filename (concat lang "-by.el")) + (with-temp-buffer + (insert-file-contents filename) + (setq buffer-file-name (expand-file-name filename)) + ;; Fix copyright header: + (goto-char (point-min)) + (re-search-forward "^;; Author:") + (setq copyright-end (match-beginning 0)) + (re-search-forward "^;;; Code:\n") + (delete-region copyright-end (match-end 0)) + (goto-char copyright-end) + (insert ";; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; +;; This file was generated from admin/grammars/" + lang ".by. + +;;; Code: +") + (goto-char (point-min)) + (delete-region (point-min) (line-end-position)) + (insert ";;; " packagename + " --- Generated parser support file") + (delete-trailing-whitespace) + (re-search-forward ";;; \\(.*\\) ends here") + (replace-match packagename nil nil nil 1) + (save-buffer)))))) + +(provide 'semantic/bovine/grammar) + +;;; semantic/bovine/grammar.el ends here diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el new file mode 100644 index 00000000000..6fa52dc2adc --- /dev/null +++ b/lisp/cedet/semantic/wisent/grammar.el @@ -0,0 +1,526 @@ +;;; semantic/wisent/grammar.el --- Wisent's input grammar mode + +;; Copyright (C) 2002-2012 Free Software Foundation, Inc. +;; +;; Author: David Ponce +;; Maintainer: David Ponce +;; Created: 26 Aug 2002 +;; Keywords: syntax +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; +;; Major mode for editing Wisent's input grammar (.wy) files. + +;;; Code: +(require 'semantic) +(require 'semantic/grammar) +(require 'semantic/find) +(require 'semantic/lex) +(require 'semantic/wisent) +(require 'semantic/bovine) + +(defsubst wisent-grammar-region-placeholder (symb) + "Given a $N placeholder symbol in SYMB, return a $regionN symbol. +Return nil if $N is not a valid placeholder symbol." + (let ((n (symbol-name symb))) + (if (string-match "^[$]\\([1-9][0-9]*\\)$" n) + (intern (concat "$region" (match-string 1 n)))))) + +(defun wisent-grammar-EXPAND (symb nonterm) + "Expand call to EXPAND grammar macro. +Return the form to parse from within a nonterminal. +SYMB is a $I placeholder symbol that gives the bounds of the area to +parse. +NONTERM is the nonterminal symbol to start with." + (unless (member nonterm (semantic-grammar-start)) + (error "EXPANDFULL macro called with %s, but not used with %%start" + nonterm)) + (let (($ri (wisent-grammar-region-placeholder symb))) + (if $ri + `(semantic-bovinate-from-nonterminal + (car ,$ri) (cdr ,$ri) ',nonterm) + (error "Invalid form (EXPAND %s %s)" symb nonterm)))) + +(defun wisent-grammar-EXPANDFULL (symb nonterm) + "Expand call to EXPANDFULL grammar macro. +Return the form to recursively parse an area. +SYMB is a $I placeholder symbol that gives the bounds of the area. +NONTERM is the nonterminal symbol to start with." + (unless (member nonterm (semantic-grammar-start)) + (error "EXPANDFULL macro called with %s, but not used with %%start" + nonterm)) + (let (($ri (wisent-grammar-region-placeholder symb))) + (if $ri + `(semantic-parse-region + (car ,$ri) (cdr ,$ri) ',nonterm 1) + (error "Invalid form (EXPANDFULL %s %s)" symb nonterm)))) + +(defun wisent-grammar-TAG (name class &rest attributes) + "Expand call to TAG grammar macro. +Return the form to create a generic semantic tag. +See the function `semantic-tag' for the meaning of arguments NAME, +CLASS and ATTRIBUTES." + `(wisent-raw-tag + (semantic-tag ,name ,class ,@attributes))) + +(defun wisent-grammar-VARIABLE-TAG (name type default-value &rest attributes) + "Expand call to VARIABLE-TAG grammar macro. +Return the form to create a semantic tag of class variable. +See the function `semantic-tag-new-variable' for the meaning of +arguments NAME, TYPE, DEFAULT-VALUE and ATTRIBUTES." + `(wisent-raw-tag + (semantic-tag-new-variable ,name ,type ,default-value ,@attributes))) + +(defun wisent-grammar-FUNCTION-TAG (name type arg-list &rest attributes) + "Expand call to FUNCTION-TAG grammar macro. +Return the form to create a semantic tag of class function. +See the function `semantic-tag-new-function' for the meaning of +arguments NAME, TYPE, ARG-LIST and ATTRIBUTES." + `(wisent-raw-tag + (semantic-tag-new-function ,name ,type ,arg-list ,@attributes))) + +(defun wisent-grammar-TYPE-TAG (name type members parents &rest attributes) + "Expand call to TYPE-TAG grammar macro. +Return the form to create a semantic tag of class type. +See the function `semantic-tag-new-type' for the meaning of arguments +NAME, TYPE, MEMBERS, PARENTS and ATTRIBUTES." + `(wisent-raw-tag + (semantic-tag-new-type ,name ,type ,members ,parents ,@attributes))) + +(defun wisent-grammar-INCLUDE-TAG (name system-flag &rest attributes) + "Expand call to INCLUDE-TAG grammar macro. +Return the form to create a semantic tag of class include. +See the function `semantic-tag-new-include' for the meaning of +arguments NAME, SYSTEM-FLAG and ATTRIBUTES." + `(wisent-raw-tag + (semantic-tag-new-include ,name ,system-flag ,@attributes))) + +(defun wisent-grammar-PACKAGE-TAG (name detail &rest attributes) + "Expand call to PACKAGE-TAG grammar macro. +Return the form to create a semantic tag of class package. +See the function `semantic-tag-new-package' for the meaning of +arguments NAME, DETAIL and ATTRIBUTES." + `(wisent-raw-tag + (semantic-tag-new-package ,name ,detail ,@attributes))) + +(defun wisent-grammar-CODE-TAG (name detail &rest attributes) + "Expand call to CODE-TAG grammar macro. +Return the form to create a semantic tag of class code. +See the function `semantic-tag-new-code' for the meaning of arguments +NAME, DETAIL and ATTRIBUTES." + `(wisent-raw-tag + (semantic-tag-new-code ,name ,detail ,@attributes))) + +(defun wisent-grammar-ALIAS-TAG (name aliasclass definition &rest attributes) + "Expand call to ALIAS-TAG grammar macro. +Return the form to create a semantic tag of class alias. +See the function `semantic-tag-new-alias' for the meaning of arguments +NAME, ALIASCLASS, DEFINITION and ATTRIBUTES." + `(wisent-raw-tag + (semantic-tag-new-alias ,name ,aliasclass ,definition ,@attributes))) + +(defun wisent-grammar-EXPANDTAG (raw-tag) + "Expand call to EXPANDTAG grammar macro. +Return the form to produce a list of cooked tags from raw form of +Semantic tag RAW-TAG." + `(wisent-cook-tag ,raw-tag)) + +(defun wisent-grammar-AST-ADD (ast &rest nodes) + "Expand call to AST-ADD grammar macro. +Return the form to update the abstract syntax tree AST with NODES. +See also the function `semantic-ast-add'." + `(semantic-ast-add ,ast ,@nodes)) + +(defun wisent-grammar-AST-PUT (ast &rest nodes) + "Expand call to AST-PUT grammar macro. +Return the form to update the abstract syntax tree AST with NODES. +See also the function `semantic-ast-put'." + `(semantic-ast-put ,ast ,@nodes)) + +(defun wisent-grammar-AST-GET (ast node) + "Expand call to AST-GET grammar macro. +Return the form to get, from the abstract syntax tree AST, the value +of NODE. +See also the function `semantic-ast-get'." + `(semantic-ast-get ,ast ,node)) + +(defun wisent-grammar-AST-GET1 (ast node) + "Expand call to AST-GET1 grammar macro. +Return the form to get, from the abstract syntax tree AST, the first +value of NODE. +See also the function `semantic-ast-get1'." + `(semantic-ast-get1 ,ast ,node)) + +(defun wisent-grammar-AST-GET-STRING (ast node) + "Expand call to AST-GET-STRING grammar macro. +Return the form to get, from the abstract syntax tree AST, the value +of NODE as a string. +See also the function `semantic-ast-get-string'." + `(semantic-ast-get-string ,ast ,node)) + +(defun wisent-grammar-AST-MERGE (ast1 ast2) + "Expand call to AST-MERGE grammar macro. +Return the form to merge the abstract syntax trees AST1 and AST2. +See also the function `semantic-ast-merge'." + `(semantic-ast-merge ,ast1 ,ast2)) + +(defun wisent-grammar-SKIP-BLOCK (&optional symb) + "Expand call to SKIP-BLOCK grammar macro. +Return the form to skip a parenthesized block. +Optional argument SYMB is a $I placeholder symbol that gives the +bounds of the block to skip. By default, skip the block at `$1'. +See also the function `wisent-skip-block'." + (let ($ri) + (when symb + (unless (setq $ri (wisent-grammar-region-placeholder symb)) + (error "Invalid form (SKIP-BLOCK %s)" symb))) + `(wisent-skip-block ,$ri))) + +(defun wisent-grammar-SKIP-TOKEN () + "Expand call to SKIP-TOKEN grammar macro. +Return the form to skip the lookahead token. +See also the function `wisent-skip-token'." + `(wisent-skip-token)) + +(defun wisent-grammar-assocs () + "Return associativity and precedence level definitions." + (mapcar + #'(lambda (tag) + (cons (intern (semantic-tag-name tag)) + (mapcar #'semantic-grammar-item-value + (semantic-tag-get-attribute tag :value)))) + (semantic-find-tags-by-class 'assoc (current-buffer)))) + +(defun wisent-grammar-terminals () + "Return the list of terminal symbols. +Keep order of declaration in the WY file without duplicates." + (let (terms) + (mapc + #'(lambda (tag) + (mapcar #'(lambda (name) + (add-to-list 'terms (intern name))) + (cons (semantic-tag-name tag) + (semantic-tag-get-attribute tag :rest)))) + (semantic--find-tags-by-function + #'(lambda (tag) + (memq (semantic-tag-class tag) '(token keyword))) + (current-buffer))) + (nreverse terms))) + +;; Cache of macro definitions currently in use. +(defvar wisent--grammar-macros nil) + +(defun wisent-grammar-expand-macros (expr) + "Expand expression EXPR into a form without grammar macros. +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)) + (macro (assq (car expr) wisent--grammar-macros))) + (if macro ;; Expand Semantic built-in. + (apply (cdr macro) (cdr expr)) + expr)))) + +(defun wisent-grammar-nonterminals () + "Return the list form of nonterminal definitions." + (let ((nttags (semantic-find-tags-by-class + 'nonterminal (current-buffer))) + ;; Setup the cache of macro definitions. + (wisent--grammar-macros (semantic-grammar-macros)) + rltags nterms rules rule elems elem actn sexp prec) + (while nttags + (setq rltags (semantic-tag-components (car nttags)) + rules nil) + (while rltags + (setq elems (semantic-tag-get-attribute (car rltags) :value) + prec (semantic-tag-get-attribute (car rltags) :prec) + actn (semantic-tag-get-attribute (car rltags) :expr) + rule nil) + (when elems ;; not an EMPTY rule + (while elems + (setq elem (car elems) + elems (cdr elems)) + (setq elem (if (consp elem) ;; mid-rule action + (wisent-grammar-expand-macros (read (car elem))) + (semantic-grammar-item-value elem)) ;; item + rule (cons elem rule))) + (setq rule (nreverse rule))) + (if prec + (setq prec (vector (semantic-grammar-item-value prec)))) + (if actn + (setq sexp (wisent-grammar-expand-macros (read actn)))) + (setq rule (if actn + (if prec + (list rule prec sexp) + (list rule sexp)) + (if prec + (list rule prec) + (list rule)))) + (setq rules (cons rule rules) + rltags (cdr rltags))) + (setq nterms (cons (cons (intern (semantic-tag-name (car nttags))) + (nreverse rules)) + nterms) + nttags (cdr nttags))) + (nreverse nterms))) + +(defun wisent-grammar-grammar () + "Return Elisp form of the grammar." + (let* ((terminals (wisent-grammar-terminals)) + (nonterminals (wisent-grammar-nonterminals)) + (assocs (wisent-grammar-assocs))) + (cons terminals (cons assocs nonterminals)))) + +(defun wisent-grammar-parsetable-builder () + "Return the value of the parser table." + `(progn + ;; Ensure that the grammar [byte-]compiler is available. + (eval-when-compile (require 'semantic/wisent/comp)) + (wisent-compile-grammar + ',(wisent-grammar-grammar) + ',(semantic-grammar-start)))) + +(defun wisent-grammar-setupcode-builder () + "Return the parser setup code." + (format + "(semantic-install-function-overrides\n\ + '((parse-stream . wisent-parse-stream)))\n\ + (setq semantic-parser-name \"LALR\"\n\ + semantic--parse-table %s\n\ + semantic-debug-parser-source %S\n\ + semantic-flex-keywords-obarray %s\n\ + semantic-lex-types-obarray %s)\n\ + ;; Collect unmatched syntax lexical tokens\n\ + (semantic-make-local-hook 'wisent-discarding-token-functions)\n\ + (add-hook 'wisent-discarding-token-functions\n\ + 'wisent-collect-unmatched-syntax nil t)" + (semantic-grammar-parsetable) + (buffer-name) + (semantic-grammar-keywordtable) + (semantic-grammar-tokentable))) + +(defvar wisent-grammar-menu + '("WY Grammar" + ["LALR Compiler Verbose" wisent-toggle-verbose-flag + :style toggle :active (boundp 'wisent-verbose-flag) + :selected (and (boundp 'wisent-verbose-flag) + wisent-verbose-flag)] + ) + "WY mode specific grammar menu. +Menu items are appended to the common grammar menu.") + +;;;###autoload +(define-derived-mode wisent-grammar-mode semantic-grammar-mode "WY" + "Major mode for editing Wisent grammars." + (semantic-grammar-setup-menu wisent-grammar-menu) + (semantic-install-function-overrides + '((grammar-parsetable-builder . wisent-grammar-parsetable-builder) + (grammar-setupcode-builder . wisent-grammar-setupcode-builder)))) + +(defvar-mode-local wisent-grammar-mode semantic-grammar-macros + '( + (ASSOC . semantic-grammar-ASSOC) + (EXPAND . wisent-grammar-EXPAND) + (EXPANDFULL . wisent-grammar-EXPANDFULL) + (TAG . wisent-grammar-TAG) + (VARIABLE-TAG . wisent-grammar-VARIABLE-TAG) + (FUNCTION-TAG . wisent-grammar-FUNCTION-TAG) + (TYPE-TAG . wisent-grammar-TYPE-TAG) + (INCLUDE-TAG . wisent-grammar-INCLUDE-TAG) + (PACKAGE-TAG . wisent-grammar-PACKAGE-TAG) + (EXPANDTAG . wisent-grammar-EXPANDTAG) + (CODE-TAG . wisent-grammar-CODE-TAG) + (ALIAS-TAG . wisent-grammar-ALIAS-TAG) + (AST-ADD . wisent-grammar-AST-ADD) + (AST-PUT . wisent-grammar-AST-PUT) + (AST-GET . wisent-grammar-AST-GET) + (AST-GET1 . wisent-grammar-AST-GET1) + (AST-GET-STRING . wisent-grammar-AST-GET-STRING) + (AST-MERGE . wisent-grammar-AST-MERGE) + (SKIP-BLOCK . wisent-grammar-SKIP-BLOCK) + (SKIP-TOKEN . wisent-grammar-SKIP-TOKEN) + ) + "Semantic grammar macros used in wisent grammars.") + +(defvar wisent-make-parsers--emacs-license + ";; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see .") + +(defvar wisent-make-parsers--python-license + ";; It is derived in part from the Python grammar, used under the +;; following license: +;; +;; PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +;; -------------------------------------------- +;; 1. This LICENSE AGREEMENT is between the Python Software Foundation +;; (\"PSF\"), and the Individual or Organization (\"Licensee\") accessing +;; and otherwise using this software (\"Python\") in source or binary +;; form and its associated documentation. +;; +;; 2. Subject to the terms and conditions of this License Agreement, +;; PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide +;; license to reproduce, analyze, test, perform and/or display +;; publicly, prepare derivative works, distribute, and otherwise use +;; Python alone or in any derivative version, provided, however, that +;; PSF's License Agreement and PSF's notice of copyright, i.e., +;; \"Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Python Software Foundation; All Rights Reserved\" are +;; retained in Python alone or in any derivative version prepared by +;; Licensee. +;; +;; 3. In the event Licensee prepares a derivative work that is based +;; on or incorporates Python or any part thereof, and wants to make +;; the derivative work available to others as provided herein, then +;; Licensee hereby agrees to include in any such work a brief summary +;; of the changes made to Python. +;; +;; 4. PSF is making Python available to Licensee on an \"AS IS\" +;; basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +;; IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +;; DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +;; FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +;; INFRINGE ANY THIRD PARTY RIGHTS. +;; +;; 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +;; FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A +;; RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR +;; ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. +;; +;; 6. This License Agreement will automatically terminate upon a +;; material breach of its terms and conditions. +;; +;; 7. Nothing in this License Agreement shall be deemed to create any +;; relationship of agency, partnership, or joint venture between PSF +;; and Licensee. This License Agreement does not grant permission to +;; use PSF trademarks or trade name in a trademark sense to endorse or +;; promote products or services of Licensee, or any third party. +;; +;; 8. By copying, installing or otherwise using Python, Licensee +;; agrees to be bound by the terms and conditions of this License +;; Agreement.") + +(defvar wisent-make-parsers--ecmascript-license + "\n;; It is derived from the grammar in the ECMAScript Language +;; Specification published at +;; +;; http://www.ecma-international.org/publications/standards/Ecma-262.htm +;; +;; and redistributed under the following license: +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; +;; 2. Redistributions in binary form must reproduce the above +;; copyright notice, this list of conditions and the following +;; disclaimer in the documentation and/or other materials provided +;; with the distribution. +;; +;; 3. Neither the name of the authors nor Ecma International may be +;; used to endorse or promote products derived from this software +;; without specific prior written permission. THIS SOFTWARE IS +;; PROVIDED BY THE ECMA INTERNATIONAL \"AS IS\" AND ANY EXPRESS OR +;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +;; ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR +;; ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +;; OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +;; DAMAGE.") + +(defvar wisent-make-parsers--parser-file-name + `(("semantic/grammar-wy.el") + ("srecode/srt-wy.el") + ("semantic/wisent/js-wy.el" + "Copyright (C) 1998-2011 Ecma International." + ,wisent-make-parsers--ecmascript-license) + ("semantic/wisent/javat-wy.el") + ("semantic/wisent/python-wy.el" + "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +\;; 2009, 2010 Python Software Foundation; All Rights Reserved" + ,wisent-make-parsers--python-license))) + +(defun wisent-make-parsers () + "Generate Emacs' built-in Wisent-based parser files." + (interactive) + (semantic-mode 1) + ;; Loop through each .wy file in current directory, and run + ;; `semantic-grammar-batch-build-one-package' to build the grammar. + (dolist (f (directory-files default-directory nil "\\.wy\\'")) + (let ((packagename + (condition-case err + (with-current-buffer (find-file-noselect f) + (semantic-grammar-create-package)) + (error (message "%s" (error-message-string err)) nil))) + output-data) + (when (setq output-data (assoc packagename wisent-make-parsers--parser-file-name)) + (let ((additional-copyright (nth 1 output-data)) + (additional-license (nth 2 output-data)) + (filename (progn (string-match ".*/\\(.*\\)" packagename) (match-string 1 packagename))) + copyright-end) + ;; Touch up the generated parsers for Emacs integration. + (with-temp-buffer + (insert-file-contents filename) + ;; Fix copyright header: + (goto-char (point-min)) + (when additional-copyright + (re-search-forward "Copyright (C).*$") + (insert "\n;; " additional-copyright)) + (re-search-forward "^;; Author:") + (setq copyright-end (match-beginning 0)) + (re-search-forward "^;;; Code:\n") + (delete-region copyright-end (match-end 0)) + (goto-char copyright-end) + (insert wisent-make-parsers--emacs-license) + (insert "\n\n;;; Commentary: +;; +;; This file was generated from admin/grammars/" + f ".") + (when additional-license + (insert "\n" additional-license)) + (insert "\n\n;;; Code:\n") + (goto-char (point-min)) + (delete-region (point-min) (line-end-position)) + (insert ";;; " packagename + " --- Generated parser support file") + (re-search-forward ";;; \\(.*\\) ends here") + (replace-match packagename nil nil nil 1) + (delete-trailing-whitespace) + (write-region nil nil (expand-file-name filename)))))))) + +(provide 'semantic/wisent/grammar) + +;;; semantic/wisent/grammar.el ends here diff --git a/lisp/files.el b/lisp/files.el index c3f9e1ef1a0..e030aff0ae2 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2326,6 +2326,8 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode) ("\\.js\\'" . javascript-mode) ("\\.json\\'" . javascript-mode) ("\\.[ds]?vh?\\'" . verilog-mode) + ("\\.by\\'" . bovine-grammar-mode) + ("\\.wy\\'" . wisent-grammar-mode) ;; .emacs or .gnus or .viper following a directory delimiter in ;; Unix, MSDOG or VMS syntax. ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode) -- cgit v1.2.1 From 0db901c17a90b38c81b4b03e0c83c61e814a6c0b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 6 Oct 2012 22:22:31 +0800 Subject: Update for admin/grammars/README. --- admin/grammars/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/grammars/README b/admin/grammars/README index 419797e0dcb..e38260952a5 100644 --- a/admin/grammars/README +++ b/admin/grammars/README @@ -3,8 +3,8 @@ generate the parser data in the lisp/semantic/bovine/ and lisp/semantic/wisent/ directories. You can run the parser generators with -emacs -batch -Q -l bovine-grammar.el -f bovine-make-parsers -emacs -batch -Q -l wisent-grammar.el -f wisent-make-parsers +emacs -batch -Q -l semantic/bovine/grammar -f bovine-make-parsers +emacs -batch -Q -l semantic/wisent/grammar -f wisent-make-parsers Currently, the parser files in lisp/ are not generated directly from these grammar files when making Emacs. This state of affairs, and the -- cgit v1.2.1 From 50d92e32c2770a98fed777e3a676fca1205d28ae Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 09:59:01 -0700 Subject: Fix previous read-passwd change --- lisp/subr.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/subr.el b/lisp/subr.el index 72bedc69c3c..e8eef541f27 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2183,8 +2183,9 @@ by doing (clear-string STRING)." (add-hook 'after-change-functions hide-chars-fun nil 'local)) (unwind-protect (let ((enable-recursive-minibuffers t) - (map minibuffer-local-map) + (map (make-sparse-keymap)) result) + (set-keymap-parent map minibuffer-local-map) (define-key map "\C-u" ; bug#12570 (lambda () (interactive) (delete-minibuffer-contents))) (setq result -- cgit v1.2.1 From 5694896dfc322e90c0e7e064002cf25296394d75 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Sat, 6 Oct 2012 13:16:26 -0400 Subject: * lisp/register.el (append-to-register, prepend-to-register): Deactivate mark, as does `copy-to-register'. Fixes: debbugs:12389 --- lisp/ChangeLog | 15 ++++++++++----- lisp/register.el | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5d93a386a21..6235f9f28ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-06 Jambunathan K + + * register.el (append-to-register, prepend-to-register): + Deactivate mark, as does `copy-to-register' (bug#12389). + 2012-10-06 Chong Yidong * files.el (auto-mode-alist): Add .by and .wy (Semantic grammars). @@ -68,7 +73,7 @@ (python-fill-decorator-function, python-fill-paren-function): Remove :safe for defcustoms. (python-fill-string-style): New defcustom - (python-fill-paragraph-function): Enhanced context detection. + (python-fill-paragraph-function): Enhance context detection. (python-fill-string): Honor python-fill-string-style settings. 2012-10-04 Martin Rudalics @@ -100,8 +105,8 @@ 2012-10-02 Chong Yidong - * progmodes/hideif.el (hif-lookup, hif-defined): Handle - semantic-c-takeover-hideif. + * progmodes/hideif.el (hif-lookup, hif-defined): + Handle semantic-c-takeover-hideif. 2012-10-02 Paul Eggert @@ -117,8 +122,8 @@ 2012-10-02 Sergio Durigan Junior (tiny change) - * net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): Fix - querying BBDB for entries without a last name (Bug#11580). + * net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): + Fix querying BBDB for entries without a last name (Bug#11580). 2012-10-02 Chong Yidong diff --git a/lisp/register.el b/lisp/register.el index fb35a26a653..7c2d9337fa2 100644 --- a/lisp/register.el +++ b/lisp/register.el @@ -382,6 +382,7 @@ START and END are buffer positions indicating what to append." register (cond ((not reg) text) ((stringp reg) (concat reg separator text)) (t (error "Register does not contain text"))))) + (setq deactivate-mark t) (cond (delete-flag (delete-region start end)) ((called-interactively-p 'interactive) @@ -400,6 +401,7 @@ START and END are buffer positions indicating what to prepend." register (cond ((not reg) text) ((stringp reg) (concat text separator reg)) (t (error "Register does not contain text"))))) + (setq deactivate-mark t) (cond (delete-flag (delete-region start end)) ((called-interactively-p 'interactive) -- cgit v1.2.1 From d39109c3e111bf2403f6e636ff1273f2701683e7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 6 Oct 2012 13:29:15 -0400 Subject: * lisp/subr.el (read-passwd-map): New var. (read-passwd): Use `read-string' again. * lisp/minibuffer.el (delete-minibuffer-contents): Make it interactive. --- lisp/ChangeLog | 6 ++++++ lisp/minibuffer.el | 1 + lisp/subr.el | 21 ++++++++++----------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6235f9f28ca..292a536f2c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-10-06 Stefan Monnier + + * subr.el (read-passwd-map): New var. + (read-passwd): Use `read-string' again. + * minibuffer.el (delete-minibuffer-contents): Make it interactive. + 2012-10-06 Jambunathan K * register.el (append-to-register, prepend-to-register): diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index cf990019abc..a9be1749423 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -632,6 +632,7 @@ That is what completion commands operate on." (defun delete-minibuffer-contents () "Delete all user input in a minibuffer. If the current buffer is not a minibuffer, erase its entire contents." + (interactive) ;; We used to do `delete-field' here, but when file name shadowing ;; is on, the field doesn't cover the entire minibuffer contents. (delete-region (minibuffer-prompt-end) (point-max))) diff --git a/lisp/subr.el b/lisp/subr.el index e8eef541f27..e438a860cbc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2143,6 +2143,13 @@ any other non-digit terminates the character code and is then used as input.")) (setq first nil)) code)) +(defconst read-passwd-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map minibuffer-local-map) + (define-key map "\C-u" #'delete-minibuffer-contents) ;bug#12570 + map) + "Keymap used while reading passwords.") + (defun read-passwd (prompt &optional confirm default) "Read a password, prompting with PROMPT, and return it. If optional CONFIRM is non-nil, read the password twice to make sure. @@ -2180,19 +2187,11 @@ by doing (clear-string STRING)." (setq minibuf (current-buffer)) ;; Turn off electricity. (set (make-local-variable 'post-self-insert-hook) nil) + (use-local-map read-passwd-map) (add-hook 'after-change-functions hide-chars-fun nil 'local)) (unwind-protect - (let ((enable-recursive-minibuffers t) - (map (make-sparse-keymap)) - result) - (set-keymap-parent map minibuffer-local-map) - (define-key map "\C-u" ; bug#12570 - (lambda () (interactive) (delete-minibuffer-contents))) - (setq result - ;; t = no history. - (read-from-minibuffer prompt nil map nil t default)) - (if (and (equal "" result) default) default - result)) + (let ((enable-recursive-minibuffers t)) + (read-string prompt nil t default)) ; t = "no history" (when (buffer-live-p minibuf) (with-current-buffer minibuf ;; Not sure why but it seems that there might be cases where the -- cgit v1.2.1 From 04fafa467506fe9ca9b77d9cdc3f8e25cb8fd5d3 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sat, 6 Oct 2012 19:31:11 +0200 Subject: Handle fullscreen parameter in initial/defult-frame-alist for NS. * nsfns.m (Fx_create_frame): Call x_default_parameter with fullscreen/Fullscreen. * nsterm.h (EmacsView): Rename tbar_height to tibar_height. tobar_height is new. * nsterm.m (x_make_frame_visible): Check for fullscreen. (ns_fullscreen_hook): Activate old style fullscreen with a timer. (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen. (windowDidResize:): Check for correct window if old style fullscreen. Capitalize word in comment. Remove incorrect comment. (initFrameFromEmacs:): tbar_height renamed tibar_height. (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix error in drawing background. (toggleFullScreen:): Remove comment. Rearrange calls. Set toolbar values to zero, save old height in tobar_height. Restore tool bar height when leaving fullscreen. (canBecomeMainWindow): New function. --- src/ChangeLog | 21 +++++++++++++++ src/nsfns.m | 2 ++ src/nsterm.h | 3 ++- src/nsterm.m | 87 ++++++++++++++++++++++++++++++++++++++++++++++------------- 4 files changed, 94 insertions(+), 19 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 956e78e6c7e..b960837eaab 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,24 @@ +2012-10-06 Jan Djärv + + * nsfns.m (Fx_create_frame): Call x_default_parameter with + fullscreen/Fullscreen. + + * nsterm.h (EmacsView): Rename tbar_height to tibar_height. + tobar_height is new. + + * nsterm.m (x_make_frame_visible): Check for fullscreen. + (ns_fullscreen_hook): Activate old style fullscreen with a timer. + (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen. + (windowDidResize:): Check for correct window if old style fullscreen. + Capitalize word in comment. Remove incorrect comment. + (initFrameFromEmacs:): tbar_height renamed tibar_height. + (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix + error in drawing background. + (toggleFullScreen:): Remove comment. Rearrange calls. + Set toolbar values to zero, save old height in tobar_height. + Restore tool bar height when leaving fullscreen. + (canBecomeMainWindow): New function. + 2012-10-06 Paul Eggert * keyboard.c (read_char): Remove unnecessary 'volatile's and label. diff --git a/src/nsfns.m b/src/nsfns.m index 1efadf0cb98..f22198401e0 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1346,6 +1346,8 @@ This function is an internal primitive--use `make-frame' instead. */) RES_TYPE_NUMBER); x_default_parameter (f, parms, Qalpha, Qnil, "alpha", "Alpha", RES_TYPE_NUMBER); + x_default_parameter (f, parms, Qfullscreen, Qnil, + "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); width = FRAME_COLS (f); height = FRAME_LINES (f); diff --git a/src/nsterm.h b/src/nsterm.h index f06e0cb0f7f..f1cd7458bdc 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -86,7 +86,8 @@ along with GNU Emacs. If not, see . */ BOOL windowClosing; NSString *workingText; BOOL processingCompose; - int fs_state, fs_before_fs, next_maximized, tbar_height, bwidth; + int fs_state, fs_before_fs, next_maximized; + int tibar_height, tobar_height, bwidth; int maximized_width, maximized_height; NSWindow *nonfs_window; @public diff --git a/src/nsterm.m b/src/nsterm.m index 2df0e1a1ad5..0d0be9281ee 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1068,8 +1068,23 @@ x_make_frame_visible (struct frame *f) if this ends up the case again, comment this out again. */ if (!FRAME_VISIBLE_P (f)) { + EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f); f->async_visible = 1; ns_raise_frame (f); + +#ifdef NEW_STYLE_FS + /* Making a new frame from a fullscreen frame will make the new frame + fullscreen also. So skip handleFS as this will print an error. */ + if (f->want_fullscreen == FULLSCREEN_BOTH + && ([[view window] styleMask] & NSFullScreenWindowMask) != 0) + return; +#endif + if (f->want_fullscreen != FULLSCREEN_NONE) + { + block_input (); + [view handleFS]; + unblock_input (); + } } } @@ -1317,6 +1332,18 @@ ns_fullscreen_hook (FRAME_PTR f) EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f); if (! f->async_visible) return; +#ifndef NEW_STYLE_FS + if (f->want_fullscreen == FULLSCREEN_BOTH) + { + /* Old style fs don't initiate correctly if created from + init/default-frame alist, so use a timer (not nice...). + */ + [NSTimer scheduledTimerWithTimeInterval: 0.5 target: view + selector: @selector (handleFS) + userInfo: nil repeats: NO]; + return; + } +#endif block_input (); [view handleFS]; @@ -4210,6 +4237,11 @@ ns_term_init (Lisp_Object display_name) NSColorPboardType, NSFontPboardType, nil] retain]; +#ifndef NEW_STYLE_FS + /* If fullscreen is in init/default-frame-alist, focus isn't set + right for fullscreen windows, so set this. */ + [NSApp activateIgnoringOtherApps:YES]; +#endif [NSApp run]; ns_do_open_file = YES; @@ -5505,10 +5537,17 @@ not_in_argv (NSString *arg) - (void)windowDidResize: (NSNotification *)notification { + +#if !defined (NEW_STYLE_FS) && ! defined (NS_IMPL_GNUSTEP) + NSWindow *theWindow = [notification object]; + /* We can get notification on the non-FS window when in fullscreen mode. */ + if ([self window] != theWindow) return; +#endif + #ifdef NS_IMPL_GNUSTEP NSWindow *theWindow = [notification object]; - /* in GNUstep, at least currently, it's possible to get a didResize + /* In GNUstep, at least currently, it's possible to get a didResize without getting a willResize.. therefore we need to act as if we got the willResize now */ NSSize sz = [theWindow frame].size; @@ -5526,10 +5565,6 @@ not_in_argv (NSString *arg) } #endif /* NS_IMPL_COCOA */ - /* Avoid loop under GNUstep due to call at beginning of this function. - (x_set_window_size causes a resize which causes - a "windowDidResize" which calls x_set_window_size). */ -#ifndef NS_IMPL_GNUSTEP if (cols > 0 && rows > 0) { if (ns_in_resize) @@ -5539,7 +5574,6 @@ not_in_argv (NSString *arg) [self updateFrameSize: YES]; } } -#endif ns_send_appdefined (-1); } @@ -5661,7 +5695,7 @@ not_in_argv (NSString *arg) wr = [win frame]; bwidth = f->border_width = wr.size.width - r.size.width; - tbar_height = FRAME_NS_TITLEBAR_HEIGHT (f) = wr.size.height - r.size.height; + tibar_height = FRAME_NS_TITLEBAR_HEIGHT (f) = wr.size.height - r.size.height; [win setAcceptsMouseMovedEvents: YES]; [win setDelegate: self]; @@ -5870,8 +5904,16 @@ not_in_argv (NSString *arg) - (void)windowDidEnterFullScreen:(NSNotification *)notification { [self setFSValue: FULLSCREEN_BOTH]; -#ifndef NEW_STYLE_FS +#ifdef NEW_STYLE_FS + // Fix bad background. + if ([toolbar isVisible]) + { + [toolbar setVisible:NO]; + [toolbar setVisible:YES]; + } +#else [self windowDidBecomeKey:notification]; + [nonfs_window orderOut:self]; #endif } @@ -5891,11 +5933,6 @@ not_in_argv (NSString *arg) - (void)toggleFullScreen: (id)sender { - /* Bugs remain: - 1) Having fullscreen in initial/default frame alist. - 2) Fullscreen in default frame alist only applied to first frame. - */ - #ifdef NEW_STYLE_FS [[self window] toggleFullScreen:sender]; #else @@ -5904,7 +5941,7 @@ not_in_argv (NSString *arg) isEqual:[[NSScreen screens] objectAtIndex:0]]; struct frame *f = emacsframe; NSSize sz; - NSRect r; + NSRect r, wr = [w frame]; NSColor *col = ns_lookup_indexed_color (NS_FACE_BACKGROUND (FRAME_DEFAULT_FACE (f)), f); @@ -5930,7 +5967,7 @@ not_in_argv (NSString *arg) } fw = [[EmacsFSWindow alloc] - initWithContentRect:[w contentRectForFrameRect:[w frame]] + initWithContentRect:[w contentRectForFrameRect:wr] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES @@ -5938,9 +5975,7 @@ not_in_argv (NSString *arg) [fw setContentView:[w contentView]]; [fw setTitle:[w title]]; - [fw makeKeyAndOrderFront:NSApp]; [fw setDelegate:self]; - [fw makeFirstResponder:self]; [fw setAcceptsMouseMovedEvents: YES]; [fw useOptimizedDrawing: YES]; [fw setResizeIncrements: sz]; @@ -5950,18 +5985,26 @@ not_in_argv (NSString *arg) f->border_width = 0; FRAME_NS_TITLEBAR_HEIGHT (f) = 0; + tobar_height = FRAME_TOOLBAR_HEIGHT (f); + FRAME_TOOLBAR_HEIGHT (f) = 0; + FRAME_EXTERNAL_TOOL_BAR (f) = 0; nonfs_window = w; + [self windowWillEnterFullScreen:nil]; + [fw makeKeyAndOrderFront:NSApp]; + [fw makeFirstResponder:self]; [w orderOut:self]; r = [fw frameRectForContentRect:[[fw screen] frame]]; [fw setFrame: r display:YES animate:YES]; [self windowDidEnterFullScreen:nil]; + [fw display]; } else { fw = w; w = nonfs_window; + nonfs_window = nil; if (onFirstScreen) { @@ -5980,7 +6023,10 @@ not_in_argv (NSString *arg) [w setOpaque: NO]; f->border_width = bwidth; - FRAME_NS_TITLEBAR_HEIGHT (f) = tbar_height; + FRAME_NS_TITLEBAR_HEIGHT (f) = tibar_height; + FRAME_TOOLBAR_HEIGHT (f) = tobar_height; + if (tobar_height) + FRAME_EXTERNAL_TOOL_BAR (f) = 1; [self windowWillExitFullScreen:nil]; [fw setFrame: [w frame] display:YES animate:YES]; @@ -6553,6 +6599,11 @@ not_in_argv (NSString *arg) return YES; } +- (BOOL)canBecomeMainWindow +{ + return YES; +} + @end /* ========================================================================== -- cgit v1.2.1 From 685f87b00f477c8072bcd15818d9564e7b7d8808 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 6 Oct 2012 13:34:57 -0400 Subject: * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Improve docstring. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/cl-loaddefs.el | 7 ++++--- lisp/emacs-lisp/cl-macs.el | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 292a536f2c9..e4597b072fb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-06 Stefan Monnier + * emacs-lisp/cl-macs.el (cl-defstruct): Improve docstring. + * subr.el (read-passwd-map): New var. (read-passwd): Use `read-string' again. * minibuffer.el (delete-minibuffer-contents): Make it interactive. diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 922c9856208..e25ac5f9708 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "da92f58f688ff6fb4d0098eb0f3acf0b") +;;;;;; "cl-macs" "cl-macs.el" "6951d080daefb5194b1d21fe9b2deae4") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ @@ -657,8 +657,9 @@ copier, a `NAME-p' predicate, and slot accessors named `NAME-SLOT'. You can use the accessors to set the corresponding slots, via `setf'. NAME may instead take the form (NAME OPTIONS...), where each -OPTION is either a single keyword or (KEYWORD VALUE). -See Info node `(cl)Structures' for a list of valid keywords. +OPTION is either a single keyword or (KEYWORD VALUE) where +KEYWORD can be one of :conc-name, :constructor, :copier, :predicate, +:type, :named, :initial-offset, :print-function, or :include. Each SLOT may instead take the form (SLOT SLOT-OPTS...), where SLOT-OPTS are keyword-value pairs for that slot. Currently, only diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 56e698bec0a..99bae1944e8 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2154,8 +2154,9 @@ copier, a `NAME-p' predicate, and slot accessors named `NAME-SLOT'. You can use the accessors to set the corresponding slots, via `setf'. NAME may instead take the form (NAME OPTIONS...), where each -OPTION is either a single keyword or (KEYWORD VALUE). -See Info node `(cl)Structures' for a list of valid keywords. +OPTION is either a single keyword or (KEYWORD VALUE) where +KEYWORD can be one of :conc-name, :constructor, :copier, :predicate, +:type, :named, :initial-offset, :print-function, or :include. Each SLOT may instead take the form (SLOT SLOT-OPTS...), where SLOT-OPTS are keyword-value pairs for that slot. Currently, only -- cgit v1.2.1 From f1f4dba09f9c42fc61c5bb3bf4f1e7214a2513ca Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 11:34:23 -0700 Subject: Rename a new cal-tex function, document it * lisp/calendar/cal-tex.el (cal-tex-diary, cal-tex-cursor-week) (cal-tex-cursor-week2, cal-tex-cursor-week-iso) (cal-tex-cursor-week-monday): Doc fixes. (cal-tex-cursor-week2-summary): Doc fix. Rename from cal-tex-cursor-week-at-a-glance. * lisp/calendar/calendar.el (calendar-mode-map): Add cal-tex-cursor-week2-summary. * lisp/calendar/cal-menu.el (cal-menu-context-mouse-menu): Tweak week descriptions. Add cal-tex-cursor-week2-summary. * doc/emacs/calendar.texi (Writing Calendar Files): Tweak week descriptions. Mention cal-tex-cursor-week2-summary. --- doc/emacs/ChangeLog | 5 +++ doc/emacs/calendar.texi | 11 ++++--- etc/NEWS | 3 ++ lisp/ChangeLog | 14 ++++++++ lisp/calendar/cal-menu.el | 9 +++--- lisp/calendar/cal-tex.el | 81 ++++++++++++++++++++++++++++------------------- lisp/calendar/calendar.el | 5 +-- 7 files changed, 85 insertions(+), 43 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 60b3bf234f7..067574b9a0d 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2012-10-06 Glenn Morris + + * calendar.texi (Writing Calendar Files): Tweak week descriptions. + Mention cal-tex-cursor-week2-summary. + 2012-10-06 Chong Yidong * mini.texi (Passwords): Fix typo. diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index fdf1c65fcd6..d46e26cddcf 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -396,17 +396,20 @@ Generate a sideways-printing one-month calendar Generate a one-day calendar (@code{cal-tex-cursor-day}). @item t w 1 -Generate a one-page calendar for one week +Generate a one-page calendar for one week, with hours (@code{cal-tex-cursor-week}). @item t w 2 -Generate a two-page calendar for one week +Generate a two-page calendar for one week, with hours (@code{cal-tex-cursor-week2}). @item t w 3 -Generate an ISO-style calendar for one week +Generate an ISO-style calendar for one week, without hours (@code{cal-tex-cursor-week-iso}). @item t w 4 -Generate a calendar for one Monday-starting week +Generate a calendar for one Monday-starting week, with hours (@code{cal-tex-cursor-week-monday}). +@item t w W +Generate a two-page calendar for one week, without hours +(@code{cal-tex-cursor-week2-summary}). @item t f w Generate a Filofax-style two-weeks-at-a-glance calendar (@code{cal-tex-cursor-filofax-2week}). diff --git a/etc/NEWS b/etc/NEWS index be75b665c1d..e4086bf038e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -281,6 +281,9 @@ Use `Buffer-menu-name-width' and `Buffer-menu-size-width' instead. *** You can customize the header text that appears above each calendar month. See the variable `calendar-month-header'. ++++ +*** New LaTeX calendar style, produced by `cal-tex-cursor-week2-summary'. + *** The calendars produced by cal-html include holidays. Customize cal-html-holidays to change this. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e4597b072fb..42835b59a26 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2012-10-06 Glenn Morris + + * calendar/cal-tex.el (cal-tex-diary, cal-tex-cursor-week) + (cal-tex-cursor-week2, cal-tex-cursor-week-iso) + (cal-tex-cursor-week-monday): Doc fixes. + (cal-tex-cursor-week2-summary): Doc fix. + Rename from cal-tex-cursor-week-at-a-glance. + + * calendar/cal-menu.el (cal-menu-context-mouse-menu): + Tweak week descriptions. Add cal-tex-cursor-week2-summary. + + * calendar/calendar.el (calendar-mode-map): + Add cal-tex-cursor-week2-summary. + 2012-10-06 Stefan Monnier * emacs-lisp/cl-macs.el (cl-defstruct): Improve docstring. diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index d4546125f3e..52c82b661e8 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el @@ -237,10 +237,11 @@ is non-nil." ;; These did not work if called without calendar window selected. ("Prepare LaTeX buffer" ["Daily (1 page)" cal-tex-cursor-day] - ["Weekly (1 page)" cal-tex-cursor-week] - ["Weekly (2 pages)" cal-tex-cursor-week2] - ["Weekly (other style; 1 page)" cal-tex-cursor-week-iso] - ["Weekly (yet another style; 1 page)" cal-tex-cursor-week-monday] + ["Weekly (1 page, with hours)" cal-tex-cursor-week] + ["Weekly (2 pages, with hours)" cal-tex-cursor-week2] + ["Weekly (1 page, no hours)" cal-tex-cursor-week-iso] + ["Weekly (1 page, with hours, different style)" cal-tex-cursor-week-monday] + ["Weekly (2 pages, no hours)" cal-tex-cursor-week2-summary] ["Monthly" cal-tex-cursor-month] ["Monthly (landscape)" cal-tex-cursor-month-landscape] ["Yearly" cal-tex-cursor-year] diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 325ac3e8146..e4c2765940a 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -37,6 +37,7 @@ ;; cal-tex-cursor-month ;; cal-tex-cursor-week ;; cal-tex-cursor-week2 +;; cal-tex-cursor-week2-summary ;; cal-tex-cursor-week-iso ;; cal-tex-cursor-week-monday ;; cal-tex-cursor-filofax-2week @@ -82,8 +83,6 @@ Setting this to nil may speed up calendar generation." (defcustom cal-tex-diary nil "Non-nil means diary entries are printed in LaTeX calendars that support it. -At present, this only affects the monthly, filofax, and iso-week -calendars (i.e. not the yearly, plain weekly, or daily calendars). Setting this to nil may speed up calendar generation." :type 'boolean :group 'calendar-tex) @@ -717,11 +716,15 @@ this is only an upper bound." ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours). ;;;###cal-autoload (defun cal-tex-cursor-week (&optional n event) - "Make a LaTeX calendar buffer for a two-page one-week calendar. -It applies to the week that point is in. The optional prefix -argument N specifies number of weeks (default 1). The calendar -shows holidays if `cal-tex-holidays' is non-nil (note that diary -entries are not shown). The calendar shows the hours 8-12am, 1-5pm." + "Make a one page LaTeX calendar for one week, showing hours of the day. +There are two columns; with 8-12am in the first and 1-5pm in the second. +It shows holidays if `cal-tex-holidays' is non-nil. +It does not show diary entries. + +The optional prefix argument N specifies a number of weeks (default 1). + +By default, the calendar is for the week at point; the optional +argument EVENT specifies a different buffer position." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (or n (setq n 1)) @@ -768,12 +771,15 @@ entries are not shown). The calendar shows the hours 8-12am, 1-5pm." ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours). ;;;###cal-autoload (defun cal-tex-cursor-week2 (&optional n event) - "Make a LaTeX calendar buffer for a two-page one-week calendar. -It applies to the week that point is in. Optional prefix -argument N specifies number of weeks (default 1). The calendar -shows holidays if `cal-tex-holidays' is non-nil (note that diary -entries are not shown). The calendar shows the hours 8-12am, 1-5pm. -Optional EVENT indicates a buffer position to use instead of point." + "Make a two page LaTeX calendar for one week, showing hours of the day. +There are two columns; with 8-12am in the first and 1-5pm in the second. +It shows holidays if `cal-tex-holidays' is non-nil. +It does not show diary entries. + +The optional prefix argument N specifies a number of weeks (default 1). + +By default, the calendar is for the week at point; the optional +argument EVENT specifies a different buffer position." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (or n (setq n 1)) @@ -848,12 +854,15 @@ Optional EVENT indicates a buffer position to use instead of point." ;;;###cal-autoload (defun cal-tex-cursor-week-iso (&optional n event) - "Make a LaTeX calendar buffer for a one page ISO-style weekly calendar. -Optional prefix argument N specifies number of weeks (default 1). -The calendar shows holiday and diary entries if -`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. -It does not show hours of the day. Optional EVENT indicates a buffer -position to use instead of point." + "Make a one page LaTeX calendar for one week, in the ISO-style. +It does not show hours of the day. +It shows holidays if `cal-tex-holidays' is non-nil. +It shows diary entries if `cal-tex-diary' is non-nil. + +The optional prefix argument N specifies a number of weeks (default 1). + +By default, the calendar is for the week at point; the optional +argument EVENT specifies a different buffer position." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (or n (setq n 1)) @@ -976,13 +985,16 @@ shown are hard-coded to 8-12, 13-17." ;; TODO respect cal-tex-daily-start,end (see cal-tex-weekly4-box). ;;;###cal-autoload (defun cal-tex-cursor-week-monday (&optional n event) - "Make a LaTeX calendar buffer for a two-page one-week calendar. -It applies to the week that point is in, and starts on Monday. -Optional prefix argument N specifies number of weeks (default 1). -The calendar shows holidays if `cal-tex-holidays' is -non-nil (note that diary entries are not shown). The calendar shows -the hours 8-12am, 1-5pm. Optional EVENT indicates a buffer position -to use instead of point." + "Make a one page LaTeX calendar for one week, showing hours of the day. +There are two columns; with M-W in the first and T-S in the second. +It shows the hours 8-12am and 1-5pm. +It shows holidays if `cal-tex-holidays' is non-nil. +It does not show diary entries. + +The optional prefix argument N specifies a number of weeks (default 1). + +By default, the calendar is for the week at point; the optional +argument EVENT specifies a different buffer position." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (or n (setq n 1)) @@ -1203,13 +1215,16 @@ shown are hard-coded to 8-12, 13-17." (run-hooks 'cal-tex-hook))) ;;;###cal-autoload -(defun cal-tex-cursor-week-at-a-glance (&optional n event) - "One-week-at-a-glance full page calendar for week indicated by cursor. -Optional prefix argument N specifies number of weeks (default 1), -starting on Mondays. The calendar shows holiday and diary entries -if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. -It does not show hours of the day. Optional EVENT indicates a buffer -position to use instead of point." +(defun cal-tex-cursor-week2-summary (&optional n event) + "Make a two page LaTeX calendar for one week, with optional diary entries. +It does not show hours of the day. +It shows holidays if `cal-tex-holidays' is non-nil. +It shows diary entries if `cal-tex-diary' is non-nil. + +The optional prefix argument N specifies a number of weeks (default 1). + +By default, the calendar is for the week at point; the optional +argument EVENT specifies a different buffer position." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (cal-tex-weekly-common n event)) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 6f8311f4c55..96a5725ef69 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1683,8 +1683,9 @@ line." (define-key map "td" 'cal-tex-cursor-day) (define-key map "tw1" 'cal-tex-cursor-week) (define-key map "tw2" 'cal-tex-cursor-week2) - (define-key map "tw3" 'cal-tex-cursor-week-iso) - (define-key map "tw4" 'cal-tex-cursor-week-monday) + (define-key map "tw3" 'cal-tex-cursor-week-iso) ; FIXME twi ? + (define-key map "tw4" 'cal-tex-cursor-week-monday) ; twm ? + (define-key map "twW" 'cal-tex-cursor-week2-summary) (define-key map "tfd" 'cal-tex-cursor-filofax-daily) (define-key map "tfw" 'cal-tex-cursor-filofax-2week) (define-key map "tfW" 'cal-tex-cursor-filofax-week) -- cgit v1.2.1 From 27359e9976597097d92791b79c65cb10411c8658 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 12:50:29 -0700 Subject: ChangeLog fix --- lisp/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42835b59a26..f2cda6f9f6a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1592,7 +1592,7 @@ 2012-09-08 Jambunathan K * register.el (register): New group. - (register-separator): New user option. + (separator-register): New user option. (increment-register): Route it to `append-to-register', if register contains text. Implication is that `C-x r +' can now be used for appending to a text register (bug#12217). -- cgit v1.2.1 From d1aae61450d42c7ce84ae7df9e35628f0f221a19 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 12:55:47 -0700 Subject: Aliases to defcustoms must come before the defcustom. * strokes.el (strokes-modeline-string): * emulation/crisp.el (crisp-mode-modeline-string): * eshell/esh-mode.el (eshell-status-in-modeline): Aliases to defcustoms must come before the defcustom. --- lisp/ChangeLog | 5 +++++ lisp/emulation/crisp.el | 6 +++--- lisp/eshell/esh-mode.el | 6 +++--- lisp/strokes.el | 5 +++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f2cda6f9f6a..07f68f155c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-10-06 Glenn Morris + * strokes.el (strokes-modeline-string): + * emulation/crisp.el (crisp-mode-modeline-string): + * eshell/esh-mode.el (eshell-status-in-modeline): + Aliases to defcustoms must come before the defcustom. + * calendar/cal-tex.el (cal-tex-diary, cal-tex-cursor-week) (cal-tex-cursor-week2, cal-tex-cursor-week-iso) (cal-tex-cursor-week-monday): Doc fixes. diff --git a/lisp/emulation/crisp.el b/lisp/emulation/crisp.el index c9822b7ec27..01d202f87b5 100644 --- a/lisp/emulation/crisp.el +++ b/lisp/emulation/crisp.el @@ -171,14 +171,14 @@ All the bindings are done here instead of globally to try and be nice to the world.") +(define-obsolete-variable-alias 'crisp-mode-modeline-string + 'crisp-mode-mode-line-string "24.3") + (defcustom crisp-mode-mode-line-string " *CRiSP*" "String to display in the mode line when CRiSP emulation mode is enabled." :type 'string :group 'crisp) -(define-obsolete-variable-alias 'crisp-mode-modeline-string - 'crisp-mode-mode-line-string "24.3") - ;;;###autoload (defcustom crisp-mode nil "Track status of CRiSP emulation mode. diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 8a9107e5470..673632400f2 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -193,14 +193,14 @@ This is used by `eshell-watch-for-password-prompt'." :type '(choice (const nil) function) :group 'eshell-mode) +(define-obsolete-variable-alias 'eshell-status-in-modeline + 'eshell-status-in-mode-line "24.3") + (defcustom eshell-status-in-mode-line t "If non-nil, let the user know a command is running in the mode line." :type 'boolean :group 'eshell-mode) -(define-obsolete-variable-alias 'eshell-status-in-modeline - 'eshell-status-in-mode-line "24.3") - (defvar eshell-first-time-p t "A variable which is non-nil the first time Eshell is loaded.") diff --git a/lisp/strokes.el b/lisp/strokes.el index 62a8528f25d..9a3a7608d2b 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -212,13 +212,14 @@ static char * stroke_xpm[] = { :link '(emacs-commentary-link "strokes") :group 'mouse) +(define-obsolete-variable-alias 'strokes-modeline-string 'strokes-lighter + "24.3") + (defcustom strokes-lighter " Strokes" "Mode line identifier for Strokes mode." :type 'string :group 'strokes) -(define-obsolete-variable-alias 'strokes-modeline-string 'strokes-lighter "24.3") - (defcustom strokes-character ?@ "Character used when drawing strokes in the strokes buffer. \(The default is `@', which works well.\)" -- cgit v1.2.1 From ef35abb4ad34ef7038ee99742c8646fc6f9914ed Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 13:05:39 -0700 Subject: * timeclock.el (timeclock-modeline-display): Add missing obsolete alias --- lisp/ChangeLog | 3 +++ lisp/calendar/timeclock.el | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07f68f155c3..65754ab089e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-06 Glenn Morris + * calendar/timeclock.el (timeclock-modeline-display): + Add missing obsolete alias for renamed user option. + * strokes.el (strokes-modeline-string): * emulation/crisp.el (crisp-mode-modeline-string): * eshell/esh-mode.el (eshell-status-in-modeline): diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 3151ce145de..7e7a737549f 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -321,6 +321,9 @@ display (non-nil means on)." (force-mode-line-update) (setq timeclock-mode-line-display on-p))) +(define-obsolete-variable-alias 'timeclock-modeline-display + 'timeclock-mode-line-display "24.3") + ;; This has to be here so that the function definition of ;; `timeclock-mode-line-display' is known to the "set" function. (defcustom timeclock-mode-line-display nil -- cgit v1.2.1 From d1a1c7e649e0ad44f1426abce72a5ff45a07e8fc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 13:30:26 -0700 Subject: Add missing :version tags * profiler.el (profiler): Add missing group :version tag. * avoid.el (mouse-avoidance-banish-position): * proced.el (proced-renice-command): * calc/calc.el (calc-ensure-consistent-units): * calendar/icalendar.el (icalendar-import-format-uid): * net/tramp.el (tramp-save-ad-hoc-proxies): * progmodes/bug-reference.el (bug-reference-bug-regexp): * progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-fringe-indicator-position): * progmodes/sh-script.el (sh-indent-after-continuation): * progmodes/verilog-mode.el (verilog-auto-template-warn-unused) (verilog-before-save-font-hook, verilog-after-save-font-hook): * progmodes/vhdl-mode.el (vhdl-makefile-default-targets) (vhdl-array-index-record-field-in-sensitivity-list) (vhdl-indent-comment-like-next-code-line): * textmodes/reftex-vars.el (reftex-ref-style-alist) (reftex-ref-macro-prompt, reftex-ref-style-default-list) (reftex-cite-key-separator, reftex-create-bibtex-header) (reftex-create-bibtex-footer): * textmodes/rst.el (rst-new-adornment-down, rst-indent-field) (rst-indent-literal-normal, rst-indent-literal-minimized) (rst-indent-comment): Add missing custom :version tags. * cedet/semantic/complete.el (semantic-displayor-tooltip-mode) (semantic-displayor-tooltip-initial-max-tags) (semantic-displayor-tooltip-max-tags): Add missing custom :version tags. * cedet/ede/linux.el (project-linux): Add missing group :version tag. * cedet/semantic/complete.el (semantic-displayor-tooltip-max-tags): Doc fix. * erc/erc.el (erc-lurker): * erc/erc-desktop-notifications.el (erc-notifications): Add missing group :version tags. * gnus/gnus-notifications.el (gnus-notifications): Add missing group :version tag. * gnus/gnus-msg.el (gnus-gcc-pre-body-encode-hook) (gnus-gcc-post-body-encode-hook): * gnus/gnus-sync.el (gnus-sync-lesync-name) (gnus-sync-lesync-install-topics): Add missing custom :version tags. --- lisp/ChangeLog | 23 +++++++++++++++++++++++ lisp/avoid.el | 1 + lisp/calc/calc.el | 1 + lisp/calendar/icalendar.el | 1 + lisp/cedet/ChangeLog | 9 +++++++++ lisp/cedet/ede/linux.el | 2 +- lisp/cedet/semantic/complete.el | 22 ++++++++++++---------- lisp/erc/ChangeLog | 9 +++++++-- lisp/erc/erc-desktop-notifications.el | 1 + lisp/erc/erc.el | 1 + lisp/gnus/ChangeLog | 9 +++++++++ lisp/gnus/gnus-msg.el | 2 ++ lisp/gnus/gnus-notifications.el | 1 + lisp/gnus/gnus-sync.el | 4 +++- lisp/net/tramp.el | 1 + lisp/proced.el | 1 + lisp/profiler.el | 1 + lisp/progmodes/bug-reference.el | 1 + lisp/progmodes/flymake.el | 3 +++ lisp/progmodes/sh-script.el | 1 + lisp/progmodes/verilog-mode.el | 3 +++ lisp/progmodes/vhdl-mode.el | 3 +++ lisp/textmodes/reftex-vars.el | 6 ++++++ lisp/textmodes/rst.el | 5 +++++ 24 files changed, 97 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 65754ab089e..861038b17bd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,28 @@ 2012-10-06 Glenn Morris + * profiler.el (profiler): Add missing group :version tag. + * avoid.el (mouse-avoidance-banish-position): + * proced.el (proced-renice-command): + * calc/calc.el (calc-ensure-consistent-units): + * calendar/icalendar.el (icalendar-import-format-uid): + * net/tramp.el (tramp-save-ad-hoc-proxies): + * progmodes/bug-reference.el (bug-reference-bug-regexp): + * progmodes/flymake.el (flymake-error-bitmap) + (flymake-warning-bitmap, flymake-fringe-indicator-position): + * progmodes/sh-script.el (sh-indent-after-continuation): + * progmodes/verilog-mode.el (verilog-auto-template-warn-unused) + (verilog-before-save-font-hook, verilog-after-save-font-hook): + * progmodes/vhdl-mode.el (vhdl-makefile-default-targets) + (vhdl-array-index-record-field-in-sensitivity-list) + (vhdl-indent-comment-like-next-code-line): + * textmodes/reftex-vars.el (reftex-ref-style-alist) + (reftex-ref-macro-prompt, reftex-ref-style-default-list) + (reftex-cite-key-separator, reftex-create-bibtex-header) + (reftex-create-bibtex-footer): + * textmodes/rst.el (rst-new-adornment-down, rst-indent-field) + (rst-indent-literal-normal, rst-indent-literal-minimized) + (rst-indent-comment): Add missing custom :version tags. + * calendar/timeclock.el (timeclock-modeline-display): Add missing obsolete alias for renamed user option. diff --git a/lisp/avoid.el b/lisp/avoid.el index 2fa6ef39e70..7f4b78bf5e0 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -128,6 +128,7 @@ SIDE-POS: Distance from right or left edge of frame or window. TOP-OR-BOTTOM: banish the mouse to top or bottom of frame or window. TOP-OR-BOTTOM-POS: Distance from top or bottom edge of frame or window." :group 'avoid + :version "24.3" :type '(alist :key-type symbol :value-type symbol) :options '(frame-or-window side (side-pos integer) top-or-bottom (top-or-bottom-pos integer))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 25f591a3945..f1643b10a76 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -423,6 +423,7 @@ in normal mode." "If non-nil, make sure new units are consistent with current units when converting units." :group 'calc + :version "24.3" :type 'boolean) (defcustom calc-undo-length diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 39b83d4c831..27e7261263e 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -186,6 +186,7 @@ the URL." This applies only if the UID is not empty! `%s' is replaced by the UID." :type 'string + :version "24.3" :group 'icalendar) (defcustom icalendar-import-format-status diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 9e20b4fbb4e..ff5b603833d 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,3 +1,12 @@ +2012-10-06 Glenn Morris + + * semantic/complete.el (semantic-displayor-tooltip-max-tags): Doc fix. + + * semantic/complete.el (semantic-displayor-tooltip-mode) + (semantic-displayor-tooltip-initial-max-tags) + (semantic-displayor-tooltip-max-tags): Add missing custom :version tags. + * ede/linux.el (project-linux): Add missing group :version tag. + 2012-10-06 Chong Yidong * semantic/bovine/grammar.el: diff --git a/lisp/cedet/ede/linux.el b/lisp/cedet/ede/linux.el index 7cd066f8b3b..5c708039ec4 100644 --- a/lisp/cedet/ede/linux.el +++ b/lisp/cedet/ede/linux.el @@ -44,7 +44,7 @@ "File and tag browser frame." :group 'tools :group 'ede - ) + :version "24.3") (defcustom project-linux-compile-target-command (concat ede-make-command " -k -C %s SUBDIRS=%s") "*Default command used to compile a target." diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index 61760dd3fe8..9c2da9faefa 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -1564,6 +1564,7 @@ Verbose: Always show all completions available. The absolute maximum number of completions for all mode is determined through `semantic-displayor-tooltip-max-tags'." :group 'semantic + :version "24.3" :type '(choice (const :tag "Standard" standard) (const :tag "Quiet" quiet) (const :tag "Verbose" verbose))) @@ -1573,24 +1574,25 @@ determined through `semantic-displayor-tooltip-max-tags'." "Maximum number of tags to be displayed initially. See doc-string of `semantic-displayor-tooltip-mode' for details." :group 'semantic + :version "24.3" :type 'integer) (defcustom semantic-displayor-tooltip-max-tags 25 - "The maximum number of tags to be displayed. + "The maximum number of tags to be displayed. Maximum number of completions where we have activated the extended completion list through typing TAB or SPACE multiple times. This limit needs to fit on your screen! Note: If available, customizing this variable increases -'x-max-tooltip-size' to force over-sized tooltips when necessary. -This will not happen if you directly set this variable via -`setq'." - :group 'semantic - :type 'integer - :set '(lambda (sym var) - (set-default sym var) - (when (boundp 'x-max-tooltip-size) - (setcdr x-max-tooltip-size (max (1+ var) (cdr x-max-tooltip-size)))))) +`x-max-tooltip-size' to force over-sized tooltips when necessary. +This will not happen if you directly set this variable via `setq'." + :group 'semantic + :version "24.3" + :type 'integer + :set '(lambda (sym var) + (set-default sym var) + (when (boundp 'x-max-tooltip-size) + (setcdr x-max-tooltip-size (max (1+ var) (cdr x-max-tooltip-size)))))) (defclass semantic-displayor-tooltip (semantic-displayor-traditional) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 3558a8a90b5..9be0d3241ad 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,9 @@ +2012-10-06 Glenn Morris + + * erc.el (erc-lurker): + * erc-desktop-notifications.el (erc-notifications): + Add missing group :version tags. + 2012-10-04 Julien Danjou * erc-desktop-notifications.el: Rename from erc-notifications to @@ -9,8 +15,7 @@ 2012-09-17 Chong Yidong - * erc-page.el (erc-page-function): - + * erc-page.el (erc-page-function): * erc-stamp.el (erc-stamp): Doc fix. 2012-08-21 Josh Feinstein diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el index 57b93f43219..2cc3c80a8ea 100644 --- a/lisp/erc/erc-desktop-notifications.el +++ b/lisp/erc/erc-desktop-notifications.el @@ -35,6 +35,7 @@ (defgroup erc-notifications nil "Send notifications on PRIVMSG or mentions." + :version "24.3" :group 'erc) (defvar erc-notifications-last-notification nil diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 687e60da28a..bbd9dad4310 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -102,6 +102,7 @@ (defgroup erc-lurker nil "Hide specified message types sent by lurkers" + :version "24.3" :group 'erc-ignore) (defgroup erc-query nil diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 983d09e2589..f79353ebfb3 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,12 @@ +2012-10-06 Glenn Morris + + * gnus-notifications.el (gnus-notifications): + Add missing group :version tag. + * gnus-msg.el (gnus-gcc-pre-body-encode-hook) + (gnus-gcc-post-body-encode-hook): + * gnus-sync.el (gnus-sync-lesync-name) + (gnus-sync-lesync-install-topics): Add missing custom :version tags. + 2012-09-25 Katsumi Yamaoka * gnus-art.el (gnus-article-browse-delete-temp-files): Never ask again diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index c2f79e70d1e..77bb6281bc4 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -319,6 +319,7 @@ The current buffer (when the hook is run) contains the message including the message header. Changes made to the message will only affect the Gcc copy, but not the original message." :group 'gnus-message + :version "24.3" :type 'hook) (defcustom gnus-gcc-post-body-encode-hook nil @@ -327,6 +328,7 @@ The current buffer (when the hook is run) contains the message including the message header. Changes made to the message will only affect the Gcc copy, but not the original message." :group 'gnus-message + :version "24.3" :type 'hook) (autoload 'gnus-message-citation-mode "gnus-cite" nil t) diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index 5104a56c6e7..3848dee8d4f 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el @@ -42,6 +42,7 @@ (defgroup gnus-notifications nil "Send notifications on new message in Gnus." + :version "24.3" :group 'gnus) (defcustom gnus-notifications-use-google-contacts t diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el index ca8662ff936..b5f8379e367 100644 --- a/lisp/gnus/gnus-sync.el +++ b/lisp/gnus/gnus-sync.el @@ -134,11 +134,13 @@ and `gnus-topic-alist'. Also see `gnus-variable-list'." (defcustom gnus-sync-lesync-name (system-name) "The LeSync name for this machine." :group 'gnus-sync + :version "24.3" :type 'string) -(defcustom gnus-sync-lesync-install-topics 'ask +(defcustom gnus-sync-lesync-install-topics 'ask "Should LeSync install the recorded topics?" :group 'gnus-sync + :version "24.3" :type '(choice (const :tag "Never Install" nil) (const :tag "Always Install" t) (const :tag "Ask Me Once" ask))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 019ab1eef0f..b1532eb2ae4 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -403,6 +403,7 @@ interpreted as a regular expression which always matches." (defcustom tramp-save-ad-hoc-proxies nil "Whether to save ad-hoc proxies persistently." :group 'tramp + :version "24.3" :type 'boolean) (defcustom tramp-restricted-shell-hosts-alist diff --git a/lisp/proced.el b/lisp/proced.el index ec41ce65ef5..e3ff9fb5c95 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -68,6 +68,7 @@ the external command (usually \"kill\")." (defcustom proced-renice-command "renice" "Name of renice command." :group 'proced + :version "24.3" :type '(string :tag "command")) (defcustom proced-signal-list diff --git a/lisp/profiler.el b/lisp/profiler.el index 5e605957833..e9261eb1af7 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -29,6 +29,7 @@ (defgroup profiler nil "Emacs profiler." :group 'lisp + :version "24.3" :prefix "profiler-") (defconst profiler-version "24.3") diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 97fcb6874dd..3561105e59d 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -74,6 +74,7 @@ so that it is considered safe, see `enable-local-variables'.") The second subexpression should match the bug reference (usually a number)." :type 'string :safe 'stringp + :version "24.3" ; previously defconst :group 'bug-reference) (defun bug-reference-set-overlay-properties () diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 10d5fdf9c64..26d4a399c2d 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -768,6 +768,7 @@ line number outside the file being compiled." The value may also be a list of two elements where the second element specifies the face for the bitmap." :group 'flymake + :version "24.3" :type 'symbol) (defcustom flymake-warning-bitmap 'question-mark @@ -775,6 +776,7 @@ element specifies the face for the bitmap." The value may also be a list of two elements where the second element specifies the face for the bitmap." :group 'flymake + :version "24.3" :type 'symbol) (defcustom flymake-fringe-indicator-position 'left-fringe @@ -782,6 +784,7 @@ element specifies the face for the bitmap." The value can be nil, left-fringe or right-fringe. Fringe indicators are disabled if nil." :group 'flymake + :version "24.3" :type '(choice (const left-fringe) (const right-fringe) (const :tag "No fringe indicators" nil))) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index e94919ee2a9..16acf2547a2 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1767,6 +1767,7 @@ Does not preserve point." (defcustom sh-indent-after-continuation t "If non-nil, try to make sure text is indented after a line continuation." + :version "24.3" :type 'boolean) (defun sh-smie--continuation-start-indent () diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 8c4167b6724..6ffe88f721e 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -1159,6 +1159,7 @@ See the \\[verilog-faq] for examples on using this." "Non-nil means report warning if an AUTO_TEMPLATE line is not used. This feature is not supported before Emacs 21.1 or XEmacs 21.4." :group 'verilog-mode-auto + :version "24.3" :type 'boolean) (put 'verilog-auto-template-warn-unused 'safe-local-variable 'verilog-booleanp) @@ -1230,11 +1231,13 @@ For example, \"_t$\" matches typedefs named with _t, as in the C language." (defcustom verilog-before-save-font-hook nil "Hook run before `verilog-save-font-mods' removes highlighting." :group 'verilog-mode-auto + :version "24.3" :type 'hook) (defcustom verilog-after-save-font-hook nil "Hook run after `verilog-save-font-mods' restores highlighting." :group 'verilog-mode-auto + :version "24.3" :type 'hook) (defvar verilog-imenu-generic-expression diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 52757b9eede..6ad7d3b168a 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -483,6 +483,7 @@ with other user Makefiles." :type '(list (string :tag "Compile entire design") (string :tag "Clean entire design ") (string :tag "Create design library")) + :version "24.3" :group 'vhdl-compile) (defcustom vhdl-makefile-generation-hook nil @@ -772,6 +773,7 @@ index, the record field or array index is included with the record name in the sensitivity list (e.g. \"in1(0)\", \"in2.f0\"). Otherwise, only the record name is included (e.g. \"in1\", \"in2\")." :type 'boolean + :version "24.3" :group 'vhdl-style) (defgroup vhdl-naming nil @@ -1849,6 +1851,7 @@ Otherwise, comment lines are indented like the preceding code line. Indenting comment lines like the following code line gives nicer indentation when comments precede the code that they refer to." :type 'boolean + :version "24.3" :group 'vhdl-misc) (defcustom vhdl-word-completion-case-sensitive nil diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index df3d729adca..264d6e21839 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -968,6 +968,7 @@ the macro type is being prompted for. (See also `reftex-ref-macro-prompt'.) The keys, represented as characters, have to be unique." :group 'reftex-referencing-labels + :version "24.3" :type '(alist :key-type (string :tag "Style name") :value-type (group (choice :tag "Package" (const :tag "Any package" t) @@ -979,6 +980,7 @@ have to be unique." (defcustom reftex-ref-macro-prompt t "If non-nil, `reftex-reference' prompts for the reference macro." :group 'reftex-referencing-labels + :version "24.3" :type 'boolean) (defcustom reftex-vref-is-default nil @@ -1014,6 +1016,7 @@ can be cycled in the buffer for selecting a label. The entries in the list have to match the respective reference style names used in the variable `reftex-ref-style-alist'." :group 'reftex-referencing-labels + :version "24.3" :type `(set ,@(mapcar (lambda (x) (list 'const (car x))) reftex-ref-style-alist))) @@ -1257,16 +1260,19 @@ should return the string to insert into the buffer." (defcustom reftex-cite-key-separator "," "String to be used for separating several keys in a \\cite macro." :group 'reftex-citation-support + :version "24.3" :type 'string) (defcustom reftex-create-bibtex-header nil "Header to insert in BibTeX files generated by RefTeX." :group 'reftex-citation-support + :version "24.3" :type 'string) (defcustom reftex-create-bibtex-footer nil "Footer to insert in BibTeX files generated by RefTeX." :group 'reftex-citation-support + :version "24.3" :type 'string) ;; Index Support Configuration diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 869da63064a..202c36c2e4a 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -1545,6 +1545,7 @@ b. a negative numerical argument, which generally inverts the :type '(choice (const :tag "Same level as previous one" nil) (const :tag "One level down relative to the previous one" t)) + :version "24.3" :package-version '(rst . "1.1.0")) (rst-testcover-defcustom) @@ -2845,24 +2846,28 @@ here." (defcustom rst-indent-field 3 "Indentation for first line after a field or 0 to always indent for content." :group 'rst-indent + :version "24.3" :type '(integer)) (rst-testcover-defcustom) (defcustom rst-indent-literal-normal 3 "Default indentation for literal block after a markup on an own line." :group 'rst-indent + :version "24.3" :type '(integer)) (rst-testcover-defcustom) (defcustom rst-indent-literal-minimized 2 "Default indentation for literal block after a minimized markup." :group 'rst-indent + :version "24.3" :type '(integer)) (rst-testcover-defcustom) (defcustom rst-indent-comment 3 "Default indentation for first line of a comment." :group 'rst-indent + :version "24.3" :type '(integer)) (rst-testcover-defcustom) -- cgit v1.2.1 From 18dec75063c85fac15822929827356f7cdfc5b2d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 13:33:23 -0700 Subject: Clarify some rst.el obsolescence versions * lisp/textmodes/rst.el (rst-preferred-decorations) (rst-shift-basic-offset): Clarify obsolescence versions. --- lisp/ChangeLog | 3 +++ lisp/textmodes/rst.el | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 861038b17bd..53e38365b00 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-06 Glenn Morris + * textmodes/rst.el (rst-preferred-decorations) + (rst-shift-basic-offset): Clarify obsolescence versions. + * profiler.el (profiler): Add missing group :version tag. * avoid.el (mouse-avoidance-banish-position): * proced.el (proced-renice-command): diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 202c36c2e4a..02bb1e6371f 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -967,7 +967,7 @@ for modes derived from Text mode, like Mail mode." :version "21.1") (define-obsolete-variable-alias - 'rst-preferred-decorations 'rst-preferred-adornments "1.0.0") + 'rst-preferred-decorations 'rst-preferred-adornments "rst 1.0.0") (defcustom rst-preferred-adornments '((?= over-and-under 1) (?= simple 0) (?- simple 0) @@ -2836,7 +2836,7 @@ here." :package-version '(rst . "1.1.0")) (define-obsolete-variable-alias - 'rst-shift-basic-offset 'rst-indent-width "1.0.0") + 'rst-shift-basic-offset 'rst-indent-width "rst 1.0.0") (defcustom rst-indent-width 2 "Indentation when there is no more indentation point given." :group 'rst-indent -- cgit v1.2.1 From 67667c704b55444a23d4b84fb4735b5f809f0d32 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 13:34:45 -0700 Subject: * progmodes/sh-script.el (sh-indent-after-continuation): Add explicit :group. --- lisp/ChangeLog | 3 +++ lisp/progmodes/sh-script.el | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 53e38365b00..0bd07a9c48d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-06 Glenn Morris + * progmodes/sh-script.el (sh-indent-after-continuation): + Add explicit :group. + * textmodes/rst.el (rst-preferred-decorations) (rst-shift-basic-offset): Clarify obsolescence versions. diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 16acf2547a2..06ded5fb53d 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1768,7 +1768,8 @@ Does not preserve point." (defcustom sh-indent-after-continuation t "If non-nil, try to make sure text is indented after a line continuation." :version "24.3" - :type 'boolean) + :type 'boolean + :group 'sh-indentation) (defun sh-smie--continuation-start-indent () "Return the initial indentation of a continued line. -- cgit v1.2.1 From 460042b854a0b89b445725e046dd4947481c43ce Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 13:38:39 -0700 Subject: Fix some reftex custom types * lisp/textmodes/reftex-vars.el (reftex-create-bibtex-header) (reftex-create-bibtex-footer): Fix custom types. --- lisp/ChangeLog | 3 +++ lisp/textmodes/reftex-vars.el | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0bd07a9c48d..7bf0f18eb21 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-06 Glenn Morris + * textmodes/reftex-vars.el (reftex-create-bibtex-header) + (reftex-create-bibtex-footer): Fix custom types. + * progmodes/sh-script.el (sh-indent-after-continuation): Add explicit :group. diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 264d6e21839..2c1fc972057 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -1267,13 +1267,13 @@ should return the string to insert into the buffer." "Header to insert in BibTeX files generated by RefTeX." :group 'reftex-citation-support :version "24.3" - :type 'string) + :type '(choice (const :tag "No header" nil) string)) (defcustom reftex-create-bibtex-footer nil "Footer to insert in BibTeX files generated by RefTeX." :group 'reftex-citation-support :version "24.3" - :type 'string) + :type '(choice (const :tag "No footer" nil) string)) ;; Index Support Configuration -- cgit v1.2.1 From 1a316a53933885ed963f758c6463368cfe472d8f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 14:15:03 -0700 Subject: Handle group :version in cusver-check * admin/admin.el (cusver-new-version): New variable. (cusver-scan): Check if containing group has a :version. (cusver-check): Add VERSION argument. --- admin/ChangeLog | 6 ++++++ admin/admin.el | 35 ++++++++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index 8fe82ca36cb..82a01887b57 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,9 @@ +2012-10-06 Glenn Morris + + * admin.el (cusver-new-version): New variable. + (cusver-scan): Check if containing group has a :version. + (cusver-check): Add VERSION argument. + 2012-10-01 David Engster * grammars/bovine-grammar.el: diff --git a/admin/admin.el b/admin/admin.el index c71e6539413..60a09a1e2f2 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -442,8 +442,12 @@ If optional OLD is non-nil, also include defvars." )) "{}" "+")) -;; TODO if a defgroup with a version tag, apply to all customs in that -;; group (eg for new files). +; FIXME Calculate default based on running emacs-version. +(defvar cusver-new-version nil + "Version number that new defcustoms should have.") + +;; TODO do something about renamed variables with aliases to the old name? +;; Scan old cus-start.el to find variables moved from C to lisp? (defun cusver-scan (file &optional old) "Scan FILE for `defcustom' calls. Return a list with elements of the form (VAR . VER), @@ -452,8 +456,8 @@ a :version tag having value VER (may be nil). If optional argument OLD is non-nil, also scan for defvars." (let ((m (format "Scanning %s..." file)) (re (format "^[ \t]*\\((def%s\\)[ \t\n]" - (if old "\\(?:custom\\|var\\)" "custom"))) - alist var ver form) + (if old "\\(custom\\|var\\)" "\\(custom\\|group\\)"))) + alist var ver form glist grp) (message "%s" m) (with-temp-buffer (insert-file-contents file) @@ -461,11 +465,23 @@ If optional argument OLD is non-nil, also scan for defvars." (while (re-search-forward re nil t) (goto-char (match-beginning 1)) (if (and (setq form (ignore-errors (read (current-buffer)))) - (setq var (car-safe (cdr-safe form))) + (setq var (car-safe (cdr-safe form))) ;; Exclude macros, eg (defcustom ,varname ...). (symbolp var)) - (setq ver (car (cdr-safe (memq :version form))) - alist (cons (cons var ver) alist)) + (progn + (setq ver (car (cdr-safe (memq :version form)))) + (if (equal "group" (match-string 2)) + ;; Group :version could be old. + (if (equal ver cusver-new-version) + (setq glist (cons (cons var ver) glist))) + ;; If it specifies a group and the whole group has a + ;; version. use that. + (unless ver + (setq grp (car (cdr-safe (memq :group form)))) + (and grp + (setq grp (car (cdr-safe grp))) ; (quote foo) -> foo + (setq ver (assq grp glist)))) + (setq alist (cons (cons var ver) alist)))) (if form (message "Malformed defcustom: `%s'" form))))) (message "%sdone" m) alist)) @@ -490,7 +506,7 @@ If optional argument OLD is non-nil, also scan for defvars." ;; TODO handle renamed things with aliases to the old names. ;; What to do about new files? Does everything in there need a :version, ;; or eg just the defgroup? -(defun cusver-check (newdir olddir) +(defun cusver-check (newdir olddir version) "Check that defcustoms have :version tags where needed. NEWDIR is the current lisp/ directory, OLDDIR is that from the previous release. A defcustom that is only in NEWDIR should have a :version @@ -499,11 +515,12 @@ just converting a defvar to a defcustom does not require a :version bump. Note that a :version tag should also be added if the value of a defcustom changes (in a non-trivial way). This function does not check for that." - (interactive "DNew Lisp directory: \nDOld Lisp directory: ") + (interactive "DNew Lisp directory: \nDOld Lisp directory: \nsNew version number: ") (or (file-directory-p (setq newdir (expand-file-name newdir))) (error "Directory `%s' not found" newdir)) (or (file-directory-p (setq olddir (expand-file-name olddir))) (error "Directory `%s' not found" olddir)) + (setq cusver-new-version version) (let* ((newfiles (progn (message "Finding new files with defcustoms...") (cusver-find-files newdir))) (oldfiles (progn (message "Finding old files with defcustoms...") -- cgit v1.2.1 From 5b9c45a6d194abacc0c47bdd3537bdd6d428c2a2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 15:52:52 -0700 Subject: Further ChangeLog fix --- lisp/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7bf0f18eb21..1a2ccb5e4f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1637,7 +1637,7 @@ register contains text. Implication is that `C-x r +' can now be used for appending to a text register (bug#12217). (append-to-register, prepend-to-register): Add separator based on - `register-separator. + `separator-register'. 2012-09-08 Alan Mackenzie -- cgit v1.2.1 From addc11ed80db5e01c96ad587c4d848df0abc1cd2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 16:16:40 -0700 Subject: * lisp/ehelp.el (electric-help-mode): Fix major-mode setting. Fixes: debbugs:10917 --- lisp/ChangeLog | 3 +++ lisp/ehelp.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1a2ccb5e4f6..c573b9de5b9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-06 Glenn Morris + * ehelp.el (electric-help-mode): Use help-mode rather than + non-existent mode `help'. (Bug#10917) + * textmodes/reftex-vars.el (reftex-create-bibtex-header) (reftex-create-bibtex-footer): Fix custom types. diff --git a/lisp/ehelp.el b/lisp/ehelp.el index 281148d9cf6..52ac5434ce1 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -102,7 +102,7 @@ (setq buffer-read-only t) (setq electric-help-orig-major-mode major-mode) (setq mode-name "Help") - (setq major-mode 'help) + (setq major-mode 'help-mode) (setq mode-line-buffer-identification '(" Help: %b")) (use-local-map electric-help-map) (add-hook 'mouse-leave-buffer-hook 'electric-help-retain) -- cgit v1.2.1 From 32939005d60a106798ebc8bdd3c4a6180e19902d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 16:22:52 -0700 Subject: * lisp/ehelp.el (electric-help-map): Use button-buffer-map. Fixes: debbugs:10917 --- lisp/ChangeLog | 3 ++- lisp/ehelp.el | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c573b9de5b9..2453dc2177a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,8 @@ 2012-10-06 Glenn Morris * ehelp.el (electric-help-mode): Use help-mode rather than - non-existent mode `help'. (Bug#10917) + non-existent mode `help'. + (electric-help-map): Use button-buffer-map. (Bug#10917) * textmodes/reftex-vars.el (reftex-create-bibtex-header) (reftex-create-bibtex-footer): Fix custom types. diff --git a/lisp/ehelp.el b/lisp/ehelp.el index 52ac5434ce1..a1bd4d65385 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -61,6 +61,8 @@ (defvar electric-help-map (let ((map (make-keymap))) + ;; FIXME fragile. Should derive from help-mode-map in a smarter way. + (set-keymap-parent map button-buffer-map) ;; allow all non-self-inserting keys - search, scroll, etc, but ;; let M-x and C-x exit ehelp mode and retain buffer: (suppress-keymap map) -- cgit v1.2.1 From 82ed3ab40dfa2ac4f9a20b0dd8333058e45e1cfb Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 17:07:03 -0700 Subject: * lisp/hi-lock.el (hi-lock-face-phrase-buffer): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/hi-lock.el | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2453dc2177a..4469c6112f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-07 Glenn Morris + + * hi-lock.el (hi-lock-face-phrase-buffer): Doc fix. + 2012-10-06 Glenn Morris * ehelp.el (electric-help-mode): Use help-mode rather than diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index f92e2ab0af2..0bbb3150874 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -444,8 +444,8 @@ updated as you type." ;;;###autoload (defun hi-lock-face-phrase-buffer (regexp &optional face) "Set face of each match of phrase REGEXP to FACE. -Whitespace in REGEXP converted to arbitrary whitespace and initial -lower-case letters made case insensitive. +If called interactively, replaces whitespace in REGEXP with +arbitrary whitespace and makes initial lower-case letters case-insensitive. If Font Lock mode is enabled in the buffer, it is used to highlight REGEXP. If Font Lock mode is disabled, overlays are @@ -544,9 +544,11 @@ be found in variable `hi-lock-interactive-patterns'." Blanks in PHRASE replaced by regexp that matches arbitrary whitespace and initial lower-case letters made case insensitive." (let ((mod-phrase nil)) + ;; FIXME fragile; better to just bind case-fold-search? (Bug#7161) (setq mod-phrase (replace-regexp-in-string "\\<[a-z]" (lambda (m) (format "[%s%s]" (upcase m) m)) phrase)) + ;; FIXME fragile; better to use search-spaces-regexp? (setq mod-phrase (replace-regexp-in-string "\\s-+" "[ \t\n]+" mod-phrase nil t)))) -- cgit v1.2.1 From 1595ecfac950d69ae94c270fb9829529a421c56c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 17:27:31 -0700 Subject: * lisp/hi-lock.el (hi-lock-process-phrase): Try to make it less fragile. Fixes: debbugs:7161 --- lisp/ChangeLog | 3 +++ lisp/hi-lock.el | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4469c6112f8..b91d9715bfa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-07 Glenn Morris + * hi-lock.el (hi-lock-process-phrase): + Try to make it less fragile. (Bug#7161) + * hi-lock.el (hi-lock-face-phrase-buffer): Doc fix. 2012-10-06 Glenn Morris diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 0bbb3150874..59743124cc5 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -547,7 +547,11 @@ and initial lower-case letters made case insensitive." ;; FIXME fragile; better to just bind case-fold-search? (Bug#7161) (setq mod-phrase (replace-regexp-in-string - "\\<[a-z]" (lambda (m) (format "[%s%s]" (upcase m) m)) phrase)) + "\\(^\\|\\s-\\)\\([a-z]\\)" + (lambda (m) (format "%s[%s%s]" + (match-string 1 m) + (upcase (match-string 2 m)) + (match-string 2 m))) phrase)) ;; FIXME fragile; better to use search-spaces-regexp? (setq mod-phrase (replace-regexp-in-string -- cgit v1.2.1 From 5407f8d23491f3e7886865facc0ae6446142ba48 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 17:54:36 -0700 Subject: Improve cusver-check's handling of the version number * admin/admin.el (cusver-new-version): Set default. (cusver-check): Improve interactive argument reading. --- admin/ChangeLog | 5 +++++ admin/admin.el | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index 82a01887b57..7d4921887ce 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-10-07 Glenn Morris + + * admin.el (cusver-new-version): Set default. + (cusver-check): Improve interactive argument reading. + 2012-10-06 Glenn Morris * admin.el (cusver-new-version): New variable. diff --git a/admin/admin.el b/admin/admin.el index 60a09a1e2f2..3e3fbba7202 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -442,8 +442,8 @@ If optional OLD is non-nil, also include defvars." )) "{}" "+")) -; FIXME Calculate default based on running emacs-version. -(defvar cusver-new-version nil +(defvar cusver-new-version (format "%s.%s" emacs-major-version + (1+ emacs-minor-version)) "Version number that new defcustoms should have.") ;; TODO do something about renamed variables with aliases to the old name? @@ -515,7 +515,11 @@ just converting a defvar to a defcustom does not require a :version bump. Note that a :version tag should also be added if the value of a defcustom changes (in a non-trivial way). This function does not check for that." - (interactive "DNew Lisp directory: \nDOld Lisp directory: \nsNew version number: ") + (interactive (list (read-directory-name "New Lisp directory: ") + (read-directory-name "Old Lisp directory: ") + (number-to-string + (read-number "New version number: " + (string-to-number cusver-new-version))))) (or (file-directory-p (setq newdir (expand-file-name newdir))) (error "Directory `%s' not found" newdir)) (or (file-directory-p (setq olddir (expand-file-name olddir))) -- cgit v1.2.1 From 87a95afe81dc7775ef134a94548dea68ed0cc3c3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 18:28:04 -0700 Subject: * lisp/erc/erc-backend.el (NICK): Handle pre-existing buffers. Fixes: debbugs:12002 --- lisp/erc/ChangeLog | 4 ++++ lisp/erc/erc-backend.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 9be0d3241ad..8b1cd18545c 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2012-10-07 Glenn Morris + + * erc-backend.el (NICK): Handle pre-existing buffers. (Bug#12002) + 2012-10-06 Glenn Morris * erc.el (erc-lurker): diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 75f0047bf06..20ccd071b95 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1316,7 +1316,7 @@ add things to `%s' instead." (when (equal (erc-default-target) nick) (setq erc-default-recipients (cons nn (cdr erc-default-recipients))) - (rename-buffer nn) + (rename-buffer nn t) ; bug#12002 (erc-update-mode-line) (add-to-list 'bufs (current-buffer))))) (erc-update-user-nick nick nn host nil nil login) -- cgit v1.2.1 From 1bac999506468ca481c118b87893c44ec54afc4b Mon Sep 17 00:00:00 2001 From: Antoine Levitt Date: Sat, 6 Oct 2012 18:41:03 -0700 Subject: Small fix for invisible timestamps * lisp/erc/erc-stamp.el (erc-format-timestamp): Don't apply intangible property to invisible stamps. Fixes: debbugs:11706 --- lisp/erc/ChangeLog | 5 +++++ lisp/erc/erc-stamp.el | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 8b1cd18545c..6906430eb7b 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,8 @@ +2012-10-07 Antoine Levitt + + * erc-stamp.el (erc-format-timestamp): Don't apply intangible + property to invisible stamps. (Bug#11706) + 2012-10-07 Glenn Morris * erc-backend.el (NICK): Handle pre-existing buffers. (Bug#12002) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 1613d03912c..4fa3f9f5915 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -353,8 +353,9 @@ Return the empty string if FORMAT is nil." 'isearch-open-invisible 'timestamp ts) ;; N.B. Later use categories instead of this harmless, but ;; inelegant, hack. -- BPT - (when erc-timestamp-intangible - (erc-put-text-property 0 (length ts) 'intangible t ts)) + (and erc-timestamp-intangible + (not erc-hide-timestamps) ; bug#11706 + (erc-put-text-property 0 (length ts) 'intangible t ts)) ts) "")) -- cgit v1.2.1 From 2255788d775663c13f57fc0617b6d27398ae769d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 18:45:03 -0700 Subject: * lisp/erc/erc-button.el (erc-button-alist): Remove "finger". Fixes: debbugs:4443 --- lisp/erc/ChangeLog | 4 ++++ lisp/erc/erc-button.el | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 6906430eb7b..7fad769bdc6 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2012-10-07 Glenn Morris + + * erc-button.el (erc-button-alist): Remove "finger". (Bug#4443) + 2012-10-07 Antoine Levitt * erc-stamp.el (erc-format-timestamp): Don't apply intangible diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 687d11d144e..433ffc05340 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -135,7 +135,7 @@ longer than `erc-fill-column'." '(('nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0) (erc-button-url-regexp 0 t browse-url 0) (" ]+\\) *>" 0 t browse-url 1) - ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3) +;;; ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3) ;; emacs internal ("[`]\\([a-zA-Z][-a-zA-Z_0-9]+\\)[']" 1 t erc-button-describe-symbol 1) ;; pseudo links @@ -183,6 +183,7 @@ PAR is a number of a regexp grouping whose text will be passed to 'nicknames, these are ignored, and CALLBACK will be called with the nickname matched as the argument." :group 'erc-button + :version "24.3" ; remove finger (bug#4443) :type '(repeat (list :tag "Button" (choice :tag "Matches" -- cgit v1.2.1 From b68f89c4e3bc88e21f70da947875caec023aa2cb Mon Sep 17 00:00:00 2001 From: Deniz Dogan Date: Sat, 6 Oct 2012 19:05:04 -0700 Subject: * lisp/erc/erc-log.el (erc-generate-log-file-name-function): Clarify tags Fixes: debbugs:11186 --- lisp/erc/ChangeLog | 5 +++++ lisp/erc/erc-log.el | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 7fad769bdc6..37bc2922d22 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,8 @@ +2012-10-07 Deniz Dogan + + * erc-log.el (erc-generate-log-file-name-function): + Clarify tags for various choices. (Bug#11186) + 2012-10-07 Glenn Morris * erc-button.el (erc-button-alist): Remove "finger". (Bug#4443) diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 9e6c587bd12..aa6b332eb90 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -114,11 +114,13 @@ If you want to write logs into different directories, make a custom function which returns the directory part and set `erc-log-channels-directory' to its name." :group 'erc-log - :type '(choice (const :tag "Long style" erc-generate-log-file-name-long) - (const :tag "Long, but with network name rather than server" + :type '(choice (const :tag "#channel!nick server:port.txt" + erc-generate-log-file-name-long) + (const :tag "#channel!nick network.txt" erc-generate-log-file-name-network) - (const :tag "Short" erc-generate-log-file-name-short) - (const :tag "With date" erc-generate-log-file-name-with-date) + (const :tag "#channel.txt" erc-generate-log-file-name-short) + (const :tag "#channel date.txt" + erc-generate-log-file-name-with-date) (function :tag "Other function"))) (defcustom erc-truncate-buffer-on-save nil -- cgit v1.2.1 From 559e479cbb1e1fb88325c90a22f7b7fdb5c3c95b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 19:07:46 -0700 Subject: Remove tiny change marker for author with assignment --- lisp/ChangeLog.15 | 4 ++-- lisp/erc/ChangeLog | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15 index 65a7baf44c4..83657a98bfd 100644 --- a/lisp/ChangeLog.15 +++ b/lisp/ChangeLog.15 @@ -10962,7 +10962,7 @@ * Version 23.2 released. -2010-05-07 Deniz Dogan (tiny change) +2010-05-07 Deniz Dogan Stefan Monnier Highlight vendor specific properties. @@ -15541,7 +15541,7 @@ * window.el (move-to-window-line-last-op): Remove. (move-to-window-line-top-bottom): Reuse recenter-last-op instead. -2009-11-23 Deniz Dogan (tiny change) +2009-11-23 Deniz Dogan Make M-r mirror the new cycling behavior of C-l. * window.el (move-to-window-line-last-op): New var. diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 37bc2922d22..8b4df6099bc 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -126,7 +126,7 @@ (erc-autojoin-after-ident): Ditto. (erc-autojoin-channels-alist): Mention auth-source. -2012-04-10 Deniz Dogan (tiny change) +2012-04-10 Deniz Dogan * erc.el (erc-display-prompt): Adds the field text property to the ERC prompt. This allows users to use `kill-whole-line' to kill -- cgit v1.2.1 From c622b48f7894fc904cdc95edff47f2173240f0cf Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 6 Oct 2012 19:26:03 -0700 Subject: Improve sys_siglist detection. * configure.ac (sys_siglist): Look for its decl in . Otherwise, it's not found in either Fedora 17 or Solaris 11. * src/sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's defined as a macro, as is done in Solaris. (sys_siglist_entries): New macro. (save_strsignal): Use it. * src/syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection. --- ChangeLog | 6 ++++++ configure.ac | 6 ++++-- src/ChangeLog | 10 ++++++++++ src/sysdep.c | 18 ++++++++++++++---- src/syssignal.h | 2 +- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90b57c4c3da..2d4d7a66eb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-10-07 Paul Eggert + + Improve sys_siglist detection. + * configure.ac (sys_siglist): Look for its decl in . + Otherwise, it's not found in either Fedora 17 or Solaris 11. + 2012-10-04 Paul Eggert Merge from gnulib, incorporating: diff --git a/configure.ac b/configure.ac index edbae29c59f..626395220bd 100644 --- a/configure.ac +++ b/configure.ac @@ -1284,10 +1284,12 @@ dnl On Solaris 8 there's a compilation warning for term.h because dnl it doesn't define `bool'. AC_CHECK_HEADERS(term.h, , , -) AC_HEADER_TIME -AC_CHECK_DECLS([sys_siglist]) +AC_CHECK_DECLS([sys_siglist], [], [], [[#include + ]]) if test $ac_cv_have_decl_sys_siglist != yes; then # For Tru64, at least: - AC_CHECK_DECLS([__sys_siglist]) + AC_CHECK_DECLS([__sys_siglist], [], [], [[#include + ]]) if test $ac_cv_have_decl___sys_siglist = yes; then AC_DEFINE(sys_siglist, __sys_siglist, [Define to any substitute for sys_siglist.]) diff --git a/src/ChangeLog b/src/ChangeLog index b960837eaab..a30dde5e4ea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-10-07 Paul Eggert + + Improve sys_siglist detection. + * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's + defined as a macro, as is done in Solaris. + (sys_siglist_entries): New macro. + (save_strsignal): Use it. + * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify + GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection. + 2012-10-06 Jan Djärv * nsfns.m (Fx_create_frame): Call x_default_parameter with diff --git a/src/sysdep.c b/src/sysdep.c index 74617fcaf0f..35beeaa7202 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1545,8 +1545,18 @@ deliver_thread_signal (int sig, signal_handler_t handler) #if !HAVE_DECL_SYS_SIGLIST # undef sys_siglist -# define sys_siglist my_sys_siglist +# ifdef _sys_siglist +# define sys_siglist _sys_siglist +# else +# define sys_siglist my_sys_siglist static char const *sys_siglist[NSIG]; +# endif +#endif + +#ifdef _sys_nsig +# define sys_siglist_entries _sys_nsig +#else +# define sys_siglist_entries NSIG #endif /* Handle bus errors, invalid instruction, etc. */ @@ -1609,7 +1619,7 @@ init_signals (bool dumping) main_thread = pthread_self (); #endif -#if !HAVE_DECL_SYS_SIGLIST +#if !HAVE_DECL_SYS_SIGLIST && !defined _sys_siglist if (! initialized) { sys_siglist[SIGABRT] = "Aborted"; @@ -1757,7 +1767,7 @@ init_signals (bool dumping) sys_siglist[SIGXFSZ] = "File size limit exceeded"; # endif } -#endif /* !HAVE_DECL_SYS_SIGLIST */ +#endif /* !HAVE_DECL_SYS_SIGLIST && !_sys_siglist */ /* Don't alter signal handlers if dumping. On some machines, changing signal handlers sets static data that would make signals @@ -2285,7 +2295,7 @@ safe_strsignal (int code) { char const *signame = 0; - if (0 <= code && code < NSIG) + if (0 <= code && code < sys_siglist_entries) signame = sys_siglist[code]; if (! signame) signame = "Unknown signal"; diff --git a/src/syssignal.h b/src/syssignal.h index 83ab19698dd..2bf2f046aa5 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -43,7 +43,7 @@ extern sigset_t empty_mask; typedef void (*signal_handler_t) (int); extern void emacs_sigaction_init (struct sigaction *, signal_handler_t); -char const *safe_strsignal (int); +char const *safe_strsignal (int) ATTRIBUTE_CONST; #if NSIG < NSIG_MINIMUM # undef NSIG -- cgit v1.2.1 From 08f18c3d4d86ba60c9f31512c310fffd1a60f9eb Mon Sep 17 00:00:00 2001 From: Fabián Ezequiel Gallina Date: Sun, 7 Oct 2012 01:33:16 -0300 Subject: Fix shell output retrieval and comint-prompt-regexp init. * progmodes/python.el (inferior-python-mode): (python-shell-make-comint): Fix initialization of comint-prompt-regexp from copied file local variables. (python-shell-fetched-lines): Remove var. (python-shell-output-filter-in-progress): Rename from python-shell-fetch-lines-in-progress. (python-shell-output-filter-buffer): Rename from python-shell-fetch-lines-string. (python-shell-fetch-lines-filter): Delete function. (python-shell-output-filter): New function. (python-shell-send-string-no-output): Use them. --- lisp/ChangeLog | 15 ++++++++++ lisp/progmodes/python.el | 77 +++++++++++++++++++++++++++++------------------- 2 files changed, 61 insertions(+), 31 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b91d9715bfa..d138e6c84fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2012-10-07 Fabián Ezequiel Gallina + + Fix shell output retrieval and comint-prompt-regexp init. + * progmodes/python.el (inferior-python-mode): + (python-shell-make-comint): Fix initialization of + comint-prompt-regexp from copied file local variables. + (python-shell-fetched-lines): Remove var. + (python-shell-output-filter-in-progress): Rename from + python-shell-fetch-lines-in-progress. + (python-shell-output-filter-buffer): Rename from + python-shell-fetch-lines-string. + (python-shell-fetch-lines-filter): Delete function. + (python-shell-output-filter): New function. + (python-shell-send-string-no-output): Use them. + 2012-10-07 Glenn Morris * hi-lock.el (hi-lock-process-phrase): diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b3b3b0181d7..726c0b2d542 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1667,10 +1667,6 @@ variable. \(Type \\[describe-mode] in the process buffer for a list of commands.)" (set-syntax-table python-mode-syntax-table) (setq mode-line-process '(":%s")) - (setq comint-prompt-regexp (format "^\\(?:%s\\|%s\\|%s\\)" - python-shell-prompt-regexp - python-shell-prompt-block-regexp - python-shell-prompt-pdb-regexp)) (make-local-variable 'comint-output-filter-functions) (add-hook 'comint-output-filter-functions 'python-comint-output-filter-function) @@ -1720,7 +1716,11 @@ killed." (process (get-buffer-process buffer))) (with-current-buffer buffer (inferior-python-mode) - (python-util-clone-local-variables current-buffer)) + (python-util-clone-local-variables current-buffer) + (setq comint-prompt-regexp (format "^\\(?:%s\\|%s\\|%s\\)" + python-shell-prompt-regexp + python-shell-prompt-block-regexp + python-shell-prompt-pdb-regexp))) (accept-process-output process) (and pop (pop-to-buffer buffer t)) (and internal (set-process-query-on-exit-flag process nil)))) @@ -1861,26 +1861,39 @@ When MSG is non-nil messages the first line of STRING." (string-match "\n[ \t].*\n?$" string)) (comint-send-string process "\n"))))) -;; Shell output catching stolen from gud-gdb -(defvar python-shell-fetch-lines-in-progress nil) -(defvar python-shell-fetch-lines-string nil) -(defvar python-shell-fetched-lines nil) - -(defun python-shell-fetch-lines-filter (string) - "Filter used to read the list of lines output by a command. -STRING is the output to filter." - (setq string (concat python-shell-fetch-lines-string string)) - (while (string-match "\n" string) - (push (substring string 0 (match-beginning 0)) - python-shell-fetched-lines) - (setq string (substring string (match-end 0)))) - (if (equal (string-match comint-prompt-regexp string) 0) - (progn - (setq python-shell-fetch-lines-in-progress nil) - string) - (progn - (setq python-shell-fetch-lines-string string) - ""))) +(defvar python-shell-output-filter-in-progress nil) +(defvar python-shell-output-filter-buffer nil) + +(defun python-shell-output-filter (string) + "Filter used in `python-shell-send-string-no-output' to grab output. +STRING is the output received to this point from the process. +This filter saves received output from the process in +`python-shell-output-filter-buffer' and stops receiving it after +detecting a prompt at the end of the buffer." + (setq + string (ansi-color-filter-apply string) + python-shell-output-filter-buffer + (concat python-shell-output-filter-buffer string)) + (when (string-match + (format "\n\\(?:%s\\|%s\\|%s\\)$" + python-shell-prompt-regexp + python-shell-prompt-block-regexp + python-shell-prompt-pdb-regexp) + python-shell-output-filter-buffer) + ;; Output ends when `python-shell-output-filter-buffer' contains + ;; the prompt attached at the end of it. + (setq python-shell-output-filter-in-progress nil + python-shell-output-filter-buffer + (substring python-shell-output-filter-buffer + 0 (match-beginning 0))) + (when (and (> (length python-shell-prompt-output-regexp) 0) + (string-match (concat "^" python-shell-prompt-output-regexp) + python-shell-output-filter-buffer)) + ;; Some shells, like iPython might append a prompt before the + ;; output, clean that. + (setq python-shell-output-filter-buffer + (substring python-shell-output-filter-buffer (match-end 0))))) + "") (defun python-shell-send-string-no-output (string &optional process msg) "Send STRING to PROCESS and inhibit output. @@ -1888,18 +1901,20 @@ When MSG is non-nil messages the first line of STRING. Return the output." (let ((process (or process (python-shell-get-or-create-process))) (comint-preoutput-filter-functions - '(python-shell-fetch-lines-filter)) - (python-shell-fetch-lines-in-progress t) + '(python-shell-output-filter)) + (python-shell-output-filter-in-progress t) (inhibit-quit t)) (or (with-local-quit (python-shell-send-string string process msg) - (while python-shell-fetch-lines-in-progress + (while python-shell-output-filter-in-progress + ;; `python-shell-output-filter' takes care of setting + ;; `python-shell-output-filter-in-progress' to NIL after it + ;; detects end of output. (accept-process-output process)) (prog1 - (mapconcat #'identity - (reverse python-shell-fetched-lines) "\n") - (setq python-shell-fetched-lines nil))) + python-shell-output-filter-buffer + (setq python-shell-output-filter-buffer nil))) (with-current-buffer (process-buffer process) (comint-interrupt-subjob))))) -- cgit v1.2.1 From 99a1e701100ef02907d2ab64a7f05024bc2983be Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 7 Oct 2012 00:49:16 -0700 Subject: Fix infloop in rmailmm on multipart messages with epilogues * lisp/mail/rmailmm.el (rmail-mime-process-multipart): Do not confuse a multipart message with an epilogue with a "truncated" one; fixes 2011-06-27 change. Fixes: debbugs:10101 --- lisp/ChangeLog | 6 ++++++ lisp/mail/rmailmm.el | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d138e6c84fa..e54e82233a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-10-07 Glenn Morris + + * mail/rmailmm.el (rmail-mime-process-multipart): + Do not confuse a multipart message with an epilogue + with a "truncated" one; fixes 2011-06-27 change. (Bug#10101) + 2012-10-07 Fabián Ezequiel Gallina Fix shell output retrieval and comint-prompt-regexp init. diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 2cc57963ef7..11bccd59765 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -832,7 +832,7 @@ The other arguments are the same as `rmail-mime-multipart-handler'." (let ((boundary (cdr (assq 'boundary content-type))) (subtype (cadr (split-string (car content-type) "/"))) (index 0) - beg end next entities truncated) + beg end next entities truncated last) (unless boundary (rmail-mm-get-boundary-error-message "No boundary defined" content-type content-disposition @@ -867,7 +867,13 @@ The other arguments are the same as `rmail-mime-multipart-handler'." ;; Handle the rest of the truncated message ;; (if it isn't empty) by pretending that the boundary ;; appears at the end of the message. - (and (save-excursion + ;; We use `last' to distinguish this from the more + ;; likely situation of there being an epilogue + ;; after the last boundary, which should be ignored. + ;; See rmailmm-test-multipart-handler for an example, + ;; and also bug#10101. + (and (not last) + (save-excursion (skip-chars-forward "\n") (> (point-max) (point))) (setq truncated t end (point-max)))) @@ -875,7 +881,8 @@ The other arguments are the same as `rmail-mime-multipart-handler'." ;; epilogue, else hide the boundary only. Use a marker for ;; `next' because `rmail-mime-show' may change the buffer. (cond ((looking-at "--[ \t]*$") - (setq next (point-max-marker))) + (setq next (point-max-marker) + last t)) ((looking-at "[ \t]*\n") (setq next (copy-marker (match-end 0) t))) (truncated -- cgit v1.2.1 From 31bcb42062a9c80f9b7b6116a73353f37aac07f7 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 7 Oct 2012 00:54:41 -0700 Subject: Un-mung previous erc-log change (error due to committer, not author) --- lisp/erc/erc-log.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index aa6b332eb90..b3f3f5865a1 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -114,12 +114,12 @@ If you want to write logs into different directories, make a custom function which returns the directory part and set `erc-log-channels-directory' to its name." :group 'erc-log - :type '(choice (const :tag "#channel!nick server:port.txt" + :type '(choice (const :tag "#channel!nick@server:port.txt" erc-generate-log-file-name-long) - (const :tag "#channel!nick network.txt" + (const :tag "#channel!nick@network.txt" erc-generate-log-file-name-network) (const :tag "#channel.txt" erc-generate-log-file-name-short) - (const :tag "#channel date.txt" + (const :tag "#channel@date.txt" erc-generate-log-file-name-with-date) (function :tag "Other function"))) -- cgit v1.2.1 From 3bc0a2f7e99de90d469b55fcfc9f3f82a99eb0b9 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sun, 7 Oct 2012 11:17:17 +0200 Subject: * nsfns.m (ns_in_resize): Remove. (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove ns_in_resize check. * nsterm.m (ns_in_resize): Remove. (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove. (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize check. (ns_clear_frame_area): Remove resize handle code. Fixes: debbugs:12479 --- src/ChangeLog | 12 ++++++ src/nsfns.m | 10 +---- src/nsterm.m | 136 +--------------------------------------------------------- 3 files changed, 15 insertions(+), 143 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a30dde5e4ea..44dc7286278 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2012-10-07 Jan Djärv + + * nsterm.m (ns_in_resize): Remove (Bug#12479). + (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove. + (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize + check. + (ns_clear_frame_area): Remove resize handle code. + + * nsfns.m (ns_in_resize): Remove. + (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove ns_in_resize + check. + 2012-10-07 Paul Eggert Improve sys_siglist detection. diff --git a/src/nsfns.m b/src/nsfns.m index f22198401e0..d66b1c32b07 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -93,8 +93,6 @@ EmacsTooltip *ns_tooltip; /* Need forward declaration here to preserve organizational integrity of file */ Lisp_Object Fx_open_connection (Lisp_Object, Lisp_Object, Lisp_Object); -extern BOOL ns_in_resize; - /* Static variables to handle applescript execution. */ static Lisp_Object as_script, *as_result; static int as_status; @@ -433,9 +431,6 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) NSView *view = FRAME_NS_VIEW (f); NSTRACE (x_set_icon_name); - if (ns_in_resize) - return; - /* see if it's changed */ if (STRINGP (arg)) { @@ -511,9 +506,6 @@ ns_set_name (struct frame *f, Lisp_Object name, int explicit) { NSTRACE (ns_set_name); - if (ns_in_resize) - return; - /* Make sure that requests from lisp code override requests from Emacs redisplay code. */ if (explicit) @@ -612,7 +604,7 @@ ns_set_name_as_filename (struct frame *f) NSString *str; NSTRACE (ns_set_name_as_filename); - if (f->explicit_name || ! NILP (f->title) || ns_in_resize) + if (f->explicit_name || ! NILP (f->title)) return; block_input (); diff --git a/src/nsterm.m b/src/nsterm.m index 0d0be9281ee..75f33fea75e 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -183,7 +183,6 @@ static int ns_window_num = 0; static NSRect uRect; #endif static BOOL gsaved = NO; -BOOL ns_in_resize = NO; static BOOL ns_fake_keydown = NO; int ns_tmp_flags; /* FIXME */ struct nsfont_info *ns_tmp_font; /* FIXME */ @@ -493,17 +492,6 @@ ns_release_autorelease_pool (void *pool) ========================================================================== */ -static NSRect -ns_resize_handle_rect (NSWindow *window) -{ - NSRect r = [window frame]; - r.origin.x = r.size.width - RESIZE_HANDLE_SIZE; - r.origin.y = 0; - r.size.width = r.size.height = RESIZE_HANDLE_SIZE; - return r; -} - - // // Window constraining // ------------------- @@ -1983,8 +1971,6 @@ ns_clear_frame (struct frame *f) NSRect r; NSTRACE (ns_clear_frame); - if (ns_in_resize) - return; /* comes on initial frame because we have after-make-frame-functions = select-frame */ @@ -2004,10 +1990,6 @@ ns_clear_frame (struct frame *f) NSRectFill (r); ns_unfocus (f); -#ifdef NS_IMPL_COCOA - [[view window] display]; /* redraw resize handle */ -#endif - /* as of 2006/11 or so this is now needed */ ns_redraw_scroll_bars (f); unblock_input (); @@ -2033,35 +2015,8 @@ ns_clear_frame_area (struct frame *f, int x, int y, int width, int height) ns_focus (f, &r, 1); [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set]; -#ifdef NS_IMPL_COCOA - { - /* clip out the resize handle */ - NSWindow *window = [FRAME_NS_VIEW (f) window]; - NSRect ir - = [view convertRect: ns_resize_handle_rect (window) fromView: nil]; - - ir = NSIntersectionRect (r, ir); - if (NSIsEmptyRect (ir)) - { -#endif - NSRectFill (r); -#ifdef NS_IMPL_COCOA - } - else - { - NSRect r1 = r, r2 = r; /* upper and lower non-intersecting */ - r1.size.height -= ir.size.height; - r2.origin.y += r1.size.height; - r2.size.width -= ir.size.width; - r2.size.height = ir.size.height; - NSRectFill (r1); - NSRectFill (r2); - } - } -#endif - ns_unfocus (f); return; } @@ -4314,34 +4269,6 @@ ns_term_shutdown (int sig) return; } -#ifdef NS_IMPL_COCOA - /* pass mouse down in resize handle and subsequent drags directly to - EmacsWindow so we can generate continuous redisplays */ - if (ns_in_resize) - { - if (type == NSLeftMouseDragged) - { - [window mouseDragged: theEvent]; - return; - } - else if (type == NSLeftMouseUp) - { - [window mouseUp: theEvent]; - return; - } - } - else if (type == NSLeftMouseDown) - { - NSRect r = ns_resize_handle_rect (window); - if (NSPointInRect ([theEvent locationInWindow], r)) - { - ns_in_resize = YES; - [window mouseDown: theEvent]; - return; - } - } -#endif - if (type == NSApplicationDefined) { /* Events posted by ns_send_appdefined interrupt the run loop here. @@ -5567,12 +5494,7 @@ not_in_argv (NSString *arg) if (cols > 0 && rows > 0) { - if (ns_in_resize) - x_set_window_size (emacsframe, 0, cols, rows); - else - { - [self updateFrameSize: YES]; - } + [self updateFrameSize: YES]; } ns_send_appdefined (-1); @@ -6198,7 +6120,7 @@ not_in_argv (NSString *arg) NSTRACE (drawRect); - if (!emacsframe || !emacsframe->output_data.ns || ns_in_resize) + if (!emacsframe || !emacsframe->output_data.ns) return; ns_clear_frame_area (emacsframe, x, y, width, height); @@ -6535,60 +6457,6 @@ not_in_argv (NSString *arg) return [super constrainFrameRect:frameRect toScreen:screen]; } - -/* called only on resize clicks by special case in EmacsApp-sendEvent */ -- (void)mouseDown: (NSEvent *)theEvent -{ - if (ns_in_resize) - { - NSSize size = [[theEvent window] frame].size; - grabOffset = [theEvent locationInWindow]; - grabOffset.x = size.width - grabOffset.x; - } - else - [super mouseDown: theEvent]; -} - - -/* stop resizing */ -- (void)mouseUp: (NSEvent *)theEvent -{ - if (ns_in_resize) - { - struct frame *f = ((EmacsView *)[self delegate])->emacsframe; - ns_in_resize = NO; - ns_set_name_as_filename (f); - [self display]; - ns_send_appdefined (-1); - } - else - [super mouseUp: theEvent]; -} - - -/* send resize events */ -- (void)mouseDragged: (NSEvent *)theEvent -{ - if (ns_in_resize) - { - NSPoint p = [theEvent locationInWindow]; - NSSize size, vettedSize, origSize = [self frame].size; - - size.width = p.x + grabOffset.x; - size.height = origSize.height - p.y + grabOffset.y; - - if (size.width == origSize.width && size.height == origSize.height) - return; - - vettedSize = [[self delegate] windowWillResize: self toSize: size]; - [[NSNotificationCenter defaultCenter] - postNotificationName: NSWindowDidResizeNotification - object: self]; - } - else - [super mouseDragged: theEvent]; -} - @end /* EmacsWindow */ -- cgit v1.2.1 From 335f5ae44485d32ac632bd8d27d5ac00acd63477 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sun, 7 Oct 2012 12:07:23 +0200 Subject: Check for OSX >= 10.4 to match what the maunal says and what we actually support. * configure.ac: Check that OSX is 10.4 or newer. * etc/NEWS (NextStep/OSX port changes): OSX 10.4 or newer is required. * src/nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4. (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4. * src/nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger. * src/nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2. * src/nsselect.m (ns_string_from_pasteboard): Remove check for >= MAC_OS_X_VERSION_10_4. * src/nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove. (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4. (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3. --- ChangeLog | 4 ++++ configure.ac | 16 ++++++++++++++++ etc/ChangeLog | 4 ++++ etc/NEWS | 2 ++ src/ChangeLog | 18 ++++++++++++++++++ src/nsfns.m | 35 ++++++++++++++++------------------- src/nsimage.m | 8 +++----- src/nsmenu.m | 5 ----- src/nsselect.m | 4 ++-- src/nsterm.h | 13 ++++--------- src/nsterm.m | 5 +---- 11 files changed, 70 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d4d7a66eb0..1a7b9f61828 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-10-07 Jan Djärv + + * configure.ac: Check that OSX is 10.4 or newer. + 2012-10-07 Paul Eggert Improve sys_siglist detection. diff --git a/configure.ac b/configure.ac index 626395220bd..748f435aec2 100644 --- a/configure.ac +++ b/configure.ac @@ -1510,10 +1510,26 @@ fail; AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes], [AC_MSG_ERROR([`--with-ns' was specified, but the include files are missing or cannot be compiled.])]) + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], + [ +#ifdef MAC_OS_X_VERSION_MAX_ALLOWED +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 + ; /* OK */ +#else +#error "OSX 10.4 or newer required" +#endif +#endif + ])], + ns_osx_have_104=yes, + ns_osx_have_104=no) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [NSInteger i;])], ns_have_nsinteger=yes, ns_have_nsinteger=no) + if test $ns_osx_have_104 = no; then + AC_MSG_ERROR([`OSX 10.4 or newer is required']); + fi if test $ns_have_nsinteger = yes; then AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.]) fi diff --git a/etc/ChangeLog b/etc/ChangeLog index ad6c6395e49..001bfe271af 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2012-10-07 Jan Djärv + + * NEWS (NextStep/OSX port changes): OSX 10.4 or newer is required. + 2012-10-05 Douglas Lewan (tiny change) * tutorials/TUTORIAL.pt_BR: Fix typo. (Bug#12557) diff --git a/etc/NEWS b/etc/NEWS index e4086bf038e..1a7eb82967d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -191,6 +191,8 @@ The PCL-CVS commands are still available via the keyboard. ** NextStep/OSX port changes. --- +*** OSX 10.4 or newer is required to build Emacs. +--- *** Fullscreen and frame parameter fullscreen is supported. --- *** A file dialog is used when open/saved is done from the menu/toolbar. diff --git a/src/ChangeLog b/src/ChangeLog index 44dc7286278..45e3c8a8a57 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,23 @@ 2012-10-07 Jan Djärv + * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of + MAC_OS_X_VERSION_10_6. + (syms_of_nsterm): Remove comment about Panther and above for ns-antialias-text. + + * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove. + (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4. + (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3. + + * nsselect.m (ns_string_from_pasteboard): Remove check for >= + MAC_OS_X_VERSION_10_4. + + * nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2. + + * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger. + + * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4. + (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4. + * nsterm.m (ns_in_resize): Remove (Bug#12479). (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove. (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize diff --git a/src/nsfns.m b/src/nsfns.m index d66b1c32b07..7a22ac547c3 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1949,32 +1949,29 @@ DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0, check_ns (); svcs = [[NSMenu alloc] initWithTitle: @"Services"]; - [NSApp setServicesMenu: svcs]; /* this and next rebuild on <10.4 */ + [NSApp setServicesMenu: svcs]; [NSApp registerServicesMenuSendTypes: ns_send_types returnTypes: ns_return_types]; /* On Tiger, services menu updating was made lazier (waits for user to actually click on the menu), so we have to force things along: */ #ifdef NS_IMPL_COCOA - if (NSAppKitVersionNumber >= 744.0) + delegate = [svcs delegate]; + if (delegate != nil) { - delegate = [svcs delegate]; - if (delegate != nil) + if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)]) + [delegate menuNeedsUpdate: svcs]; + if ([delegate respondsToSelector: + @selector (menu:updateItem:atIndex:shouldCancel:)]) { - if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)]) - [delegate menuNeedsUpdate: svcs]; - if ([delegate respondsToSelector: - @selector (menu:updateItem:atIndex:shouldCancel:)]) - { - int i, len = [delegate numberOfItemsInMenu: svcs]; - for (i =0; i= MAC_OS_X_VERSION_10_4 +#if defined (NS_IMPL_COCOA) (typeUTF16ExternalRepresentation == [returnDescriptor descriptorType]) || #endif diff --git a/src/nsimage.m b/src/nsimage.m index 370cf832c7c..884c0763fd4 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -403,7 +403,6 @@ static EmacsImage *ImageList = nil; if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)]) { bmRep = (NSBitmapImageRep *) rep; - onTiger = [bmRep respondsToSelector: @selector (colorAtX:y:)]; if ([bmRep numberOfPlanes] >= 3) [bmRep getBitmapDataPlanes: pixmapData]; @@ -435,7 +434,7 @@ static EmacsImage *ImageList = nil; | (pixmapData[0][loc] << 16) | (pixmapData[1][loc] << 8) | (pixmapData[2][loc]); } - else if (onTiger) + else { NSColor *color = [bmRep colorAtX: x y: y]; CGFloat r, g, b, a; @@ -445,7 +444,6 @@ static EmacsImage *ImageList = nil; | ((int)(b * 255.0)); } - return 0; } - (void) setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r @@ -463,7 +461,7 @@ static EmacsImage *ImageList = nil; pixmapData[2][loc] = b; pixmapData[3][loc] = a; } - else if (onTiger) + else { [bmRep setColor: [NSColor colorWithCalibratedRed: (r/255.0) green: (g/255.0) @@ -483,7 +481,7 @@ static EmacsImage *ImageList = nil; pixmapData[3][loc] = a; } - else if (onTiger) + else { NSColor *color = [bmRep colorAtX: x y: y]; color = [color colorWithAlphaComponent: (a / 255.0)]; diff --git a/src/nsmenu.m b/src/nsmenu.m index b60cc005c5f..9af732c6c45 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -722,11 +722,6 @@ extern NSString *NSMenuDidBeginTrackingNotification; #ifdef NS_IMPL_GNUSTEP if ([[self window] isVisible]) [self sizeToFit]; -#else -#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2 - if ([self supermenu] == nil) - [self sizeToFit]; -#endif #endif } diff --git a/src/nsselect.m b/src/nsselect.m index 95bc1a95957..c0c412c6fb2 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -295,7 +295,7 @@ ns_string_from_pasteboard (id pb) utfStr = [mstr UTF8String]; length = [mstr lengthOfBytesUsingEncoding: NSUTF8StringEncoding]; -#if ! defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4 +#if ! defined (NS_IMPL_COCOA) if (!utfStr) { utfStr = [mstr cString]; @@ -306,7 +306,7 @@ ns_string_from_pasteboard (id pb) NS_HANDLER { message1 ("ns_string_from_pasteboard: UTF8String failed\n"); -#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 +#if defined (NS_IMPL_COCOA) utfStr = "Conversion failed"; #else utfStr = [str lossyCString]; diff --git a/src/nsterm.h b/src/nsterm.h index f1cd7458bdc..958d1ce7853 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -26,9 +26,6 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_NS #ifdef NS_IMPL_COCOA -#ifndef MAC_OS_X_VERSION_10_3 -#define MAC_OS_X_VERSION_10_3 1030 -#endif #ifndef MAC_OS_X_VERSION_10_4 #define MAC_OS_X_VERSION_10_4 1040 #endif @@ -286,7 +283,6 @@ along with GNU Emacs. If not, see . */ int refCount; NSBitmapImageRep *bmRep; /* used for accessing pixel data */ unsigned char *pixmapData[5]; /* shortcut to access pixel data */ - BOOL onTiger; NSColor *stippleMask; } + allocInitFromFile: (Lisp_Object)file; @@ -355,7 +351,7 @@ along with GNU Emacs. If not, see . */ /* ========================================================================== - Rendering on Panther and above + Rendering ========================================================================== */ @@ -380,7 +376,7 @@ extern NSString *ns_app_name; extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu; /* Apple removed the declaration, but kept the implementation */ -#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 +#if defined (NS_IMPL_COCOA) @interface NSApplication (EmacsApp) - (void)setAppleMenu: (NSMenu *)menu; @end @@ -483,10 +479,9 @@ struct nsfont_info float size; #ifdef __OBJC__ NSFont *nsfont; - /* cgfont and synthItal are used only on OS X 10.3+ */ -#if defined (NS_IMPL_COCOA) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) +#if defined (NS_IMPL_COCOA) CGFontRef cgfont; -#else /* GNUstep or OS X < 10.3 */ +#else /* GNUstep */ void *cgfont; #endif #else /* ! OBJC */ diff --git a/src/nsterm.m b/src/nsterm.m index 75f33fea75e..d6689c08aa2 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -569,9 +569,6 @@ ns_menu_bar_should_be_hidden (void) static void ns_update_auto_hide_menu_bar (void) { -#ifndef MAC_OS_X_VERSION_10_6 -#define MAC_OS_X_VERSION_10_6 1060 -#endif #ifdef NS_IMPL_COCOA #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 block_input (); @@ -7087,7 +7084,7 @@ allowing it to be used at a lower level for accented character entry."); ns_function_modifier = Qnone; DEFVAR_LISP ("ns-antialias-text", ns_antialias_text, - "Non-nil (the default) means to render text antialiased. Only has an effect on OS X Panther and above."); + "Non-nil (the default) means to render text antialiased."); ns_antialias_text = Qt; DEFVAR_LISP ("ns-confirm-quit", ns_confirm_quit, -- cgit v1.2.1 From dc67e786892c66f49d577d7447fe1bc407661818 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 7 Oct 2012 06:19:00 -0400 Subject: Auto-commit of generated files. --- autogen/configure | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/autogen/configure b/autogen/configure index f08dd5503a2..623d93bb39c 100755 --- a/autogen/configure +++ b/autogen/configure @@ -8814,7 +8814,9 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi -ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "$ac_includes_default" +ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include + +" if test "x$ac_cv_have_decl_sys_siglist" = x""yes; then : ac_have_decl=1 else @@ -8827,7 +8829,9 @@ _ACEOF if test $ac_cv_have_decl_sys_siglist != yes; then # For Tru64, at least: - ac_fn_c_check_decl "$LINENO" "__sys_siglist" "ac_cv_have_decl___sys_siglist" "$ac_includes_default" + ac_fn_c_check_decl "$LINENO" "__sys_siglist" "ac_cv_have_decl___sys_siglist" "#include + +" if test "x$ac_cv_have_decl___sys_siglist" = x""yes; then : ac_have_decl=1 else @@ -9510,6 +9514,32 @@ else fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#ifdef MAC_OS_X_VERSION_MAX_ALLOWED +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 + ; /* OK */ +#else +#error "OSX 10.4 or newer required" +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ns_osx_have_104=yes +else + ns_osx_have_104=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -9527,6 +9557,9 @@ else ns_have_nsinteger=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ns_osx_have_104 = no; then + as_fn_error "\`OSX 10.4 or newer is required'" "$LINENO" 5; + fi if test $ns_have_nsinteger = yes; then $as_echo "#define NS_HAVE_NSINTEGER 1" >>confdefs.h -- cgit v1.2.1 From 817330b512a1453571c619e01114a02fd6d9aba9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 7 Oct 2012 06:23:48 -0400 Subject: Auto-commit of loaddefs files. --- lisp/mail/rmail.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 828cd6e72e7..c75a1989e8e 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4605,7 +4605,7 @@ With prefix argument N moves forward N messages with these labels. ;;;*** -;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "0c18b83f914803d1216e1a9df7ea5275") +;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "f1937f85a1258de8880a089fa5ae5621") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ -- cgit v1.2.1 From 493b5b1c4a7e8b27a0e57c596a83e8b4acad591c Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sun, 7 Oct 2012 13:09:04 +0200 Subject: * nsterm.m (ns_dumpglyphs_image): Only draw slize of image (Bug#12506). --- src/ChangeLog | 3 ++- src/nsterm.m | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 45e3c8a8a57..492b966a256 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,10 @@ 2012-10-07 Jan Djärv + * nsterm.m (ns_dumpglyphs_image): Only draw slize of image (Bug#12506). + * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of MAC_OS_X_VERSION_10_6. (syms_of_nsterm): Remove comment about Panther and above for ns-antialias-text. - * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove. (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4. (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3. diff --git a/src/nsterm.m b/src/nsterm.m index d6689c08aa2..6b739befeeb 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2975,8 +2975,10 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) { #if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 NSRect dr = NSMakeRect (x, y, s->slice.width, s->slice.height); + NSRect ir = NSMakeRect (s->slice.x, s->slice.y, + s->slice.width, s->slice.height); [img drawInRect: dr - fromRect: NSZeroRect + fromRect: ir operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES -- cgit v1.2.1 From 78d876b90e52400b7bbb086ca1a471d3d20d0e98 Mon Sep 17 00:00:00 2001 From: Stefan Merten Date: Sun, 7 Oct 2012 14:48:09 +0200 Subject: * textmodes/rst.el (rst-new-adornment-down, rst-indent-field) (rst-indent-literal-normal, rst-indent-literal-minimized) (rst-indent-comment): Correct :version tag. --- lisp/ChangeLog | 6 ++++++ lisp/textmodes/rst.el | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e54e82233a2..f0621a89538 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-10-07 Stefan Merten + + * textmodes/rst.el (rst-new-adornment-down, rst-indent-field) + (rst-indent-literal-normal, rst-indent-literal-minimized) + (rst-indent-comment): Correct :version tag. + 2012-10-07 Glenn Morris * mail/rmailmm.el (rmail-mime-process-multipart): diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 02bb1e6371f..f2c74dfb941 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -218,7 +218,7 @@ and before TAIL-RE and DELIM-RE in VAR or DEFAULT for no match." ;; Use CVSHeader to really get information from CVS and not other version ;; control systems. (defconst rst-cvs-header - "$CVSHeader: sm/rst_el/rst.el,v 1.327.2.2 2012-09-23 14:44:25 stefan Exp $") + "$CVSHeader: sm/rst_el/rst.el,v 1.327.2.5 2012-10-07 12:44:34 stefan Exp $") (defconst rst-cvs-rev (rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+" " .*" rst-cvs-header "0.0") @@ -247,7 +247,7 @@ SVN revision is the upstream (docutils) revision.") "Official version of the package.") (defconst rst-official-cvs-rev (rst-extract-version "[%$]" "Revision: " "[0-9]+\\(?:\\.[0-9]+\\)+" " " - "$Revision: 1.327.2.2 $") + "$Revision: 1.327.2.5 $") "CVS revision of this file in the official version.") (defconst rst-version @@ -1545,7 +1545,6 @@ b. a negative numerical argument, which generally inverts the :type '(choice (const :tag "Same level as previous one" nil) (const :tag "One level down relative to the previous one" t)) - :version "24.3" :package-version '(rst . "1.1.0")) (rst-testcover-defcustom) @@ -2846,28 +2845,28 @@ here." (defcustom rst-indent-field 3 "Indentation for first line after a field or 0 to always indent for content." :group 'rst-indent - :version "24.3" + :package-version '(rst . "1.1.0") :type '(integer)) (rst-testcover-defcustom) (defcustom rst-indent-literal-normal 3 "Default indentation for literal block after a markup on an own line." :group 'rst-indent - :version "24.3" + :package-version '(rst . "1.1.0") :type '(integer)) (rst-testcover-defcustom) (defcustom rst-indent-literal-minimized 2 "Default indentation for literal block after a minimized markup." :group 'rst-indent - :version "24.3" + :package-version '(rst . "1.1.0") :type '(integer)) (rst-testcover-defcustom) (defcustom rst-indent-comment 3 "Default indentation for first line of a comment." :group 'rst-indent - :version "24.3" + :package-version '(rst . "1.1.0") :type '(integer)) (rst-testcover-defcustom) -- cgit v1.2.1