Variable: diff-mode-abbrev-table
diff-mode-abbrev-table is a variable defined in diff-mode.el.gz.
Value
#<obarray n=1>
Documentation
Abbrev table for diff-mode.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/diff-mode.el.gz
;;;###autoload
(define-derived-mode diff-mode fundamental-mode "Diff"
"Major mode for viewing/editing context diffs.
Supports unified and context diffs as well as, to a lesser extent, diffs
in the old \"normal\" format. (Unified diffs have become the standard,
most commonly encountered format.) If you edit the buffer manually,
`diff-mode' will try to update the hunk headers for you on-the-fly.
You can also switch between context diff and unified diff with \\[diff-context->unified],
or vice versa with \\[diff-unified->context] and you can also reverse the direction of
a diff with \\[diff-reverse-direction].
\\{diff-mode-map}
In read-only buffers the following bindings are also available:
\\{diff-read-only-map}"
(setq-local font-lock-defaults diff-font-lock-defaults)
(add-hook 'font-lock-mode-hook #'diff--font-lock-cleanup nil 'local)
(setq-local imenu-generic-expression
diff-imenu-generic-expression)
(setq-local project-find-matching-buffer-function
#'project-change-to-matching-directory)
;; These are not perfect. They would be better done separately for
;; context diffs and unidiffs.
;; (setq-local paragraph-start
;; (concat "@@ " ; unidiff hunk
;; "\\|\\*\\*\\* " ; context diff hunk or file start
;; "\\|--- [^\t]+\t")) ; context or unidiff file
;; ; start (first or second line)
;; (setq-local paragraph-separate paragraph-start)
;; (setq-local page-delimiter "--- [^\t]+\t")
;; compile support
(setq-local next-error-function #'diff-next-error)
(setq-local beginning-of-defun-function #'diff-beginning-of-file-and-junk)
(setq-local end-of-defun-function #'diff-end-of-file)
(diff-setup-whitespace)
;; read-only setup
(when diff-default-read-only
(setq buffer-read-only t))
(when buffer-read-only
(setq diff-mode-read-only t))
(add-hook 'read-only-mode-hook
(lambda ()
(setq diff-mode-read-only buffer-read-only))
nil t)
;; setup change hooks
(if (not diff-update-on-the-fly)
(add-hook 'write-contents-functions #'diff-write-contents-hooks nil t)
(setq diff--track-changes
(track-changes-register #'diff--track-changes-signal :nobefore t)))
;; add-log support
(setq-local add-log-current-defun-function #'diff-current-defun)
(setq-local add-log-buffer-file-name-function
(lambda () (diff-find-file-name nil 'noprompt)))
(add-function :filter-return (local 'filter-buffer-substring-function)
#'diff--filter-substring)
(unless buffer-file-name
(hack-dir-local-variables-non-file-buffer))
(diff-setup-buffer-type))