commit 51e7e463e93708a0e40688f91200e9e9869ec662 (HEAD, refs/remotes/origin/master) Author: Tassilo Horn Date: Sat Mar 14 09:27:31 2015 +0100 Font-lock elisp macros/special forms dynamically * emacs-lisp/lisp-mode.el (lisp--el-macro-regexp): New defconst. (lisp--el-update-macro-regexp, lisp--el-update-after-load) (lisp--el-match-macro): New functions. (lisp-mode-variables): Update lisp--el-macro-regexp and add lisp--el-update-after-load to after-load-functions. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fb2291c..73ba035 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2015-03-15 Tassilo Horn + + * emacs-lisp/lisp-mode.el (lisp--el-macro-regexp): New defconst. + (lisp--el-update-macro-regexp, lisp--el-update-after-load) + (lisp--el-match-macro): New functions. + (lisp-mode-variables): Update lisp--el-macro-regexp and add + lisp--el-update-after-load to after-load-functions. + 2015-03-15 Daniel Colascione * emacs-lisp/cl-indent.el diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 5d91209..b4f87fd 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -181,6 +181,33 @@ nil))) res)) +(defconst lisp--el-macro-regexp nil + "A regular expression matching all loaded elisp macros. +Can be updated using `lisp--el-update-macro-regexp' after new +macros were defined.") + +(defun lisp--el-update-macro-regexp () + "Update `lisp--el-update-macro-regexp' from `obarray'. +Return non-nil only if the old and new value are different." + (let ((old-regex lisp--el-macro-regexp) + (elisp-macros nil)) + (mapatoms (lambda (a) + (when (or (macrop a) (special-form-p a)) + (push (symbol-name a) elisp-macros)))) + (setq lisp--el-macro-regexp + (concat "(" (regexp-opt elisp-macros t) "\\_>")) + (not (string= old-regex lisp--el-macro-regexp)))) + +(defun lisp--el-update-after-load (_file) + "Update `lisp--el-macro-regexp' and adjust font-lock in existing buffers." + (when (lisp--el-update-macro-regexp) + (dolist (buf (buffer-list)) + (when (derived-mode-p 'emacs-lisp-mode) + (font-lock-flush))))) + +(defun lisp--el-match-macro (limit) + (re-search-forward lisp--el-macro-regexp limit t)) + (pcase-let ((`(,vdefs ,tdefs ,el-defs-re ,cl-defs-re @@ -194,7 +221,9 @@ "when" "unless" "with-output-to-string" "ignore-errors" "dotimes" "dolist" "declare")) (lisp-errs '("warn" "error" "signal")) - ;; Elisp constructs. FIXME: update dynamically from obarray. + ;; Elisp constructs. Now they are update dynamically + ;; from obarray but they are also used for setting up + ;; the keywords for Common Lisp. (el-fdefs '("define-advice" "defadvice" "defalias" "define-derived-mode" "define-minor-mode" "define-generic-mode" "define-global-minor-mode" @@ -333,7 +362,7 @@ `( ;; Regexp negated char group. ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend) ;; Control structures. Common Lisp forms. - (,(concat "(" el-kws-re "\\_>") . 1) + (lisp--el-match-macro . 1) ;; Exit/Feature symbols as constants. (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>" "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?") @@ -514,6 +543,9 @@ font-lock keywords will not be case sensitive." . lisp-font-lock-syntactic-face-function))) (setq-local prettify-symbols-alist lisp--prettify-symbols-alist) (when elisp + (unless lisp--el-macro-regexp + (lisp--el-update-macro-regexp)) + (add-hook 'after-load-functions #'lisp--el-update-after-load) (setq-local electric-pair-text-pairs (cons '(?\` . ?\') electric-pair-text-pairs))) (setq-local electric-pair-skip-whitespace 'chomp) commit 994168240aa3d81cb42cef2f049fec5739f9d850 Author: Daniel Colascione Date: Sun Mar 15 00:17:05 2015 -0700 Support indenting backquote substitutions in cl-indent * lisp/emacs-lisp/cl-indent.el (lisp-indent-backquote-substitution-mode): New user option. (common-lisp-indent-function-1, common-lisp-loop-part-indentation) (common-lisp-indent-function): Support normally indenting backquote substitutions. (extended-loop-p): Rename to `lisp-extended-loop-p'. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a9cf1b0..fb2291c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2015-03-15 Daniel Colascione + + * emacs-lisp/cl-indent.el + (lisp-indent-backquote-substitution-mode): New user option. + (common-lisp-indent-function-1, common-lisp-loop-part-indentation) + (common-lisp-indent-function): Support normally indenting + backquote substitutions. + (extended-loop-p): Rename to `lisp-extended-loop-p'. + 2015-03-14 Michael R. Mauger * progmodes/sql.el: Version 3.5 diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index 1bcfb6d..5e75406 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -138,6 +138,19 @@ If non-nil, alignment is done with the first parameter :type 'boolean :group 'lisp-indent) +(defcustom lisp-indent-backquote-substitution-mode t + "How to indent substitutions in backquotes. +If `t', the default, indent substituted forms normally. +If `nil', do not apply special indentation rule to substituted +forms. If `corrected', subtract the `,' or `,@' from the form +column, indenting as if this character sequence were not present. +In any case, do not backtrack beyond a backquote substitution. + +Until Emacs 25.1, the `nil' behavior was hard-wired." + :version "25.1" + :type '(choice (const corrected) (const nil) (const t)) + :group 'lisp-indent) + (defvar lisp-indent-defun-method '(4 &lambda &body) "Defun-like indentation method. @@ -145,7 +158,7 @@ This applies when the value of the `common-lisp-indent-function' property is set to `defun'.") -(defun extended-loop-p (loop-start) +(defun lisp-extended-loop-p (loop-start) "True if an extended loop form starts at LOOP-START." (condition-case () (save-excursion @@ -170,11 +183,22 @@ the standard lisp indent package." "Compute the indentation of loop form constituents." (let* ((loop-indentation (save-excursion (goto-char (elt state 1)) - (current-column)))) + (current-column)))) + (when (and (eq lisp-indent-backquote-substitution-mode 'corrected)) + (save-excursion + (goto-char (elt state 1)) + (incf loop-indentation + (cond ((eq (char-before) ?,) -1) + ((and (eq (char-before) ?@) + (progn (backward-char) + (eq (char-before) ?,))) + -2) + (t 0))))) + (goto-char indent-point) (beginning-of-line) (list - (cond ((not (extended-loop-p (elt state 1))) + (cond ((not (lisp-extended-loop-p (elt state 1))) (+ loop-indentation lisp-simple-loop-indentation)) ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)") (+ loop-indentation lisp-loop-keyword-indentation)) @@ -264,9 +288,15 @@ at `common-lisp-indent-function' and, if set, use its value instead." ;; FIXME: why do we need to special-case loop? (if (save-excursion (goto-char (elt state 1)) - (looking-at (if (derived-mode-p 'emacs-lisp-mode) - "(\\(cl-\\)?[Ll][Oo][Oo][Pp]" - "([Ll][Oo][Oo][Pp]"))) + (and (looking-at (if (derived-mode-p 'emacs-lisp-mode) + "(\\(cl-\\)?loop" + "([Ll][Oo][Oo][Pp]")) + (or lisp-indent-backquote-substitution-mode + (not + (or (and (eq (char-before) ?@) + (progn (backward-char) + (eq (char-before) ?,))) + (eq (char-before) ?,)))))) (common-lisp-loop-part-indentation indent-point state) (common-lisp-indent-function-1 indent-point state))) @@ -373,11 +403,21 @@ instead." (not (eq (char-after (- containing-sexp 2)) ?\#))) ;; No indentation for "'(...)" elements (setq calculated (1+ sexp-column))) - ((or (eq (char-after (1- containing-sexp)) ?\,) - (and (eq (char-after (1- containing-sexp)) ?\@) - (eq (char-after (- containing-sexp 2)) ?\,))) - ;; ",(...)" or ",@(...)" - (setq calculated normal-indent)) + ((when + (or (eq (char-after (1- containing-sexp)) ?\,) + (and (eq (char-after (1- containing-sexp)) ?\@) + (eq (char-after (- containing-sexp 2)) ?\,))) + ;; ",(...)" or ",@(...)" + (when (eq lisp-indent-backquote-substitution-mode + 'corrected) + (incf sexp-column -1) + (when (eq (char-after (1- containing-sexp)) ?\@) + (incf sexp-column -1))) + (cond (lisp-indent-backquote-substitution-mode + (setf tentative-calculated normal-indent) + (setq depth lisp-indent-maximum-backtracking) + nil) + (t (setq calculated normal-indent))))) ((eq (char-after (1- containing-sexp)) ?\#) ;; "#(...)" (setq calculated (1+ sexp-column))) commit 2f12fc56bf094dbbeb4fde1980627432a82ae23f Merge: 84a6685 554001d Author: Michael R. Mauger Date: Sat Mar 14 23:51:44 2015 -0400 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 84a6685660fd7585d9b7a5bb30dda7cf41c3ea84 Author: Michael R. Mauger Date: Sat Mar 14 23:05:28 2015 -0400 2015-03-14 Michael R. Mauger * progmodes/sql.el: Version 3.5 (sql-starts-with-prompt-re, sql-ends-with-prompt-re): Match password prompts. (sql-interactive-remove-continuation-prompt): Fixed regression. (Bug#6686) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8da573e..e0891e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-03-14 Michael R. Mauger + + * progmodes/sql.el: Version 3.5 + (sql-starts-with-prompt-re, sql-ends-with-prompt-re): Match password prompts. + (sql-interactive-remove-continuation-prompt): Fixed regression. (Bug#6686) + 2015-03-14 Daniel Colascione * startup.el (command-line): Process "--no-x-resources". diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 2ed3a74..3800cfb 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -4,7 +4,7 @@ ;; Author: Alex Schroeder ;; Maintainer: Michael Mauger -;; Version: 3.4 +;; Version: 3.5 ;; Keywords: comm languages processes ;; URL: http://savannah.gnu.org/projects/emacs/ @@ -3296,13 +3296,13 @@ Allows the suppression of continuation prompts.") (defun sql-starts-with-prompt-re () "Anchor the prompt expression at the beginning of the output line. Remove the start of line regexp." - (replace-regexp-in-string "\\^" "\\\\`" comint-prompt-regexp)) + (concat "\\`" comint-prompt-regexp)) (defun sql-ends-with-prompt-re () "Anchor the prompt expression at the end of the output line. -Remove the start of line regexp from the prompt expression since -it may not follow newline characters in the output line." - (concat (replace-regexp-in-string "\\^" "" sql-prompt-regexp) "\\'")) +Match a SQL prompt or a password prompt." + (concat "\\(?:\\(?:" sql-prompt-regexp "\\)\\|" + "\\(?:" comint-password-prompt-regexp "\\)\\)\\'")) (defun sql-interactive-remove-continuation-prompt (oline) "Strip out continuation prompts out of the OLINE. @@ -3321,7 +3321,17 @@ to the next chunk to properly match the broken-up prompt. If the filter gets confused, it should reset and stop filtering to avoid deleting non-prompt output." - (when comint-prompt-regexp + ;; continue gathering lines of text iff + ;; + we know what a prompt looks like, and + ;; + there is held text, or + ;; + there are continuation prompt yet to come, or + ;; + not just a prompt string + (when (and comint-prompt-regexp + (or (> (length (or sql-preoutput-hold "")) 0) + (> (or sql-output-newline-count 0) 0) + (not (or (string-match sql-prompt-regexp oline) + (string-match sql-prompt-cont-regexp oline))))) + (save-match-data (let (prompt-found last-nl) @@ -3357,16 +3367,19 @@ to avoid deleting non-prompt output." sql-preoutput-hold "")) ;; Break up output by physical lines if we haven't hit the final prompt - (unless (and (not (string= oline "")) - (string-match (sql-ends-with-prompt-re) oline) - (>= (match-end 0) (length oline))) - (setq last-nl 0) - (while (string-match "\n" oline last-nl) - (setq last-nl (match-end 0))) - (setq sql-preoutput-hold (concat (substring oline last-nl) - sql-preoutput-hold) - oline (substring oline 0 last-nl)))))) - oline) + (let ((end-re (sql-ends-with-prompt-re))) + (unless (and (not (string= oline "")) + (string-match end-re oline) + (>= (match-end 0) (length oline))) + ;; Find everything upto the last nl + (setq last-nl 0) + (while (string-match "\n" oline last-nl) + (setq last-nl (match-end 0))) + ;; Hold after the last nl, return upto last nl + (setq sql-preoutput-hold (concat (substring oline last-nl) + sql-preoutput-hold) + oline (substring oline 0 last-nl))))))) + oline) ;;; Sending the region to the SQLi buffer. commit 554001dfa90be447dc0c71c596eb837d8e3b374b Author: Daniel Colascione Date: Sat Mar 14 16:32:04 2015 -0700 Type checking for `define-widget' * lisp/widget.el (define-widget): Check that documentation is a string or nil; prevent wailing and gnashing of teeth when users forget to pass a docstring and wonder why their properties don't work. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8da573e..5004924 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2015-03-14 Daniel Colascione + * widget.el (define-widget): Check that documentation is a string + or nil; prevent wailing and gnashing of teeth when users forget to + pass a docstring and wonder why their properties don't work. + * startup.el (command-line): Process "--no-x-resources". 2015-03-13 Kevin Ryde diff --git a/lisp/widget.el b/lisp/widget.el index f8faa0f..539f91e 100644 --- a/lisp/widget.el +++ b/lisp/widget.el @@ -83,6 +83,9 @@ create identical widgets: * (apply 'widget-create CLASS ARGS) The third argument DOC is a documentation string for the widget." + ;; + (unless (or (null doc) (stringp doc)) + (error "widget documentation must be `nil' or a string.")) (put name 'widget-type (cons class args)) (put name 'widget-documentation (purecopy doc)) name) commit 3bf369928e44fd83c27ef436b05d9cd2b4abbfba Author: Daniel Colascione Date: Sat Mar 14 14:53:33 2015 -0700 Add --no-x-resources option * lisp/startup.el (command-line): Process "--no-x-resources". * src/emacs.c (standard_args): Add --no-x-resources. (usage_message): Document that -Q implies --no-x-resources. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d393190..8da573e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2015-03-14 Daniel Colascione + + * startup.el (command-line): Process "--no-x-resources". + 2015-03-13 Kevin Ryde info-look fixes for Texinfo 5 diff --git a/lisp/startup.el b/lisp/startup.el index 999e53e..7fa929a 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -875,7 +875,8 @@ please check its value") ;; processed. This is consistent with the way main in emacs.c ;; does things. (while (and (not done) args) - (let* ((longopts '(("--no-init-file") ("--no-site-file") ("--debug-init") + (let* ((longopts '(("--no-init-file") ("--no-site-file") + ("--no-x-resources") ("--debug-init") ("--user") ("--iconic") ("--icon-type") ("--quick") ("--no-blinking-cursor") ("--basic-display"))) (argi (pop args)) @@ -906,7 +907,9 @@ please check its value") ((member argi '("-Q" "-quick")) (setq init-file-user nil site-run-file nil - inhibit-x-resources t)) + inhibit-x-resources t)) + ((member argi '("-no-x-resources")) + (setq inhibit-x-resources t)) ((member argi '("-D" "-basic-display")) (setq no-blinking-cursor t emacs-basic-display t) diff --git a/src/ChangeLog b/src/ChangeLog index d9612db..cb4aad6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-03-14 Daniel Colascione + + * emacs.c (standard_args): Add --no-x-resources. + (usage_message): Document that -Q implies --no-x-resources. + 2015-03-13 Paul Eggert * frame.c (x_get_resource_string) [!USE_GTK]: Don't define. diff --git a/src/emacs.c b/src/emacs.c index ca5633d..d318fd4 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -237,6 +237,7 @@ Initialization options:\n\ --no-init-file, -q load neither ~/.emacs nor default.el\n\ --no-loadup, -nl do not load loadup.el into bare Emacs\n\ --no-site-file do not load site-start.el\n\ +--no-x-resources do not load X resources\n\ --no-site-lisp, -nsl do not add site-lisp directories to load-path\n\ --no-splash do not display a splash screen on startup\n\ --no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\ @@ -244,6 +245,7 @@ Initialization options:\n\ "\ --quick, -Q equivalent to:\n\ -q --no-site-file --no-site-lisp --no-splash\n\ + --no-x-resources\n\ --script FILE run FILE as an Emacs Lisp script\n\ --terminal, -t DEVICE use DEVICE for terminal I/O\n\ --user, -u USER load ~USER/.emacs instead of your own\n\ @@ -1661,6 +1663,7 @@ static const struct standard_args standard_args[] = { "-quick", 0, 55, 0 }, { "-q", "--no-init-file", 50, 0 }, { "-no-init-file", 0, 50, 0 }, + { "-no-x-resources", "--no-x-resources", 40, 0 }, { "-no-site-file", "--no-site-file", 40, 0 }, { "-u", "--user", 30, 1 }, { "-user", 0, 30, 1 }, commit 85f1a56f156f7f9aab1464318970b3a1d97fa533 Author: Jan D Date: Sat Mar 14 16:14:09 2015 +0100 Mention Bug 19482 on 2015-01-06 change. diff --git a/src/ChangeLog b/src/ChangeLog index c8189ff..d9612db 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1449,7 +1449,8 @@ 2015-01-06 Jan Djärv * nsterm.m (x_set_window_size): Call updateFrameSize to get real - size instead of using widht/height. The frame may be constrained. + size instead of using widht/height. The frame may be + constrained (Bug#19482). 2015-01-05 Paul Eggert