;;; elisp-mode.el --- Emacs Lisp mode -*- lexical-binding:t -*-
-;; Copyright (C) 1985-1986, 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1999-2016 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: lisp, languages
;; Font-locking support.
(defun elisp--font-lock-flush-elisp-buffers (&optional file)
- ;; FIXME: Aren't we only ever called from after-load-functions?
- ;; Don't flush during load unless called from after-load-functions.
- ;; In that case, FILE is non-nil. It's somehow strange that
- ;; load-in-progress is t when an after-load-function is called since
- ;; that should run *after* the load...
+ ;; We're only ever called from after-load-functions, load-in-progress can
+ ;; still be t in case of nested loads.
(when (or (not load-in-progress) file)
;; FIXME: If the loaded file did not define any macros, there shouldn't
;; be any need to font-lock-flush all the Elisp buffers.
" " (cadr table-etc)))
(cddr table-etc)))))))))
-(defun lisp-completion-at-point (_predicate)
+(defun lisp-completion-at-point (&optional _predicate)
(declare (obsolete elisp-completion-at-point "25.1"))
(elisp-completion-at-point))
(pcase-let (((cl-struct xref-elisp-location symbol type file) l))
(let ((buffer-point (find-function-search-for-symbol symbol type file)))
(with-current-buffer (car buffer-point)
- (goto-char (or (cdr buffer-point) (point-min)))
- (point-marker)))))
+ (save-excursion
+ (goto-char (or (cdr buffer-point) (point-min)))
+ (point-marker))))))
(cl-defmethod xref-location-group ((l xref-elisp-location))
(xref-elisp-location-file l))
((or (eq (following-char) ?\')
(eq (preceding-char) ?\'))
(setq left-quote ?\`)))
+
+ ;; When after a named character literal, skip over the entire
+ ;; literal, not only its last word.
+ (when (= (preceding-char) ?})
+ (let ((begin (save-excursion
+ (backward-char)
+ (skip-syntax-backward "w-")
+ (backward-char 3)
+ (when (looking-at-p "\\\\N{") (point)))))
+ (when begin (goto-char begin))))
+
(forward-sexp -1)
;; If we were after `?\e' (or similar case),
;; use the whole thing, not just the `e'.
ARGLIST is either a string, or a list of strings or symbols."
(let ((str (cond ((stringp arglist) arglist)
((not (listp arglist)) nil)
- (t (help--make-usage-docstring 'toto arglist)))))
+ (t (substitute-command-keys
+ (help--make-usage-docstring 'toto arglist))))))
(if (and str (string-match "\\`([^ )]+ ?" str))
(replace-match "(" t t str)
str)))