commit 68273707ecbca6ff6d34071c04c2b395384c41e5 (HEAD, refs/remotes/origin/master) Author: Dmitry Gutov Date: Tue Jun 9 01:08:01 2015 +0300 Skip past `#' to find BEG * lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Skip past `#' to find BEG (bug#20771). * test/automated/elisp-mode-tests.el (elisp-completes-functions-after-hash-quote): New test. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index e12d133..9494e97 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -460,7 +460,7 @@ It can be quoted, or be inside a quoted form." (beg (condition-case nil (save-excursion (backward-sexp 1) - (skip-chars-forward "`',‘") + (skip-chars-forward "`',‘#") (point)) (scan-error pos))) (end diff --git a/test/automated/elisp-mode-tests.el b/test/automated/elisp-mode-tests.el index 7af6dfc..85f6da2 100644 --- a/test/automated/elisp-mode-tests.el +++ b/test/automated/elisp-mode-tests.el @@ -78,6 +78,15 @@ (should (member "backup-buffer" comps)) (should-not (member "backup-inhibited" comps)))))) +(ert-deftest elisp-completes-functions-after-hash-quote () + (ert-deftest elisp-completes-functions-after-let-bindings () + (with-temp-buffer + (emacs-lisp-mode) + (insert "#'ba") + (let ((comps (elisp--test-completions))) + (should (member "backup-buffer" comps)) + (should-not (member "backup-inhibited" comps)))))) + (ert-deftest elisp-completes-local-variables () (with-temp-buffer (emacs-lisp-mode) commit 55200b4ca595cf1588fd0cefcece151ac84cb19a Author: Eli Zaretskii Date: Mon Jun 8 21:15:05 2015 +0300 Fix compilation warning/error in --without-x builds * src/xdisp.c (append_space_for_newline): Condition GUI-specific code on HAVE_WINDOW_SYSTEM. diff --git a/src/xdisp.c b/src/xdisp.c index 14385fa..f0e3090 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -19200,6 +19200,7 @@ append_space_for_newline (struct it *it, bool default_face_p) PRODUCE_GLYPHS (it); +#ifdef HAVE_WINDOW_SYSTEM /* Make sure this space glyph has the right ascent and descent values, or else cursor at end of line will look funny. */ @@ -19216,6 +19217,7 @@ append_space_for_newline (struct it *it, bool default_face_p) g->ascent = it->max_ascent; g->descent = it->max_descent; +#endif it->override_ascent = -1; it->constrain_row_ascent_descent_p = false; commit 8d9e5bab41aa1995d801112b8413b514e59f033e Author: Eli Zaretskii Date: Mon Jun 8 21:04:08 2015 +0300 Improve the default fontset wrt symbols * lisp/international/fontset.el (setup-default-fontset): Better setup of fontset-default for symbols: use Symbola and FreeMono. (Bug#20727) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 06a47af..ebf1290 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -693,6 +693,51 @@ (cons (car math-subgroup) (nth 1 math-subgroup)) (font-spec :registry "iso10646-1" :script (nth 2 math-subgroup)))) + ;; Special setup for various symbols and some rarely used characters + ;; covered well by Symbola. + (dolist (symbol-subgroup '((#x0250 . #x02AF) ;; IPA Extensions + (#x0370 . #x03FF) ;; Greek and Coptic + (#x0500 . #x052F) ;; Cyrillic Supplement + (#x2000 . #x206F) ;; General Punctuation + (#x2070 . #x209F) ;; Superscripts and Subscripts + (#x20A0 . #x20CF) ;; Currency Symbols + (#x2100 . #x214F) ;; Letterlike Symbols + (#x2150 . #x218F) ;; Number Forms + (#x2190 . #x21FF) ;; Arrows + (#x2200 . #x22FF) ;; Mathematical Operators + (#x2300 . #x23FF) ;; Miscellaneous Technical + (#x2400 . #x243F) ;; Control Pictures + (#x2440 . #x245F) ;; Optical Char Recognition + (#x2460 . #x24FF) ;; Enclosed Alphanumerics + (#x25A0 . #x25FF) ;; Geometric Shapes + (#x2600 . #x26FF) ;; Miscellaneous Symbols + (#x2700 . #x27bF) ;; Dingbats + (#x27C0 . #x27EF) ;; Misc Mathematical Symbols-A + (#x27F0 . #x27FF) ;; Supplemental Arrows-A + (#x2900 . #x297F) ;; Supplemental Arrows-B + (#x2980 . #x29FF) ;; Misc Mathematical Symbols-B + (#x2A00 . #x2AFF) ;; Suppl. Math Operators + (#x2B00 . #x2BFF) ;; Misc Symbols and Arrows + (#x2E00 . #x2E7F) ;; Supplemental Punctuation + (#x4DC0 . #x4DFF) ;; Yijing Hexagram Symbols + (#xFE10 . #xFE1F) ;; Vertical Forms + (#x10100 . #x1013F) ;; Aegean Numbers + (#x102E0 . #x102FF) ;; Coptic Epact Numbers + (#x1D000 . #x1D0FF) ;; Byzanthine Musical Symbols + (#x1D200 . #x1D24F) ;; Ancient Greek Musical Notation + (#x1F0A0 . #x1F0FF) ;; Playing Cards + (#x1F100 . #x1F1FF) ;; Enclosed Alphanumeric Suppl + (#x1F300 . #x1F5FF) ;; Misc Symbols and Pictographs + (#x1F600 . #x1F64F) ;; Emoticons + (#x1F650 . #x1F67F) ;; Ornamental Dingbats + (#x1F680 . #x1F6FF) ;; Transport and Map Symbols + (#x1F700 . #x1F77F) ;; Alchemical Symbols + (#x1F780 . #x1F7FF) ;; Geometric Shapes Extended + (#x1F800 . #x1F8FF))) ;; Supplemental Arrows-C + (set-fontset-font "fontset-default" symbol-subgroup "Symbola")) + ;; Box Drawing and Block Elements + (set-fontset-font "fontset-default" '(#x2500 . #x259F) "FreeMono") + ;; Append CJK fonts for characters other than han, kana, cjk-misc. ;; Append fonts for scripts whose name is also a charset name. (let* ((data (build-default-fontset-data)) commit 20de61c833d4c975dc1ed3062d8de75df8b5cd93 Author: Oleh Krehel Date: Mon Jun 8 16:41:00 2015 +0200 Add new command checkdoc-package-keywords * lisp/emacs-lisp/checkdoc.el (checkdoc-package-keywords-flag): New defcustom. (checkdoc-list-of-strings-p): Add doc. (checkdoc-current-buffer): When `checkdoc-package-keywords-flag' is non-nil, call `checkdoc-package-keywords'. (checkdoc-get-keywords): New defun. (checkdoc-package-keywords): New command. Warns if the current file has package.el-style keywords that aren't in `finder-known-keywords'. * etc/NEWS: Add entry. diff --git a/etc/NEWS b/etc/NEWS index 51d0a5f4..571adad 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -84,6 +84,11 @@ command line when `initial-buffer-choice' is non-nil. * Changes in Emacs 25.1 +** New command `checkdoc-package-keywords' checks if the +current package keywords are recognized. Set the new option +`checkdoc-package-keywords-flag' to non-nil to make +`checkdoc-current-buffer' call this function automatically. + ** New function `checkdoc-file' checks for style errors. It's meant for use together with `compile': emacs -batch --eval "(checkdoc-file \"subr.el\")" diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 869ae43..b20e4f1 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -267,6 +267,11 @@ made in the style guide relating to order." :type 'boolean) ;;;###autoload(put 'checkdoc-arguments-in-order-flag 'safe-local-variable #'booleanp) +(defcustom checkdoc-package-keywords-flag nil + "Non-nil means warn if this file's package keywords are not recognized. +Currently, all recognized keywords must be on `finder-known-keywords'." + :type 'boolean) + (define-obsolete-variable-alias 'checkdoc-style-hooks 'checkdoc-style-functions "24.3") (defvar checkdoc-style-functions nil @@ -315,6 +320,7 @@ This should be set in an Emacs Lisp file's local variables." ;;;###autoload (defun checkdoc-list-of-strings-p (obj) + "Return t when OBJ is a list of strings." ;; this is a function so it might be shared by checkdoc-proper-noun-list ;; and/or checkdoc-ispell-lisp-words in the future (and (listp obj) @@ -866,6 +872,8 @@ otherwise stop after the first error." (checkdoc-start) (checkdoc-message-text) (checkdoc-rogue-spaces) + (when checkdoc-package-keywords-flag + (checkdoc-package-keywords)) (not (called-interactively-p 'interactive)) (if take-notes (checkdoc-show-diagnostics)) (message "Checking buffer for style...Done.")))) @@ -2644,6 +2652,37 @@ function called to create the messages." (setq checkdoc-pending-errors nil) nil))) +(defun checkdoc-get-keywords () + "Return a list of package keywords for the current file." + (require 'finder) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "^;; Keywords: \\(.*\\)$" nil t) + (split-string (match-string-no-properties 1) ", " t)))) + +;;;###autoload +(defun checkdoc-package-keywords () + "Find package keywords that aren't in `finder-known-keywords'." + (interactive) + (let ((unrecognized-keys + (cl-remove-if + (lambda (x) (assoc (intern-soft x) finder-known-keywords)) + (checkdoc-get-keywords)))) + (if unrecognized-keys + (let* ((checkdoc-autofix-flag 'never) + (checkdoc-generate-compile-warnings-flag t)) + (save-excursion + (goto-char (point-min)) + (re-search-forward "^;; Keywords: \\(.*\\)$" nil t) + (checkdoc-start-section "checkdoc-package-keywords") + (checkdoc-create-error + (concat "Unrecognized keywords: " + (mapconcat #'identity unrecognized-keys ", ")) + (match-beginning 1) (match-end 1))) + (checkdoc-show-diagnostics)) + (when (called-interactively-p 'any) + (message "No Package Keyword Errors."))))) + (custom-add-option 'emacs-lisp-mode-hook 'checkdoc-minor-mode) (provide 'checkdoc) commit 296dadb14e19926de1fc5e0015cb8d4f10f9547a Author: Eli Zaretskii Date: Mon Jun 8 17:39:35 2015 +0300 Avoid crashes when key-binding is called from a timer * src/keymap.c (Fkey_binding): Don't segfault if called with an empty vector as KEY. (Bug#20705) diff --git a/src/keymap.c b/src/keymap.c index 8f4ac0d..b69b409 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1652,10 +1652,14 @@ specified buffer position instead of point are used. if (NILP (position) && VECTORP (key)) { - Lisp_Object event - /* mouse events may have a symbolic prefix indicating the - scrollbar or mode line */ - = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0); + Lisp_Object event; + + if (ASIZE (key) == 0) + return Qnil; + + /* mouse events may have a symbolic prefix indicating the + scrollbar or mode line */ + event = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0); /* We are not interested in locations without event data */ commit a04d35cb02528c5584f01c1e3a2bbd86c943b221 Author: Eli Zaretskii Date: Mon Jun 8 17:22:44 2015 +0300 Fix a thinko in arc-mode.el * lisp/arc-mode.el (archive-zip-summarize): Fix last change in the non-Zip64 case. (Bug#20769) diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 5f2fc8f..4df41b5 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1841,8 +1841,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (or (string= "PK\006\006" (buffer-substring p (+ p 4))) (error "Unrecognized ZIP file format")) ;; Offset to central directory: - (setq p (+ (point-min) - (archive-l-e (+ p 48) (if emacs-int-has-32bits 4 8))))) + (setq p (archive-l-e (+ p 48) (if emacs-int-has-32bits 4 8)))) + (setq p (+ p (point-min))) (while (string= "PK\001\002" (buffer-substring p (+ p 4))) (let* ((creator (byte-after (+ p 5))) ;; (method (archive-l-e (+ p 10) 2)) commit f1aa40f47d774d06f8798b5866051c78c4129ce5 Author: Artur Malabarba Date: Mon Jun 8 10:50:22 2015 +0100 * lisp/emacs-lisp/package.el (package-delete): Make interactive diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 6fecd9a..981f42c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1979,12 +1979,31 @@ If some packages are not installed propose to install them." "Delete package PKG-DESC. Argument PKG-DESC is a full description of package as vector. +Interactively, prompt the user for the package name and version. + When package is used elsewhere as dependency of another package, refuse deleting it and return an error. -If FORCE is non-nil package will be deleted even if it is used -elsewhere. +If prefix argument FORCE is non-nil, package will be deleted even +if it is used elsewhere. If NOSAVE is non-nil, the package is not removed from `package-selected-packages'." + (interactive + (progn + ;; Initialize the package system to get the list of package + ;; symbols for completion. + (unless package--initialized + (package-initialize t)) + (let* ((package-table + (mapcar + (lambda (p) (cons (package-desc-full-name p) p)) + (delq nil + (mapcar (lambda (p) (unless (package-built-in-p p) p)) + (apply #'append (mapcar #'cdr package-alist)))))) + (package-name (completing-read "Delete package: " + (mapcar #'car package-table) + nil t))) + (list (cdr (assoc package-name package-table)) + current-prefix-arg nil)))) (let ((dir (package-desc-dir pkg-desc)) (name (package-desc-name pkg-desc)) pkg-used-elsewhere-by)