2019-10-23 21:48:41 +00:00
|
|
|
|
;;; mode-local.el --- Support for mode local facilities -*- lexical-binding:t -*-
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;;
|
2023-01-01 10:31:12 +00:00
|
|
|
|
;; Copyright (C) 2004-2005, 2007-2023 Free Software Foundation, Inc.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: David Ponce <david@dponce.com>
|
|
|
|
|
;; Created: 27 Apr 2004
|
|
|
|
|
;; 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
|
2017-09-13 22:52:52 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; Each major mode will want to support a specific set of behaviors.
|
|
|
|
|
;; Usually generic behaviors that need just a little bit of local
|
|
|
|
|
;; specifics.
|
|
|
|
|
;;
|
|
|
|
|
;; This library permits the setting of override functions for tasks of
|
|
|
|
|
;; that nature, and also provides reasonable defaults.
|
|
|
|
|
;;
|
2016-12-21 20:07:43 +00:00
|
|
|
|
;; There are buffer local variables (and there were frame local variables).
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;; This library gives the illusion of mode specific variables.
|
|
|
|
|
;;
|
|
|
|
|
;; You should use a mode-local variable or override to allow extension
|
|
|
|
|
;; only if you expect a mode author to provide that extension. If a
|
2011-11-20 03:48:53 +00:00
|
|
|
|
;; user might wish to customize a given variable or function then
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;; the existing customization mechanism should be used.
|
|
|
|
|
|
|
|
|
|
;; To Do:
|
|
|
|
|
;; Allow customization of a variable for a specific mode?
|
2022-05-22 20:10:58 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Add macro for defining the '-default' functionality.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2015-08-26 21:43:29 +00:00
|
|
|
|
(require 'find-func)
|
|
|
|
|
;; For find-function-regexp-alist. It is tempting to replace this
|
2015-09-03 22:31:12 +00:00
|
|
|
|
;; ‘require’ by (defvar find-function-regexp-alist) and
|
2015-08-26 21:43:29 +00:00
|
|
|
|
;; with-eval-after-load, but model-local.el is typically loaded when a
|
|
|
|
|
;; semantic autoload is invoked, and something in semantic loads
|
|
|
|
|
;; find-func.el before mode-local.el, so the eval-after-load is lost.
|
|
|
|
|
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;;; Misc utilities
|
|
|
|
|
;;
|
|
|
|
|
(defun mode-local-map-file-buffers (function &optional predicate buffers)
|
|
|
|
|
"Run FUNCTION on every file buffer found.
|
|
|
|
|
FUNCTION does not have arguments; when it is entered `current-buffer'
|
|
|
|
|
is the currently selected file buffer.
|
lisp/*.el, src/*.c: Fix typos in docstrings
* lisp/apropos.el (apropos-do-all):
* lisp/auth-source-pass.el (auth-source-pass--select-from-entries):
* lisp/auth-source.el (auth-source-user-or-password):
* lisp/calc/calc-forms.el (math-tzone-names):
* lisp/calendar/diary-lib.el (diary-face-attrs)
(diary-mark-entries-1):
* lisp/cedet/cedet-files.el (cedet-files-list-recursively):
* lisp/cedet/ede.el (ede-constructing, ede-deep-rescan):
* lisp/cedet/ede/cpp-root.el (ede-cpp-root-header-file-p):
* lisp/cedet/ede/proj.el (ede-proj-target-makefile):
* lisp/cedet/inversion.el (inversion-check-version)
(inversion-test):
* lisp/cedet/mode-local.el (mode-local-map-file-buffers):
* lisp/cedet/semantic/complete.el (semantic-displayer-ghost):
* lisp/cedet/semantic/db-find.el (semanticdb-find-translate-path-default):
* lisp/cedet/semantic/db.el (semanticdb-table)
(semanticdb-search-system-databases):
* lisp/cedet/semantic/imenu.el (semantic-imenu-index-directory):
* lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map):
* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-use-headers-flag):
* lisp/cedet/semantic/lex.el (semantic-lex-make-keyword-table)
(semantic-lex-make-type-table, semantic-lex-debug-analyzers):
* lisp/cedet/semantic/tag-ls.el (semantic-tag-abstract-p)
(semantic-tag-leaf-p, semantic-tag-static-p)
(semantic-tag-prototype-p):
* lisp/dnd.el (dnd-open-remote-file-function, dnd-open-local-file):
* lisp/emacs-lisp/eieio-opt.el (eieio-build-class-alist)
(eieio-read-class, eieio-read-subclass):
* lisp/emacs-lisp/generator.el (cps--replace-variable-references)
(cps--handle-loop-for):
* lisp/erc/erc-dcc.el (erc-dcc-list, erc-dcc-member, erc-dcc-server)
(erc-dcc-auto-mask-p, erc-dcc-get-file, erc-dcc-chat-accept):
* lisp/eshell/em-pred.el (eshell-pred-file-type):
* lisp/faces.el (defined-colors-with-face-attributes):
* lisp/font-core.el (font-lock-mode):
* lisp/frame.el (frame-restack):
* lisp/net/shr.el (shr-image-animate):
* lisp/org/org-agenda.el (org-agenda-change-all-lines)
(org-agenda-today-p):
* lisp/org/org-id.el (org-id-get):
* lisp/org/org.el (org-highlight-latex-and-related)
(org--valid-property-p):
* lisp/org/ox-beamer.el (org-beamer--get-label):
* lisp/org/ox-latex.el (org-latex--caption-above-p):
* lisp/org/ox-odt.el (org-odt--copy-image-file)
(org-odt--copy-formula-file):
* lisp/org/ox.el (org-export-with-timestamps):
* lisp/progmodes/verilog-mode.el (verilog-indent-declaration-macros):
* lisp/ses.el (ses-file-format-extend-parameter-list):
* lisp/term.el (ansi-term):
* lisp/textmodes/bibtex.el (bibtex-no-opt-remove-re)
(bibtex-beginning-of-first-entry, bibtex-autokey-get-title)
(bibtex-read-key, bibtex-initialize):
* lisp/textmodes/flyspell.el (flyspell-word):
* lisp/view.el (view-mode-exit):
* src/composite.c:
* src/floatfns.c (Fisnan): Fix typos in docstrings.
2019-09-19 02:32:25 +00:00
|
|
|
|
If optional argument PREDICATE is non-nil, only select file buffers
|
2011-11-20 03:48:53 +00:00
|
|
|
|
for which the function PREDICATE returns non-nil.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
If optional argument BUFFERS is non-nil, it is a list of buffers to
|
|
|
|
|
walk through. It defaults to `buffer-list'."
|
|
|
|
|
(dolist (b (or buffers (buffer-list)))
|
|
|
|
|
(and (buffer-live-p b) (buffer-file-name b)
|
|
|
|
|
(with-current-buffer b
|
|
|
|
|
(when (or (not predicate) (funcall predicate))
|
|
|
|
|
(funcall function))))))
|
|
|
|
|
|
|
|
|
|
(defsubst get-mode-local-parent (mode)
|
|
|
|
|
"Return the mode parent of the major mode MODE.
|
|
|
|
|
Return nil if MODE has no parent."
|
|
|
|
|
(or (get mode 'mode-local-parent)
|
|
|
|
|
(get mode 'derived-mode-parent)))
|
|
|
|
|
|
2009-11-03 03:22:30 +00:00
|
|
|
|
;; FIXME doc (and function name) seems wrong.
|
|
|
|
|
;; Return a list of MODE and all its parent modes, if any.
|
|
|
|
|
;; Lists parent modes first.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(defun mode-local-equivalent-mode-p (mode)
|
|
|
|
|
"Is the major-mode in the current buffer equivalent to a mode in MODES."
|
|
|
|
|
(let ((modes nil))
|
|
|
|
|
(while mode
|
|
|
|
|
(setq modes (cons mode modes)
|
|
|
|
|
mode (get-mode-local-parent mode)))
|
|
|
|
|
modes))
|
|
|
|
|
|
|
|
|
|
(defun mode-local-map-mode-buffers (function modes)
|
|
|
|
|
"Run FUNCTION on every file buffer with major mode in MODES.
|
|
|
|
|
MODES can be a symbol or a list of symbols.
|
|
|
|
|
FUNCTION does not have arguments."
|
|
|
|
|
(or (listp modes) (setq modes (list modes)))
|
|
|
|
|
(mode-local-map-file-buffers
|
2021-03-30 21:44:48 +00:00
|
|
|
|
function (lambda ()
|
|
|
|
|
(let ((mm (mode-local-equivalent-mode-p major-mode))
|
|
|
|
|
(ans nil))
|
|
|
|
|
(while (and (not ans) mm)
|
|
|
|
|
(setq ans (memq (car mm) modes)
|
|
|
|
|
mm (cdr mm)) )
|
|
|
|
|
ans))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
;;; Hook machinery
|
|
|
|
|
;;
|
|
|
|
|
(defvar mode-local-init-hook nil
|
|
|
|
|
"Hook run after a new file buffer is created.
|
|
|
|
|
The current buffer is the newly created file buffer.")
|
|
|
|
|
|
|
|
|
|
(defvar mode-local-changed-mode-buffers nil
|
|
|
|
|
"List of buffers whose `major-mode' has changed recently.")
|
|
|
|
|
|
|
|
|
|
(defvar mode-local--init-mode nil)
|
|
|
|
|
|
|
|
|
|
(defsubst mode-local-initialized-p ()
|
|
|
|
|
"Return non-nil if mode local is initialized in current buffer.
|
|
|
|
|
That is, if the current `major-mode' is equal to the major mode for
|
|
|
|
|
which mode local bindings have been activated."
|
|
|
|
|
(eq mode-local--init-mode major-mode))
|
|
|
|
|
|
|
|
|
|
(defun mode-local-post-major-mode-change ()
|
|
|
|
|
"Initialize mode-local facilities.
|
|
|
|
|
This is run from `find-file-hook', and from `post-command-hook'
|
|
|
|
|
after changing the major mode."
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(remove-hook 'post-command-hook #'mode-local-post-major-mode-change nil)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(let ((buffers mode-local-changed-mode-buffers))
|
|
|
|
|
(setq mode-local-changed-mode-buffers nil)
|
|
|
|
|
(mode-local-map-file-buffers
|
|
|
|
|
(lambda ()
|
|
|
|
|
;; Make sure variables are set up for this mode.
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(mode-local--activate-bindings)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(run-hooks 'mode-local-init-hook))
|
|
|
|
|
(lambda ()
|
|
|
|
|
(not (mode-local-initialized-p)))
|
|
|
|
|
buffers)))
|
|
|
|
|
|
|
|
|
|
(defun mode-local-on-major-mode-change ()
|
|
|
|
|
"Function called in `change-major-mode-hook'."
|
|
|
|
|
(add-to-list 'mode-local-changed-mode-buffers (current-buffer))
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(add-hook 'post-command-hook #'mode-local-post-major-mode-change t nil))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
;;; Mode lineage
|
|
|
|
|
;;
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(define-obsolete-function-alias 'set-mode-local-parent
|
|
|
|
|
#'mode-local--set-parent "27.1")
|
|
|
|
|
(defsubst mode-local--set-parent (mode parent)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Set parent of major mode MODE to PARENT mode.
|
|
|
|
|
To work properly, this function should be called after PARENT mode
|
|
|
|
|
local variables have been defined."
|
|
|
|
|
(put mode 'mode-local-parent parent)
|
|
|
|
|
;; Refresh mode bindings to get mode local variables inherited from
|
|
|
|
|
;; PARENT. To work properly, the following should be called after
|
|
|
|
|
;; PARENT mode local variables have been defined.
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(mode-local-map-mode-buffers #'mode-local--activate-bindings mode))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(defmacro define-child-mode (mode parent &optional _docstring)
|
2011-11-20 03:48:53 +00:00
|
|
|
|
"Make major mode MODE inherit behavior from PARENT mode.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
DOCSTRING is optional and not used.
|
|
|
|
|
To work properly, this should be put after PARENT mode local variables
|
|
|
|
|
definition."
|
2021-10-13 19:52:50 +00:00
|
|
|
|
(declare (obsolete define-derived-mode "27.1") (indent 2))
|
2019-10-25 03:06:23 +00:00
|
|
|
|
`(mode-local--set-parent ',mode ',parent))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
(defun mode-local-use-bindings-p (this-mode desired-mode)
|
|
|
|
|
"Return non-nil if THIS-MODE can use bindings of DESIRED-MODE."
|
|
|
|
|
(let ((ans nil))
|
|
|
|
|
(while (and (not ans) this-mode)
|
|
|
|
|
(setq ans (eq this-mode desired-mode))
|
|
|
|
|
(setq this-mode (get-mode-local-parent this-mode)))
|
|
|
|
|
ans))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Core bindings API
|
|
|
|
|
;;
|
Prefer defvar-local in cedet
* lisp/cedet/ede.el (ede-object-root-project)
(ede-object-project, ede-object):
* lisp/cedet/mode-local.el (mode-local-symbol-table):
* lisp/cedet/semantic.el (semantic--parse-table)
(semantic-symbol->name-assoc-list)
(semantic-symbol->name-assoc-list-for-type-parts)
(semantic-case-fold, semantic--buffer-cache)
(semantic-unmatched-syntax-cache)
(semantic-unmatched-syntax-cache-check, semantic-parser-name)
(semantic--completion-cache, semantic-parse-tree-state)
(semantic-init-mode-hook, semantic-parser-warnings):
* lisp/cedet/semantic/bovine.el
(semantic-bovinate-nonterminal-check-obarray):
* lisp/cedet/semantic/complete.el (semantic-collector-per-buffer-list):
* lisp/cedet/semantic/ctxt.el (semantic-command-separation-character)
(semantic-function-argument-separation-character):
* lisp/cedet/semantic/db-find.el (semanticdb-find-lost-includes)
(semanticdb-find-scanned-include-tags):
* lisp/cedet/semantic/db.el (semanticdb-new-database-class)
(semanticdb-default-find-index-class)
(semanticdb-current-database, semanticdb-current-table)
(semanticdb-project-system-databases)
(semanticdb-out-of-buffer-create-table-fcn):
* lisp/cedet/semantic/debug.el (semantic-debug-parser-source)
(semantic-debug-parser-class)
(semantic-debug-parser-debugger-source):
* lisp/cedet/semantic/dep.el (semantic-dependency-include-path)
(semantic-dependency-system-include-path):
* lisp/cedet/semantic/format.el (semantic-function-argument-separator)
(semantic-format-parent-separator):
* lisp/cedet/semantic/fw.el (semantic-new-buffer-fcn-was-run):
* lisp/cedet/semantic/grammar.el (semantic-grammar-macros)
(semantic--grammar-macros-regexp-1)
(semantic--grammar-macros-regexp-2):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-mode):
* lisp/cedet/semantic/imenu.el (semantic-imenu-expandable-tag-classes):
* lisp/cedet/semantic/lex-spp.el
(semantic-lex-spp-macro-symbol-obarray)
(semantic-lex-spp-project-macro-symbol-obarray)
(semantic-lex-spp-dynamic-macro-symbol-obarray)
(semantic-lex-spp-dynamic-macro-symbol-obarray-stack):
* lisp/cedet/semantic/lex.el (semantic-flex-keywords-obarray)
(semantic-lex-types-obarray, semantic-lex-analyzer)
(semantic-lex-syntax-modifications, semantic-lex-syntax-table)
(semantic-lex-comment-regex, semantic-lex-number-expression)
(semantic-lex-depth, semantic-flex-extensions)
(semantic-flex-syntax-modifications, semantic-ignore-comments)
(semantic-flex-enable-newlines, semantic-flex-enable-whitespace)
(semantic-flex-enable-bol, semantic-number-expression)
(semantic-flex-depth):
* lisp/cedet/semantic/senator.el (senator-isearch-semantic-mode):
* lisp/cedet/semantic/sort.el
(semantic-orphaned-member-metaparent-type):
* lisp/cedet/semantic/tag.el (semantic-tag-expand-function):
* lisp/cedet/semantic/util-modes.el (semantic-show-parser-state-string)
(semantic-stickyfunc-sticky-classes)
(semantic-highlight-func-ct-overlay):
* lisp/cedet/semantic/util.el
(semantic-type-relation-separator-character)
(semantic-equivalent-major-modes):
* lisp/cedet/semantic/wisent.el (wisent-error-function)
(wisent-lexer-function): Prefer defvar-local.
2021-01-31 15:54:54 +00:00
|
|
|
|
(defvar-local mode-local-symbol-table nil
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Buffer local mode bindings.
|
|
|
|
|
These symbols provide a hook for a `major-mode' to specify specific
|
|
|
|
|
behaviors. Use the function `mode-local-bind' to define new bindings.")
|
|
|
|
|
|
|
|
|
|
(defvar mode-local-active-mode nil
|
|
|
|
|
"Major mode in which bindings are active.")
|
|
|
|
|
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(define-obsolete-function-alias 'new-mode-local-bindings
|
|
|
|
|
#'mode-local--new-bindings "27.1")
|
|
|
|
|
(defsubst mode-local--new-bindings ()
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Return a new empty mode bindings symbol table."
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(obarray-make 13))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
(defun mode-local-bind (bindings &optional plist mode)
|
|
|
|
|
"Define BINDINGS in the specified environment.
|
|
|
|
|
BINDINGS is a list of (VARIABLE . VALUE).
|
2022-05-22 20:10:58 +00:00
|
|
|
|
Optional argument PLIST is a property list each VARIABLE symbol will
|
2009-09-28 01:39:27 +00:00
|
|
|
|
be set to. The following properties have special meaning:
|
|
|
|
|
|
2016-01-24 20:30:39 +00:00
|
|
|
|
- `constant-flag' if non-nil, prevent rebinding variables.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
- `mode-variable-flag' if non-nil, define mode variables.
|
|
|
|
|
- `override-flag' if non-nil, define override functions.
|
|
|
|
|
|
|
|
|
|
The `override-flag' and `mode-variable-flag' properties are mutually
|
2022-05-22 20:10:58 +00:00
|
|
|
|
exclusive.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
2022-05-22 20:10:58 +00:00
|
|
|
|
If optional argument MODE is non-nil, it must be a major mode symbol.
|
|
|
|
|
BINDINGS will be defined globally for this major mode. If MODE is
|
|
|
|
|
nil, BINDINGS will be defined locally in the current buffer, in
|
|
|
|
|
variable `mode-local-symbol-table'. The later should be done in MODE
|
|
|
|
|
hook."
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;; Check plist consistency
|
|
|
|
|
(and (plist-get plist 'mode-variable-flag)
|
|
|
|
|
(plist-get plist 'override-flag)
|
|
|
|
|
(error "Bindings can't be both overrides and mode variables"))
|
|
|
|
|
(let (table variable varname value binding)
|
|
|
|
|
(if mode
|
|
|
|
|
(progn
|
|
|
|
|
;; Install in given MODE symbol table. Create a new one if
|
|
|
|
|
;; needed.
|
|
|
|
|
(setq table (or (get mode 'mode-local-symbol-table)
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(mode-local--new-bindings)))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(put mode 'mode-local-symbol-table table))
|
|
|
|
|
;; Fail if trying to bind mode variables in local context!
|
|
|
|
|
(if (plist-get plist 'mode-variable-flag)
|
|
|
|
|
(error "Mode required to bind mode variables"))
|
|
|
|
|
;; Install in buffer local symbol table. Create a new one if
|
|
|
|
|
;; needed.
|
|
|
|
|
(setq table (or mode-local-symbol-table
|
|
|
|
|
(setq mode-local-symbol-table
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(mode-local--new-bindings)))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(while bindings
|
|
|
|
|
(setq binding (car bindings)
|
|
|
|
|
bindings (cdr bindings)
|
|
|
|
|
varname (symbol-name (car binding))
|
|
|
|
|
value (cdr binding))
|
|
|
|
|
(if (setq variable (intern-soft varname table))
|
|
|
|
|
;; Binding already exists
|
|
|
|
|
;; Check rebind consistency
|
|
|
|
|
(cond
|
|
|
|
|
((equal (symbol-value variable) value)
|
|
|
|
|
;; Just ignore rebind with the same value.
|
|
|
|
|
)
|
|
|
|
|
((get variable 'constant-flag)
|
|
|
|
|
(error "Can't change the value of constant `%s'"
|
|
|
|
|
variable))
|
|
|
|
|
((and (get variable 'mode-variable-flag)
|
|
|
|
|
(plist-get plist 'override-flag))
|
|
|
|
|
(error "Can't rebind override `%s' as a mode variable"
|
|
|
|
|
variable))
|
|
|
|
|
((and (get variable 'override-flag)
|
|
|
|
|
(plist-get plist 'mode-variable-flag))
|
|
|
|
|
(error "Can't rebind mode variable `%s' as an override"
|
|
|
|
|
variable))
|
|
|
|
|
(t
|
|
|
|
|
;; Merge plist and assign new value
|
|
|
|
|
(setplist variable (append plist (symbol-plist variable)))
|
|
|
|
|
(set variable value)))
|
|
|
|
|
;; New binding
|
|
|
|
|
(setq variable (intern varname table))
|
|
|
|
|
;; Set new plist and assign initial value
|
|
|
|
|
(setplist variable plist)
|
|
|
|
|
(set variable value)))
|
|
|
|
|
;; Return the symbol table used
|
|
|
|
|
table))
|
|
|
|
|
|
|
|
|
|
(defsubst mode-local-symbol (symbol &optional mode)
|
|
|
|
|
"Return the mode local symbol bound with SYMBOL's name.
|
|
|
|
|
Return nil if the mode local symbol doesn't exist.
|
|
|
|
|
If optional argument MODE is nil, lookup first into locally bound
|
|
|
|
|
symbols, then in those bound in current `major-mode' and its parents.
|
|
|
|
|
If MODE is non-nil, lookup into symbols bound in that major mode and
|
|
|
|
|
its parents."
|
|
|
|
|
(let ((name (symbol-name symbol)) bind)
|
|
|
|
|
(or mode
|
|
|
|
|
(setq mode mode-local-active-mode)
|
|
|
|
|
(setq mode major-mode
|
|
|
|
|
bind (and mode-local-symbol-table
|
|
|
|
|
(intern-soft name mode-local-symbol-table))))
|
|
|
|
|
(while (and mode (not bind))
|
|
|
|
|
(or (and (get mode 'mode-local-symbol-table)
|
|
|
|
|
(setq bind (intern-soft
|
|
|
|
|
name (get mode 'mode-local-symbol-table))))
|
|
|
|
|
(setq mode (get-mode-local-parent mode))))
|
|
|
|
|
bind))
|
|
|
|
|
|
|
|
|
|
(defsubst mode-local-symbol-value (symbol &optional mode property)
|
|
|
|
|
"Return the value of the mode local symbol bound with SYMBOL's name.
|
|
|
|
|
If optional argument MODE is non-nil, restrict lookup to that mode and
|
|
|
|
|
its parents (see the function `mode-local-symbol' for more details).
|
|
|
|
|
If optional argument PROPERTY is non-nil the mode local symbol must
|
|
|
|
|
have that property set. Return nil if the symbol doesn't exist, or
|
|
|
|
|
doesn't have PROPERTY set."
|
|
|
|
|
(and (setq symbol (mode-local-symbol symbol mode))
|
|
|
|
|
(or (not property) (get symbol property))
|
|
|
|
|
(symbol-value symbol)))
|
|
|
|
|
|
|
|
|
|
;;; Mode local variables
|
|
|
|
|
;;
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(define-obsolete-function-alias 'activate-mode-local-bindings
|
|
|
|
|
#'mode-local--activate-bindings "27.1")
|
|
|
|
|
(defun mode-local--activate-bindings (&optional mode)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Activate variables defined locally in MODE and its parents.
|
|
|
|
|
That is, copy mode local bindings into corresponding buffer local
|
|
|
|
|
variables.
|
|
|
|
|
If MODE is not specified it defaults to current `major-mode'.
|
|
|
|
|
Return the alist of buffer-local variables that have been changed.
|
|
|
|
|
Elements are (SYMBOL . PREVIOUS-VALUE), describing one variable."
|
|
|
|
|
;; Hack -
|
|
|
|
|
;; do not do this if we are inside set-auto-mode as we may be in
|
|
|
|
|
;; an initialization race condition.
|
2019-06-20 00:29:20 +00:00
|
|
|
|
(if (boundp 'keep-mode-if-same)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;; We are inside set-auto-mode, as this is an argument that is
|
|
|
|
|
;; vaguely unique.
|
|
|
|
|
|
|
|
|
|
;; This will make sure that when everything is over, this will get
|
|
|
|
|
;; called and we won't be under set-auto-mode anymore.
|
|
|
|
|
(mode-local-on-major-mode-change)
|
|
|
|
|
|
|
|
|
|
;; Do the normal thing.
|
|
|
|
|
(let (modes table old-locals)
|
|
|
|
|
(unless mode
|
2020-12-04 16:55:46 +00:00
|
|
|
|
(setq-local mode-local--init-mode major-mode)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(setq mode major-mode))
|
|
|
|
|
;; Get MODE's parents & MODE in the right order.
|
|
|
|
|
(while mode
|
|
|
|
|
(setq modes (cons mode modes)
|
|
|
|
|
mode (get-mode-local-parent mode)))
|
|
|
|
|
;; Activate mode bindings following parent modes order.
|
|
|
|
|
(dolist (mode modes)
|
|
|
|
|
(when (setq table (get mode 'mode-local-symbol-table))
|
|
|
|
|
(mapatoms
|
2021-03-30 21:44:48 +00:00
|
|
|
|
(lambda (var)
|
|
|
|
|
(when (get var 'mode-variable-flag)
|
|
|
|
|
(let ((v (intern (symbol-name var))))
|
|
|
|
|
;; Save the current buffer-local value of the
|
|
|
|
|
;; mode-local variable.
|
|
|
|
|
(and (local-variable-p v (current-buffer))
|
|
|
|
|
(push (cons v (symbol-value v)) old-locals))
|
|
|
|
|
(set (make-local-variable v) (symbol-value var)))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
table)))
|
|
|
|
|
old-locals)))
|
|
|
|
|
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(define-obsolete-function-alias 'deactivate-mode-local-bindings
|
|
|
|
|
#'mode-local--deactivate-bindings "27.1")
|
|
|
|
|
(defun mode-local--deactivate-bindings (&optional mode)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Deactivate variables defined locally in MODE and its parents.
|
|
|
|
|
That is, kill buffer local variables set from the corresponding mode
|
|
|
|
|
local bindings.
|
|
|
|
|
If MODE is not specified it defaults to current `major-mode'."
|
|
|
|
|
(unless mode
|
|
|
|
|
(kill-local-variable 'mode-local--init-mode)
|
|
|
|
|
(setq mode major-mode))
|
|
|
|
|
(let (table)
|
|
|
|
|
(while mode
|
|
|
|
|
(when (setq table (get mode 'mode-local-symbol-table))
|
|
|
|
|
(mapatoms
|
2021-03-30 21:44:48 +00:00
|
|
|
|
(lambda (var)
|
|
|
|
|
(when (get var 'mode-variable-flag)
|
|
|
|
|
(kill-local-variable (intern (symbol-name var)))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
table))
|
|
|
|
|
(setq mode (get-mode-local-parent mode)))))
|
|
|
|
|
|
|
|
|
|
(defmacro with-mode-local-symbol (mode &rest body)
|
2019-10-23 21:48:41 +00:00
|
|
|
|
"With the local bindings of MODE symbol, evaluate BODY.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
The current mode bindings are saved, BODY is evaluated, and the saved
|
|
|
|
|
bindings are restored, even in case of an abnormal exit.
|
|
|
|
|
Value is what BODY returns.
|
|
|
|
|
This is like `with-mode-local', except that MODE's value is used.
|
|
|
|
|
To use the symbol MODE (quoted), use `with-mode-local'."
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(declare (indent 1))
|
|
|
|
|
(let ((old-mode (make-symbol "mode"))
|
|
|
|
|
(old-locals (make-symbol "old-locals"))
|
|
|
|
|
(new-mode (make-symbol "new-mode"))
|
|
|
|
|
(local (make-symbol "local")))
|
|
|
|
|
`(let ((,old-mode mode-local-active-mode)
|
|
|
|
|
(,old-locals nil)
|
|
|
|
|
(,new-mode ,mode)
|
|
|
|
|
)
|
|
|
|
|
(unwind-protect
|
|
|
|
|
(progn
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(mode-local--deactivate-bindings ,old-mode)
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(setq mode-local-active-mode ,new-mode)
|
|
|
|
|
;; Save the previous value of buffer-local variables
|
2019-10-25 03:06:23 +00:00
|
|
|
|
;; changed by `mode-local--activate-bindings'.
|
|
|
|
|
(setq ,old-locals (mode-local--activate-bindings ,new-mode))
|
2019-10-23 21:48:41 +00:00
|
|
|
|
,@body)
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(mode-local--deactivate-bindings ,new-mode)
|
2019-10-23 21:48:41 +00:00
|
|
|
|
;; Restore the previous value of buffer-local variables.
|
|
|
|
|
(dolist (,local ,old-locals)
|
|
|
|
|
(set (car ,local) (cdr ,local)))
|
|
|
|
|
;; Restore the mode local variables.
|
|
|
|
|
(setq mode-local-active-mode ,old-mode)
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(mode-local--activate-bindings ,old-mode)))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
(defmacro with-mode-local (mode &rest body)
|
2019-10-23 21:48:41 +00:00
|
|
|
|
"With the local bindings of MODE, evaluate BODY.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
The current mode bindings are saved, BODY is evaluated, and the saved
|
|
|
|
|
bindings are restored, even in case of an abnormal exit.
|
|
|
|
|
Value is what BODY returns.
|
2009-11-03 03:22:30 +00:00
|
|
|
|
This is like `with-mode-local-symbol', except that MODE is quoted
|
2009-11-03 03:29:19 +00:00
|
|
|
|
and is not evaluated."
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(declare (indent 1))
|
|
|
|
|
`(with-mode-local-symbol ',mode ,@body))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defsubst mode-local-value (mode sym)
|
|
|
|
|
"Return the value of the MODE local variable SYM."
|
|
|
|
|
(or mode (error "Missing major mode symbol"))
|
|
|
|
|
(mode-local-symbol-value sym mode 'mode-variable-flag))
|
|
|
|
|
|
|
|
|
|
(defmacro setq-mode-local (mode &rest args)
|
|
|
|
|
"Assign new values to variables local in MODE.
|
|
|
|
|
MODE must be a major mode symbol.
|
|
|
|
|
ARGS is a list (SYM VAL SYM VAL ...).
|
|
|
|
|
The symbols SYM are variables; they are literal (not evaluated).
|
|
|
|
|
The values VAL are expressions; they are evaluated.
|
|
|
|
|
Set each SYM to the value of its VAL, locally in buffers already in
|
|
|
|
|
MODE, or in buffers switched to that mode.
|
|
|
|
|
Return the value of the last VAL."
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(declare (debug (symbolp &rest symbolp form)))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(when args
|
|
|
|
|
(let (i ll bl sl tmp sym val)
|
|
|
|
|
(setq i 0)
|
|
|
|
|
(while args
|
|
|
|
|
(setq tmp (make-symbol (format "tmp%d" i))
|
|
|
|
|
i (1+ i)
|
|
|
|
|
sym (car args)
|
|
|
|
|
val (cadr args)
|
|
|
|
|
ll (cons (list tmp val) ll)
|
|
|
|
|
bl (cons `(cons ',sym ,tmp) bl)
|
|
|
|
|
sl (cons `(set (make-local-variable ',sym) ,tmp) sl)
|
|
|
|
|
args (cddr args)))
|
|
|
|
|
`(let* ,(nreverse ll)
|
|
|
|
|
;; Save mode bindings
|
|
|
|
|
(mode-local-bind (list ,@bl) '(mode-variable-flag t) ',mode)
|
|
|
|
|
;; Assign to local variables in all existing buffers in MODE
|
2021-03-30 21:44:48 +00:00
|
|
|
|
(mode-local-map-mode-buffers (lambda () ,@sl) ',mode)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;; Return the last value
|
|
|
|
|
,tmp)
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
(defmacro defvar-mode-local (mode sym val &optional docstring)
|
|
|
|
|
"Define MODE local variable SYM with value VAL.
|
|
|
|
|
DOCSTRING is optional."
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(declare (indent defun)
|
|
|
|
|
(debug (&define symbolp name def-form [ &optional stringp ] )))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
`(progn
|
|
|
|
|
(setq-mode-local ,mode ,sym ,val)
|
|
|
|
|
(put (mode-local-symbol ',sym ',mode)
|
|
|
|
|
'variable-documentation ,docstring)
|
|
|
|
|
',sym))
|
|
|
|
|
|
|
|
|
|
(defmacro defconst-mode-local (mode sym val &optional docstring)
|
|
|
|
|
"Define MODE local constant SYM with value VAL.
|
|
|
|
|
DOCSTRING is optional."
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(declare (indent defun) (debug defvar-mode-local))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(let ((tmp (make-symbol "tmp")))
|
|
|
|
|
`(let (,tmp)
|
|
|
|
|
(setq-mode-local ,mode ,sym ,val)
|
|
|
|
|
(setq ,tmp (mode-local-symbol ',sym ',mode))
|
|
|
|
|
(put ,tmp 'constant-flag t)
|
|
|
|
|
(put ,tmp 'variable-documentation ,docstring)
|
|
|
|
|
',sym)))
|
|
|
|
|
|
|
|
|
|
;;; Function overloading
|
|
|
|
|
;;
|
2009-10-28 14:01:49 +00:00
|
|
|
|
(defun make-obsolete-overload (old new when)
|
|
|
|
|
"Mark OLD overload as obsoleted by NEW overload.
|
|
|
|
|
WHEN is a string describing the first release where it was made obsolete."
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(put old 'mode-local--overload-obsoleted-by new)
|
|
|
|
|
(put old 'mode-local--overload-obsoleted-since when)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(put old 'mode-local-overload t)
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(put new 'mode-local--overload-obsolete old))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(define-obsolete-function-alias 'overload-obsoleted-by
|
|
|
|
|
#'mode-local--overload-obsoleted-by "27.1")
|
|
|
|
|
(defsubst mode-local--overload-obsoleted-by (overload)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Get the overload symbol obsoleted by OVERLOAD.
|
|
|
|
|
Return the obsolete symbol or nil if not found."
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(get overload 'mode-local--overload-obsolete))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(define-obsolete-function-alias 'overload-that-obsolete
|
|
|
|
|
#'mode-local--overload-that-obsolete "27.1")
|
|
|
|
|
(defsubst mode-local--overload-that-obsolete (overload)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Return the overload symbol that obsoletes OVERLOAD.
|
|
|
|
|
Return the symbol found or nil if OVERLOAD is not obsolete."
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(get overload 'mode-local--overload-obsoleted-by))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
(defsubst fetch-overload (overload)
|
|
|
|
|
"Return the current OVERLOAD function, or nil if not found.
|
|
|
|
|
First, lookup for OVERLOAD into locally bound mode local symbols, then
|
|
|
|
|
in those bound in current `major-mode' and its parents."
|
|
|
|
|
(or (mode-local-symbol-value overload nil 'override-flag)
|
|
|
|
|
;; If an obsolete overload symbol exists, try it.
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(and (mode-local--overload-obsoleted-by overload)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(mode-local-symbol-value
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(mode-local--overload-obsoleted-by overload) nil 'override-flag))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
(defun mode-local--override (name args body)
|
|
|
|
|
"Return the form that handles overloading of function NAME.
|
|
|
|
|
ARGS are the arguments to the function.
|
|
|
|
|
BODY is code that would be run when there is no override defined. The
|
|
|
|
|
default is to call the function `NAME-default' with the appropriate
|
|
|
|
|
arguments.
|
|
|
|
|
See also the function `define-overload'."
|
|
|
|
|
(let* ((default (intern (format "%s-default" name)))
|
|
|
|
|
(overargs (delq '&rest (delq '&optional (copy-sequence args))))
|
|
|
|
|
(override (make-symbol "override")))
|
|
|
|
|
`(let ((,override (fetch-overload ',name)))
|
|
|
|
|
(if ,override
|
|
|
|
|
(funcall ,override ,@overargs)
|
|
|
|
|
,@(or body `((,default ,@overargs)))))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defun mode-local--expand-overrides (name args body)
|
|
|
|
|
"Expand override forms that overload function NAME.
|
|
|
|
|
ARGS are the arguments to the function NAME.
|
|
|
|
|
BODY is code where override forms are searched for expansion.
|
|
|
|
|
Return result of expansion, or BODY if no expansion occurred.
|
|
|
|
|
See also the function `define-overload'."
|
|
|
|
|
(let ((forms body)
|
|
|
|
|
(ditto t)
|
|
|
|
|
form xbody)
|
|
|
|
|
(while forms
|
|
|
|
|
(setq form (car forms))
|
|
|
|
|
(cond
|
|
|
|
|
((atom form))
|
|
|
|
|
((eq (car form) :override)
|
|
|
|
|
(setq form (mode-local--override name args (cdr form))))
|
|
|
|
|
((eq (car form) :override-with-args)
|
|
|
|
|
(setq form (mode-local--override name (cadr form) (cddr form))))
|
|
|
|
|
((setq form (mode-local--expand-overrides name args form))))
|
|
|
|
|
(setq ditto (and ditto (eq (car forms) form))
|
|
|
|
|
xbody (cons form xbody)
|
|
|
|
|
forms (cdr forms)))
|
|
|
|
|
(if ditto body (nreverse xbody))))
|
|
|
|
|
|
|
|
|
|
(defun mode-local--overload-body (name args body)
|
|
|
|
|
"Return the code that implements overloading of function NAME.
|
|
|
|
|
ARGS are the arguments to the function NAME.
|
|
|
|
|
BODY specifies the overload code.
|
|
|
|
|
See also the function `define-overload'."
|
|
|
|
|
(let ((result (mode-local--expand-overrides name args body)))
|
|
|
|
|
(if (eq body result)
|
|
|
|
|
(list (mode-local--override name args body))
|
|
|
|
|
result)))
|
|
|
|
|
|
2012-05-18 01:46:20 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(put 'define-overloadable-function 'doc-string-elt 3)
|
|
|
|
|
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(defmacro define-overloadable-function (name args docstring &rest body)
|
2011-11-20 03:48:53 +00:00
|
|
|
|
"Define a new function, as with `defun', which can be overloaded.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
NAME is the name of the function to create.
|
|
|
|
|
ARGS are the arguments to the function.
|
|
|
|
|
DOCSTRING is a documentation string to describe the function. The
|
2011-11-20 03:48:53 +00:00
|
|
|
|
docstring will automatically have details about its overload symbol
|
2009-09-28 01:39:27 +00:00
|
|
|
|
appended to the end.
|
|
|
|
|
BODY is code that would be run when there is no override defined. The
|
|
|
|
|
default is to call the function `NAME-default' with the appropriate
|
|
|
|
|
arguments.
|
|
|
|
|
|
|
|
|
|
BODY can also include an override form that specifies which part of
|
2016-01-24 20:30:39 +00:00
|
|
|
|
BODY is specifically overridden. This permits specifying common code
|
2009-09-28 01:39:27 +00:00
|
|
|
|
run for both default and overridden implementations.
|
|
|
|
|
An override form is one of:
|
|
|
|
|
|
|
|
|
|
1. (:override [OVERBODY])
|
|
|
|
|
2. (:override-with-args OVERARGS [OVERBODY])
|
|
|
|
|
|
|
|
|
|
OVERBODY is the code that would be run when there is no override
|
|
|
|
|
defined. The default is to call the function `NAME-default' with the
|
|
|
|
|
appropriate arguments deduced from ARGS.
|
|
|
|
|
OVERARGS is a list of arguments passed to the override and
|
|
|
|
|
`NAME-default' function, in place of those deduced from ARGS."
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(declare (doc-string 3)
|
2021-10-13 19:52:50 +00:00
|
|
|
|
(indent defun)
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(debug (&define name lambda-list stringp def-body)))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
`(eval-and-compile
|
|
|
|
|
(defun ,name ,args
|
|
|
|
|
,docstring
|
|
|
|
|
,@(mode-local--overload-body name args body))
|
|
|
|
|
(put ',name 'mode-local-overload t)))
|
|
|
|
|
(put :override-with-args 'lisp-indent-function 1)
|
|
|
|
|
|
2019-10-11 17:54:30 +00:00
|
|
|
|
(define-obsolete-function-alias 'define-overload
|
2021-03-12 16:32:42 +00:00
|
|
|
|
#'define-overloadable-function "27.1")
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(define-obsolete-function-alias 'function-overload-p
|
|
|
|
|
#'mode-local--function-overload-p "27.1")
|
|
|
|
|
(defsubst mode-local--function-overload-p (symbol)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Return non-nil if SYMBOL is a function which can be overloaded."
|
|
|
|
|
(and symbol (symbolp symbol) (get symbol 'mode-local-overload)))
|
|
|
|
|
|
|
|
|
|
(defmacro define-mode-local-override
|
|
|
|
|
(name mode args docstring &rest body)
|
|
|
|
|
"Define a mode specific override of the function overload NAME.
|
2020-01-24 17:24:19 +00:00
|
|
|
|
Has meaning only if NAME has been created with `define-overloadable-function'.
|
2009-09-28 01:39:27 +00:00
|
|
|
|
MODE is the major mode this override is being defined for.
|
|
|
|
|
ARGS are the function arguments, which should match those of the same
|
|
|
|
|
named function created with `define-overload'.
|
|
|
|
|
DOCSTRING is the documentation string.
|
|
|
|
|
BODY is the implementation of this function."
|
2017-02-28 14:41:04 +00:00
|
|
|
|
;; FIXME: Make this obsolete and use cl-defmethod with &context instead.
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(declare (doc-string 4)
|
2021-10-13 19:52:50 +00:00
|
|
|
|
(indent defun)
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(debug (&define name symbolp lambda-list stringp def-body)))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(let ((newname (intern (format "%s-%s" name mode))))
|
|
|
|
|
`(progn
|
|
|
|
|
(eval-and-compile
|
|
|
|
|
(defun ,newname ,args
|
2021-09-24 15:47:35 +00:00
|
|
|
|
,(concat docstring "\n"
|
|
|
|
|
(internal--format-docstring-line
|
|
|
|
|
"Override `%s' in `%s' buffers."
|
|
|
|
|
name mode))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;; The body for this implementation
|
|
|
|
|
,@body)
|
|
|
|
|
;; For find-func to locate the definition of NEWNAME.
|
|
|
|
|
(put ',newname 'definition-name ',name))
|
|
|
|
|
(mode-local-bind '((,name . ,newname))
|
|
|
|
|
'(override-flag t)
|
2021-09-24 15:47:35 +00:00
|
|
|
|
',mode))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
;;; Read/Query Support
|
|
|
|
|
(defun mode-local-read-function (prompt &optional initial hist default)
|
|
|
|
|
"Interactively read in the name of a mode-local function.
|
|
|
|
|
PROMPT, INITIAL, HIST, and DEFAULT are the same as for `completing-read'."
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(declare (obsolete nil "27.1"))
|
|
|
|
|
(completing-read prompt obarray #'mode-local--function-overload-p t initial hist default))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
;;; Help support
|
|
|
|
|
;;
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(define-obsolete-function-alias 'overload-docstring-extension
|
|
|
|
|
#'mode-local--overload-docstring-extension "27.1")
|
|
|
|
|
(defun mode-local--overload-docstring-extension (overload)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
"Return the doc string that augments the description of OVERLOAD."
|
2015-09-17 23:08:20 +00:00
|
|
|
|
(let ((doc "\nThis function can be overloaded\
|
Improve the optional translation of quotes
Fix several problems with the recently-added custom variable
help-quote-translation where the code would quote inconsistently
in help buffers. Add support for quoting 'like this', which
is common in other GNU programs in ASCII environments. Change
help-quote-translation to use more mnemonic values: values are now the
initial quoting char, e.g., (setq help-quote-translation ?`) gets the
traditional Emacs help-buffer quoting style `like this'. Change the
default behavior of substitute-command-keys to match what's done in
set-locale-environment, i.e., quote ‘like this’ if displayable,
'like this' otherwise.
* doc/lispref/help.texi (Keys in Documentation): Document
new behavior of substitute-command-keys, and document
help-quote-translation.
* doc/lispref/tips.texi (Documentation Tips):
Mention the effect of help-quote-translation.
* etc/NEWS: Mention new behavior of substitute-command-keys,
and merge help-quote-translation news into it.
When talking about doc strings, mention new ways to type quotes.
* lisp/cedet/mode-local.el (overload-docstring-extension):
Revert my recent change to this function, which shouldn't be
needed as the result is a doc string.
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-theme.el (describe-theme-1):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-class)
(eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/faces.el (describe-face):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode):
Use substitute-command-keys to ensure a more-consistent quoting
style in help buffers.
* lisp/cus-start.el (standard):
Document new help-quote-translation behavior.
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs):
* lisp/help-mode.el (help-xref-symbol-regexp, help-xref-info-regexp)
(help-xref-url-regexp):
* lisp/international/mule-cmds.el (help-xref-mule-regexp-template):
* lisp/wid-edit.el (widget-documentation-link-regexp):
Also match 'foo', in case we're in a help buffer generated when
help-quote-translation is ?'.
* src/doc.c: Include disptab.h, for DISP_CHAR_VECTOR.
(LEFT_SINGLE_QUOTATION_MARK, uLSQM0, uLSQM1, uLSQM2, uRSQM0)
(uRSQM1, uRSQM2, LSQM, RSQM): New constants.
(Fsubstitute_command_keys): Document and implement new behavior.
(Vhelp_quote_translation): Document new behavior.
2015-06-19 07:35:43 +00:00
|
|
|
|
with `define-mode-local-override'.")
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(sym (mode-local--overload-obsoleted-by overload)))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(when sym
|
Improve the optional translation of quotes
Fix several problems with the recently-added custom variable
help-quote-translation where the code would quote inconsistently
in help buffers. Add support for quoting 'like this', which
is common in other GNU programs in ASCII environments. Change
help-quote-translation to use more mnemonic values: values are now the
initial quoting char, e.g., (setq help-quote-translation ?`) gets the
traditional Emacs help-buffer quoting style `like this'. Change the
default behavior of substitute-command-keys to match what's done in
set-locale-environment, i.e., quote ‘like this’ if displayable,
'like this' otherwise.
* doc/lispref/help.texi (Keys in Documentation): Document
new behavior of substitute-command-keys, and document
help-quote-translation.
* doc/lispref/tips.texi (Documentation Tips):
Mention the effect of help-quote-translation.
* etc/NEWS: Mention new behavior of substitute-command-keys,
and merge help-quote-translation news into it.
When talking about doc strings, mention new ways to type quotes.
* lisp/cedet/mode-local.el (overload-docstring-extension):
Revert my recent change to this function, which shouldn't be
needed as the result is a doc string.
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-theme.el (describe-theme-1):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-class)
(eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/faces.el (describe-face):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode):
Use substitute-command-keys to ensure a more-consistent quoting
style in help buffers.
* lisp/cus-start.el (standard):
Document new help-quote-translation behavior.
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs):
* lisp/help-mode.el (help-xref-symbol-regexp, help-xref-info-regexp)
(help-xref-url-regexp):
* lisp/international/mule-cmds.el (help-xref-mule-regexp-template):
* lisp/wid-edit.el (widget-documentation-link-regexp):
Also match 'foo', in case we're in a help buffer generated when
help-quote-translation is ?'.
* src/doc.c: Include disptab.h, for DISP_CHAR_VECTOR.
(LEFT_SINGLE_QUOTATION_MARK, uLSQM0, uLSQM1, uLSQM2, uRSQM0)
(uRSQM1, uRSQM2, LSQM, RSQM): New constants.
(Fsubstitute_command_keys): Document and implement new behavior.
(Vhelp_quote_translation): Document new behavior.
2015-06-19 07:35:43 +00:00
|
|
|
|
(setq doc (format "%s\nIt has made the overload `%s' obsolete since %s."
|
2019-10-25 03:06:23 +00:00
|
|
|
|
doc sym
|
|
|
|
|
(get sym 'mode-local--overload-obsoleted-since))))
|
|
|
|
|
(setq sym (mode-local--overload-that-obsolete overload))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(when sym
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(setq doc (format
|
|
|
|
|
"%s\nThis overload is obsolete since %s;\nUse `%s' instead."
|
|
|
|
|
doc (get overload 'mode-local--overload-obsoleted-since) sym)))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
doc))
|
|
|
|
|
|
|
|
|
|
(defun mode-local-augment-function-help (symbol)
|
|
|
|
|
"Augment the *Help* buffer for SYMBOL.
|
|
|
|
|
SYMBOL is a function that can be overridden."
|
|
|
|
|
(with-current-buffer "*Help*"
|
|
|
|
|
(pop-to-buffer (current-buffer))
|
2010-10-29 07:48:10 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(unless (re-search-forward "^$" nil t)
|
|
|
|
|
(goto-char (point-max))
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(forward-line -1))
|
|
|
|
|
(let ((inhibit-read-only t))
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(insert (substitute-command-keys (mode-local--overload-docstring-extension symbol))
|
2015-11-17 23:28:50 +00:00
|
|
|
|
"\n")
|
2010-10-29 07:48:10 +00:00
|
|
|
|
;; NOTE TO SELF:
|
|
|
|
|
;; LIST ALL LOADED OVERRIDES FOR SYMBOL HERE
|
|
|
|
|
)))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
2016-01-08 21:31:56 +00:00
|
|
|
|
;; We are called from describe-function in help-fns.el, where this is defined.
|
|
|
|
|
(defvar describe-function-orig-buffer)
|
|
|
|
|
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(defun mode-local--describe-overload (symbol)
|
2015-08-26 20:33:41 +00:00
|
|
|
|
"For `help-fns-describe-function-functions'; add overloads for SYMBOL."
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(when (mode-local--function-overload-p symbol)
|
2015-08-26 20:33:41 +00:00
|
|
|
|
(let ((default (or (intern-soft (format "%s-default" (symbol-name symbol)))
|
|
|
|
|
symbol))
|
2015-09-01 09:36:05 +00:00
|
|
|
|
(override (with-current-buffer describe-function-orig-buffer
|
|
|
|
|
(fetch-overload symbol)))
|
|
|
|
|
modes)
|
|
|
|
|
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(insert (substitute-command-keys (mode-local--overload-docstring-extension symbol))
|
2015-11-17 23:28:50 +00:00
|
|
|
|
"\n\n")
|
2015-08-30 04:40:21 +00:00
|
|
|
|
(insert (format-message "default function: `%s'\n" default))
|
2015-09-01 10:10:52 +00:00
|
|
|
|
(if override
|
2015-10-02 04:42:53 +00:00
|
|
|
|
(insert (format-message "\noverride in buffer `%s': `%s'\n"
|
2015-09-01 10:10:52 +00:00
|
|
|
|
describe-function-orig-buffer override))
|
2015-10-02 04:42:53 +00:00
|
|
|
|
(insert (format-message "\nno override in buffer `%s'\n"
|
2015-09-01 10:10:52 +00:00
|
|
|
|
describe-function-orig-buffer)))
|
2015-09-01 09:36:05 +00:00
|
|
|
|
|
|
|
|
|
(mapatoms
|
|
|
|
|
(lambda (sym) (when (get sym 'mode-local-symbol-table) (push sym modes)))
|
|
|
|
|
obarray)
|
|
|
|
|
|
|
|
|
|
(dolist (mode modes)
|
|
|
|
|
(let* ((major-mode mode)
|
|
|
|
|
(override (fetch-overload symbol)))
|
|
|
|
|
|
|
|
|
|
(when override
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
(insert (format-message "\noverride in mode `%s': `%s'\n"
|
2015-09-01 09:36:05 +00:00
|
|
|
|
major-mode override))
|
|
|
|
|
)))
|
2015-08-26 20:33:41 +00:00
|
|
|
|
)))
|
|
|
|
|
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(add-hook 'help-fns-describe-function-functions #'mode-local--describe-overload)
|
2015-08-26 20:33:41 +00:00
|
|
|
|
|
2016-01-13 01:49:34 +00:00
|
|
|
|
(declare-function xref-item-location "xref" (xref) t)
|
2015-08-26 21:43:29 +00:00
|
|
|
|
|
|
|
|
|
(defun xref-mode-local--override-present (sym xrefs)
|
|
|
|
|
"Return non-nil if SYM is in XREFS."
|
|
|
|
|
(let (result)
|
|
|
|
|
(while (and (null result)
|
|
|
|
|
xrefs)
|
|
|
|
|
(when (equal sym (car (xref-elisp-location-symbol (xref-item-location (pop xrefs)))))
|
|
|
|
|
(setq result t)))
|
|
|
|
|
result))
|
|
|
|
|
|
|
|
|
|
(defun xref-mode-local-overload (symbol)
|
2015-09-10 17:10:54 +00:00
|
|
|
|
"For `elisp-xref-find-def-functions'; add overloads for SYMBOL."
|
2015-08-26 21:43:29 +00:00
|
|
|
|
;; Current buffer is the buffer where xref-find-definitions was invoked.
|
2019-10-25 03:06:23 +00:00
|
|
|
|
(when (mode-local--function-overload-p symbol)
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(let* ((symbol-file (find-lisp-object-file-name
|
|
|
|
|
symbol (symbol-function symbol)))
|
2015-08-26 21:43:29 +00:00
|
|
|
|
(default (intern-soft (format "%s-default" (symbol-name symbol))))
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(default-file (when default (find-lisp-object-file-name
|
|
|
|
|
default (symbol-function default))))
|
2015-08-26 21:43:29 +00:00
|
|
|
|
modes
|
|
|
|
|
xrefs)
|
|
|
|
|
|
|
|
|
|
(mapatoms
|
|
|
|
|
(lambda (sym) (when (get sym 'mode-local-symbol-table) (push sym modes)))
|
|
|
|
|
obarray)
|
|
|
|
|
|
|
|
|
|
;; mode-local-overrides are inherited from parent modes; we
|
|
|
|
|
;; don't want to list the same function twice. So order ‘modes’
|
|
|
|
|
;; with parents first, and check for duplicates.
|
|
|
|
|
|
|
|
|
|
(setq modes
|
|
|
|
|
(sort modes
|
|
|
|
|
(lambda (a b)
|
2019-10-23 21:48:41 +00:00
|
|
|
|
;; a is not a child, or not a child of b
|
|
|
|
|
(not (equal b (get a 'mode-local-parent))))))
|
2015-08-26 21:43:29 +00:00
|
|
|
|
|
|
|
|
|
(dolist (mode modes)
|
|
|
|
|
(let* ((major-mode mode)
|
|
|
|
|
(override (fetch-overload symbol))
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(override-file (when override
|
|
|
|
|
(find-lisp-object-file-name
|
|
|
|
|
override (symbol-function override)))))
|
2015-08-26 21:43:29 +00:00
|
|
|
|
|
|
|
|
|
(when (and override override-file)
|
|
|
|
|
(let ((meta-name (cons override major-mode))
|
|
|
|
|
;; For the declaration:
|
|
|
|
|
;;
|
|
|
|
|
;;(define-mode-local-override xref-elisp-foo c-mode
|
|
|
|
|
;;
|
|
|
|
|
;; The override symbol name is
|
|
|
|
|
;; "xref-elisp-foo-c-mode". The summary should match
|
|
|
|
|
;; the declaration, so strip the mode from the
|
|
|
|
|
;; symbol name.
|
|
|
|
|
(summary (format elisp--xref-format-extra
|
|
|
|
|
'define-mode-local-override
|
|
|
|
|
(substring (symbol-name override) 0 (- (1+ (length (symbol-name major-mode)))))
|
|
|
|
|
major-mode)))
|
|
|
|
|
|
|
|
|
|
(unless (xref-mode-local--override-present override xrefs)
|
|
|
|
|
(push (elisp--xref-make-xref
|
|
|
|
|
'define-mode-local-override meta-name override-file summary)
|
|
|
|
|
xrefs))))))
|
|
|
|
|
|
|
|
|
|
;; %s-default is interned whether it is a separate function or
|
|
|
|
|
;; not, so we have to check that here.
|
|
|
|
|
(when (and (functionp default) default-file)
|
|
|
|
|
(push (elisp--xref-make-xref nil default default-file) xrefs))
|
|
|
|
|
|
|
|
|
|
(when symbol-file
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(push (elisp--xref-make-xref 'define-overloadable-function
|
|
|
|
|
symbol symbol-file)
|
|
|
|
|
xrefs))
|
2015-08-26 21:43:29 +00:00
|
|
|
|
|
|
|
|
|
xrefs)))
|
|
|
|
|
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(add-hook 'elisp-xref-find-def-functions #'xref-mode-local-overload)
|
2015-08-26 21:43:29 +00:00
|
|
|
|
|
|
|
|
|
(defconst xref-mode-local-find-overloadable-regexp
|
2019-10-23 21:48:41 +00:00
|
|
|
|
"(define-overload\\(able-function\\)? +%s"
|
2015-09-10 17:10:54 +00:00
|
|
|
|
"Regexp used by `xref-find-definitions' when searching for a
|
2021-09-14 06:43:18 +00:00
|
|
|
|
mode-local overloadable function definition.")
|
2015-08-26 21:43:29 +00:00
|
|
|
|
|
|
|
|
|
(defun xref-mode-local-find-override (meta-name)
|
2015-09-10 17:10:54 +00:00
|
|
|
|
"Function used by `xref-find-definitions' when searching for an
|
2021-09-14 06:43:18 +00:00
|
|
|
|
override of a mode-local overloadable function.
|
2015-08-26 21:43:29 +00:00
|
|
|
|
META-NAME is a cons (OVERLOADABLE-SYMBOL . MAJOR-MODE)."
|
|
|
|
|
(let* ((override (car meta-name))
|
|
|
|
|
(mode (cdr meta-name))
|
|
|
|
|
(regexp (format "(define-mode-local-override +%s +%s"
|
|
|
|
|
(substring (symbol-name override) 0 (- (1+ (length (symbol-name mode)))))
|
|
|
|
|
mode)))
|
|
|
|
|
(re-search-forward regexp nil t)
|
|
|
|
|
))
|
|
|
|
|
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(add-to-list 'find-function-regexp-alist
|
|
|
|
|
'(define-overloadable-function
|
|
|
|
|
. xref-mode-local-find-overloadable-regexp))
|
|
|
|
|
(add-to-list 'find-function-regexp-alist
|
|
|
|
|
(cons 'define-mode-local-override
|
|
|
|
|
#'xref-mode-local-find-override))
|
2015-08-26 21:43:29 +00:00
|
|
|
|
|
2009-09-28 01:39:27 +00:00
|
|
|
|
;; Help for mode-local bindings.
|
|
|
|
|
(defun mode-local-print-binding (symbol)
|
|
|
|
|
"Print the SYMBOL binding."
|
|
|
|
|
(let ((value (symbol-value symbol)))
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
(princ (format-message "\n `%s' value is\n " symbol))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(if (and value (symbolp value))
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
(princ (format-message "`%s'" value))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(let ((pt (point)))
|
|
|
|
|
(pp value)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char pt)
|
|
|
|
|
(indent-sexp))))
|
|
|
|
|
(or (bolp) (princ "\n"))))
|
|
|
|
|
|
|
|
|
|
(defun mode-local-print-bindings (table)
|
|
|
|
|
"Print bindings in TABLE."
|
2011-11-15 00:54:19 +00:00
|
|
|
|
(let (us ;; List of unspecified symbols
|
2009-09-28 01:39:27 +00:00
|
|
|
|
mc ;; List of mode local constants
|
|
|
|
|
mv ;; List of mode local variables
|
|
|
|
|
ov ;; List of overloaded functions
|
|
|
|
|
fo ;; List of final overloaded functions
|
|
|
|
|
)
|
|
|
|
|
;; Order symbols by type
|
|
|
|
|
(mapatoms
|
2020-02-01 17:07:32 +00:00
|
|
|
|
(lambda (s) (push s (cond
|
|
|
|
|
((get s 'mode-variable-flag)
|
|
|
|
|
(if (get s 'constant-flag) mc mv))
|
|
|
|
|
((get s 'override-flag)
|
|
|
|
|
(if (get s 'constant-flag) fo ov))
|
|
|
|
|
(t us))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
table)
|
|
|
|
|
;; Print symbols by type
|
|
|
|
|
(when us
|
2011-11-14 20:23:26 +00:00
|
|
|
|
(princ "\n !! Unspecified symbols\n")
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(mapc #'mode-local-print-binding us))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(when mc
|
|
|
|
|
(princ "\n ** Mode local constants\n")
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(mapc #'mode-local-print-binding mc))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(when mv
|
|
|
|
|
(princ "\n ** Mode local variables\n")
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(mapc #'mode-local-print-binding mv))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(when fo
|
|
|
|
|
(princ "\n ** Final overloaded functions\n")
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(mapc #'mode-local-print-binding fo))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(when ov
|
|
|
|
|
(princ "\n ** Overloaded functions\n")
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(mapc #'mode-local-print-binding ov))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defun mode-local-describe-bindings-2 (buffer-or-mode)
|
|
|
|
|
"Display mode local bindings active in BUFFER-OR-MODE."
|
|
|
|
|
(let (table mode)
|
|
|
|
|
(princ "Mode local bindings active in ")
|
|
|
|
|
(cond
|
|
|
|
|
((bufferp buffer-or-mode)
|
|
|
|
|
(with-current-buffer buffer-or-mode
|
|
|
|
|
(setq table mode-local-symbol-table
|
|
|
|
|
mode major-mode))
|
|
|
|
|
(princ (format "%S\n" buffer-or-mode))
|
|
|
|
|
)
|
|
|
|
|
((symbolp buffer-or-mode)
|
|
|
|
|
(setq mode buffer-or-mode)
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
(princ (format-message "`%s'\n" buffer-or-mode))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
)
|
|
|
|
|
((signal 'wrong-type-argument
|
|
|
|
|
(list 'buffer-or-mode buffer-or-mode))))
|
|
|
|
|
(when table
|
|
|
|
|
(princ "\n- Buffer local\n")
|
|
|
|
|
(mode-local-print-bindings table))
|
|
|
|
|
(while mode
|
|
|
|
|
(setq table (get mode 'mode-local-symbol-table))
|
|
|
|
|
(when table
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
(princ (format-message "\n- From `%s'\n" mode))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
(mode-local-print-bindings table))
|
|
|
|
|
(setq mode (get-mode-local-parent mode)))))
|
|
|
|
|
|
|
|
|
|
(defun mode-local-describe-bindings-1 (buffer-or-mode &optional interactive-p)
|
|
|
|
|
"Display mode local bindings active in BUFFER-OR-MODE.
|
|
|
|
|
Optional argument INTERACTIVE-P is non-nil if the calling command was
|
|
|
|
|
invoked interactively."
|
2022-05-17 22:27:52 +00:00
|
|
|
|
(help-setup-xref
|
|
|
|
|
(list 'mode-local-describe-bindings-1 buffer-or-mode)
|
|
|
|
|
interactive-p)
|
2019-10-28 15:05:39 +00:00
|
|
|
|
(with-output-to-temp-buffer (help-buffer) ; "*Help*"
|
|
|
|
|
(with-current-buffer standard-output
|
|
|
|
|
(mode-local-describe-bindings-2 buffer-or-mode))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
(defun describe-mode-local-bindings (buffer)
|
|
|
|
|
"Display mode local bindings active in BUFFER."
|
|
|
|
|
(interactive "b")
|
|
|
|
|
(when (setq buffer (get-buffer buffer))
|
2009-11-22 23:49:13 +00:00
|
|
|
|
(mode-local-describe-bindings-1 buffer (called-interactively-p 'any))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
(defun describe-mode-local-bindings-in-mode (mode)
|
|
|
|
|
"Display mode local bindings active in MODE hierarchy."
|
|
|
|
|
(interactive
|
|
|
|
|
(list (completing-read
|
|
|
|
|
"Mode: " obarray
|
2021-03-30 21:44:48 +00:00
|
|
|
|
(lambda (s) (get s 'mode-local-symbol-table))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
t (symbol-name major-mode))))
|
|
|
|
|
(when (setq mode (intern-soft mode))
|
2009-11-22 23:49:13 +00:00
|
|
|
|
(mode-local-describe-bindings-1 mode (called-interactively-p 'any))))
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
2019-10-23 21:48:41 +00:00
|
|
|
|
(add-hook 'find-file-hook #'mode-local-post-major-mode-change)
|
|
|
|
|
(add-hook 'change-major-mode-hook #'mode-local-on-major-mode-change)
|
2009-09-28 01:39:27 +00:00
|
|
|
|
|
|
|
|
|
(provide 'mode-local)
|
|
|
|
|
|
|
|
|
|
;;; mode-local.el ends here
|