• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +refs:diff +refs:mode +refs:hook

30 ;; ITS-id version control, load- and write-hook handling, and the like.
98 ;; are not overridden by the major mode.
293 from `mode-require-final-newline'."
301 (defcustom mode-require-final-newline t
382 :type '(hook :options (cvs-dired-noselect dired-noselect))
397 (defcustom find-file-hook nil
402 :type 'hook
405 (define-obsolete-variable-alias 'find-file-hooks 'find-file-hook "22.1")
414 change the major mode.
416 This hook is not run if any of the functions in
419 coding system and setting mode bits. (See Info
421 updates before the buffer is saved, use `before-save-hook'.")
439 major mode does clear it.
445 use `before-save-hook'.")
471 The command \\[normal-mode], when used interactively,
484 If a major mode sets this to nil, buffer-locally, then any local
509 "Non-nil means buffers visiting files read-only do so in view mode.
511 View mode enabled, including buffers that are read-only because
521 (put 'ange-ftp-completion-hook-function 'safe-magic t)
522 (defun ange-ftp-completion-hook-function (op &rest args)
524 Runs the usual ange-ftp hook, but only for completion operations."
528 (apply 'ange-ftp-hook-function op args)
530 (cons 'ange-ftp-completion-hook-function
787 (delq (rassq 'ange-ftp-completion-hook-function tem) tem)))))
1038 (defmacro minibuffer-with-setup-hook (fun &rest body)
1039 "Add FUN to `minibuffer-setup-hook' while executing BODY.
1043 (let ((hook (make-symbol "setup-hook")))
1044 `(let (,hook)
1045 (setq ,hook
1047 ;; Clear out this hook so it does not interfere
1049 (remove-hook 'minibuffer-setup-hook ,hook)
1053 (add-hook 'minibuffer-setup-hook ,hook)
1055 (remove-hook 'minibuffer-setup-hook ,hook)))))
1061 (minibuffer-with-setup-hook
1079 automatically choosing a major mode, use \\[find-file-literally]."
1226 (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions)
1435 (run-hook-with-args-until-success
1529 (format "File %s is %s on disk. Change buffer mode? "
1541 ;; hexl-mode.
1542 (not (eq major-mode 'hexl-mode)))
1638 (or (run-hook-with-args-until-success 'find-file-not-found-functions)
1661 ;; this is a permanent local, the major mode won't eliminate it.
1671 (set-buffer-major-mode buf)
1682 conversion, `find-file-hook', automatic uncompression, etc.
1735 The major mode used is Fundamental mode regardless of the file name,
1758 Sets buffer mode, parses local variables.
1762 NOAUTO means don't mess with auto-save mode.
1766 Finishes by calling the functions in `find-file-hook'
1805 (auto-save-mode t)))
1816 (when (and view-read-only view-mode)
1817 (view-mode-disable))
1818 (normal-mode t)
1830 (not (eq (get major-mode 'mode-class) 'special)))
1831 (view-mode-enter))
1832 (run-hooks 'find-file-hook)))
1847 (defun normal-mode (&optional find-file)
1848 "Choose the major mode for this buffer automatically.
1853 we may set up the file-specified mode and local variables,
1856 not set local variables (though we do notice a mode specified with -*-.)
1858 `enable-local-variables' is ignored if you run `normal-mode' interactively,
1862 (funcall (or default-major-mode 'fundamental-mode))
1864 (report-errors "File mode specification error: %s"
1865 (set-auto-mode))
1870 (when (and font-lock-mode
1871 ;; Font-lock-mode (now in font-core.el) can be ON when
1876 (font-lock-mode 1))
1881 (defcustom auto-mode-case-fold nil
1882 "Non-nil means to try second pass through `auto-mode-alist'.
1884 to find a matching major mode, a second case-insensitive search is made.
1891 (defvar auto-mode-alist
1892 ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
1893 ;; c++-mode, java-mode and more) are added through autoload
1900 ("\\.s?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode)
1901 ("\\.te?xt\\'" . text-mode)
1902 ("\\.[tT]e[xX]\\'" . tex-mode)
1903 ("\\.ins\\'" . tex-mode) ;Installation files for TeX packages.
1904 ("\\.ltx\\'" . latex-mode)
1905 ("\\.dtx\\'" . doctex-mode)
1906 ("\\.el\\'" . emacs-lisp-mode)
1907 ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
1908 ("\\.l\\'" . lisp-mode)
1909 ("\\.li?sp\\'" . lisp-mode)
1910 ("\\.[fF]\\'" . fortran-mode)
1911 ("\\.for\\'" . fortran-mode)
1912 ("\\.p\\'" . pascal-mode)
1913 ("\\.pas\\'" . pascal-mode)
1914 ("\\.ad[abs]\\'" . ada-mode)
1915 ("\\.ad[bs].dg\\'" . ada-mode)
1916 ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode)
1917 ("Imakefile\\'" . makefile-imake-mode)
1918 ("Makeppfile\\(?:\\.mk\\)?\\'" . makefile-makepp-mode) ; Put this before .mk
1919 ("\\.makepp\\'" . makefile-makepp-mode)
1921 '(("\\.mk\\'" . makefile-bsdmake-mode)
1922 ("GNUmakefile\\'" . makefile-gmake-mode)
1923 ("[Mm]akefile\\'" . makefile-bsdmake-mode))
1924 '(("\\.mk\\'" . makefile-gmake-mode) ; Might be any make, give Gnu the host advantage
1925 ("[Mm]akefile\\'" . makefile-gmake-mode)))
1926 ("\\.am\\'" . makefile-automake-mode)
1929 ("\\.texinfo\\'" . texinfo-mode)
1930 ("\\.te?xi\\'" . texinfo-mode)
1931 ("\\.[sS]\\'" . asm-mode)
1932 ("\\.asm\\'" . asm-mode)
1933 ("[cC]hange\\.?[lL]og?\\'" . change-log-mode)
1934 ("[cC]hange[lL]og[-.][0-9]+\\'" . change-log-mode)
1935 ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode)
1936 ("\\.scm\\.[0-9]*\\'" . scheme-mode)
1937 ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
1938 ("\\.bash\\'" . sh-mode)
1939 ("\\(/\\|\\`\\)\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'" . sh-mode)
1940 ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode)
1941 ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode)
1942 ("\\.m?spec\\'" . sh-mode)
1943 ("\\.m[mes]\\'" . nroff-mode)
1944 ("\\.man\\'" . nroff-mode)
1945 ("\\.sty\\'" . latex-mode)
1946 ("\\.cl[so]\\'" . latex-mode) ;LaTeX 2e class option
1947 ("\\.bbl\\'" . latex-mode)
1948 ("\\.bib\\'" . bibtex-mode)
1949 ("\\.sql\\'" . sql-mode)
1950 ("\\.m[4c]\\'" . m4-mode)
1951 ("\\.mf\\'" . metafont-mode)
1952 ("\\.mp\\'" . metapost-mode)
1953 ("\\.vhdl?\\'" . vhdl-mode)
1954 ("\\.article\\'" . text-mode)
1955 ("\\.letter\\'" . text-mode)
1956 ("\\.i?tcl\\'" . tcl-mode)
1957 ("\\.exp\\'" . tcl-mode)
1958 ("\\.itk\\'" . tcl-mode)
1959 ("\\.icn\\'" . icon-mode)
1960 ("\\.sim\\'" . simula-mode)
1961 ("\\.mss\\'" . scribe-mode)
1962 ("\\.f9[05]\\'" . f90-mode)
1963 ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode
1964 ("\\.pro\\'" . idlwave-mode)
1965 ("\\.prolog\\'" . prolog-mode)
1966 ("\\.tar\\'" . tar-mode)
1969 ("\\.\\(arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\)\\'" . archive-mode)
1970 ("\\.\\(ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\)\\'" . archive-mode)
1971 ("\\.\\(sx[dmicw]\\|odt\\)\\'" . archive-mode) ; OpenOffice.org
1974 ("\\`/tmp/Re" . text-mode)
1975 ("/Message[0-9]*\\'" . text-mode)
1976 ("\\.zone\\'" . zone-mode)
1978 ("\\`/tmp/fol/" . text-mode)
1979 ("\\.oak\\'" . scheme-mode)
1980 ("\\.sgml?\\'" . sgml-mode)
1981 ("\\.x[ms]l\\'" . xml-mode)
1982 ("\\.dtd\\'" . sgml-mode)
1983 ("\\.ds\\(ss\\)?l\\'" . dsssl-mode)
1984 ("\\.js\\'" . java-mode) ; javascript-mode would be better
1985 ("\\.x[bp]m\\'" . c-mode)
1988 ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode)
1989 ("\\`\\..*emacs\\'" . emacs-lisp-mode)
1992 ("[:/]_emacs\\'" . emacs-lisp-mode)
1993 ("/crontab\\.X*[0-9]+\\'" . shell-script-mode)
1994 ("\\.ml\\'" . lisp-mode)
1995 ("\\.\\(asn\\|mib\\|smi\\)\\'" . snmp-mode)
1996 ("\\.\\(as\\|mi\\|sm\\)2\\'" . snmpv2-mode)
1997 ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode)
1998 ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG
1999 ("\\.[eE]?[pP][sS]\\'" . ps-mode)
2000 ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode)
2001 ("BROWSE\\'" . ebrowse-tree-mode)
2002 ("\\.ebrowse\\'" . ebrowse-tree-mode)
2003 ("#\\*mail\\*" . mail-mode)
2004 ("\\.g\\'" . antlr-mode)
2005 ("\\.ses\\'" . ses-mode)
2006 ("\\.\\(soa\\|zone\\)\\'" . dns-mode)
2007 ("\\.docbook\\'" . sgml-mode)
2008 ("\\.com\\'" . dcl-mode)
2009 ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
2011 ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode)
2012 ("\\.\\(?:desktop\\|la\\)\\'" . conf-unix-mode)
2013 ("\\.ppd\\'" . conf-ppd-mode)
2014 ("java.+\\.conf\\'" . conf-javaprop-mode)
2015 ("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode)
2017 ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode)
2018 ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode)
2019 ("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode)
2021 ("/\\.?\\(?:gnokiirc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode)
2023 ("/\\.\\(?:enigma\\|gltron\\|gtk\\|hxplayer\\|net\\|neverball\\|qt/.+\\|realplayer\\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode)
2024 ("/\\.\\(?:gdbtkinit\\|grip\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'" . conf-mode)
2025 ("/\\.?X\\(?:default\\|resource\\|re\\)s\\>" . conf-xdefaults-mode)
2026 ("/X11.+app-defaults/" . conf-xdefaults-mode)
2027 ("/X11.+locale/.+/Compose\\'" . conf-colon-mode)
2029 ("/X11.+locale/compose\\.dir\\'" . conf-javaprop-mode)
2033 ;; Using mode nil rather than `ignore' would let the search continue
2039 ("\\.[1-9]\\'" . nroff-mode)
2041 "Alist of filename patterns vs corresponding major mode functions.
2045 mode function to use. FUNCTION will be called, unless it is nil.
2052 then `auto-mode-alist' is not processed.
2054 The extensions whose FUNCTION is `archive-mode' should also
2057 See also `interpreter-mode-alist', which detects executable script modes
2059 and `magic-mode-alist', which determines modes based on file contents.")
2061 (defvar interpreter-mode-alist
2062 ;; Note: The entries for the modes defined in cc-mode.el (awk-mode
2063 ;; and pike-mode) are added through autoload directives in that
2069 '(("perl" . perl-mode)
2070 ("perl5" . perl-mode)
2071 ("miniperl" . perl-mode)
2072 ("wish" . tcl-mode)
2073 ("wishx" . tcl-mode)
2074 ("tcl" . tcl-mode)
2075 ("tclsh" . tcl-mode)
2076 ("scm" . scheme-mode)
2077 ("ash" . sh-mode)
2078 ("bash" . sh-mode)
2079 ("bash2" . sh-mode)
2080 ("csh" . sh-mode)
2081 ("dtksh" . sh-mode)
2082 ("es" . sh-mode)
2083 ("itcsh" . sh-mode)
2084 ("jsh" . sh-mode)
2085 ("ksh" . sh-mode)
2086 ("oash" . sh-mode)
2087 ("pdksh" . sh-mode)
2088 ("rc" . sh-mode)
2089 ("rpm" . sh-mode)
2090 ("sh" . sh-mode)
2091 ("sh5" . sh-mode)
2092 ("tcsh" . sh-mode)
2093 ("wksh" . sh-mode)
2094 ("wsh" . sh-mode)
2095 ("zsh" . sh-mode)
2096 ("tail" . text-mode)
2097 ("more" . text-mode)
2098 ("less" . text-mode)
2099 ("pg" . text-mode)
2100 ("make" . makefile-gmake-mode) ; Debian uses this
2101 ("guile" . scheme-mode)
2102 ("clisp" . lisp-mode)))
2104 This is used for files whose first lines match `auto-mode-interpreter-regexp'.
2107 of a script, mode MODE is enabled.
2109 See also `auto-mode-alist'.")
2119 (defvar auto-mode-interpreter-regexp
2122 "Regexp matching interpreters, for file mode determination.
2124 to determine the file's mode in `set-auto-mode'. If it matches, the file
2126 of the regular expression. The mode is then determined as the mode
2127 associated with that interpreter in `interpreter-mode-alist'.")
2129 (defvar magic-mode-alist
2130 `((image-type-auto-detected-p . image-mode))
2131 "Alist of buffer beginnings vs. corresponding major mode functions.
2134 buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will
2135 call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's
2136 major mode.
2139 \"allow `auto-mode-alist' to decide for these files.\")")
2140 (put 'magic-mode-alist 'risky-local-variable t)
2142 (defvar magic-fallback-mode-alist
2152 . html-mode)
2153 ("<!DOCTYPE[ \t\r\n]+[Hh][Tt][Mm][Ll]" . html-mode)
2155 ("<\\?xml " . xml-mode)
2159 . sgml-mode)
2160 ("%!PS" . ps-mode)
2161 ("# xmcd " . conf-unix-mode))
2162 "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'.
2165 buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will
2166 call FUNCTION, provided that `magic-mode-alist' and `auto-mode-alist'
2167 have not specified a mode for this file.
2170 (put 'magic-fallback-mode-alist 'risky-local-variable t)
2172 (defvar magic-mode-regexp-match-limit 4000
2173 "Upper limit on `magic-mode-alist' regexp matches.
2174 Also applies to `magic-fallback-mode-alist'.")
2176 (defun set-auto-mode (&optional keep-mode-if-same)
2177 "Select major mode appropriate for current buffer.
2179 To find the right major mode, this function checks for a -*- mode tag,
2180 checks if it uses an interpreter listed in `interpreter-mode-alist',
2181 matches the buffer beginning against `magic-mode-alist',
2182 compares the filename against the entries in `auto-mode-alist',
2183 then matches the buffer beginning against `magic-fallback-mode-alist'.
2185 It does not check for the `mode:' local variable in the
2189 -*- mode tag.
2192 set the major mode only if that would change it. In other words
2193 we don't actually set it to the same mode the buffer already has."
2194 ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*-
2195 (let (end done mode modes)
2196 ;; Find a -*- mode tag
2201 (setq end (set-auto-mode-1))
2203 ;; Find all specifications for the `mode:' variable
2206 (or (and (looking-at "mode:")
2208 (re-search-forward "[ \t;]mode:" end t)))
2215 (push (intern (concat (downcase (buffer-substring beg (point))) "-mode"))
2219 "-mode"))
2224 (dolist (mode (nreverse modes))
2225 (if (not (functionp mode))
2226 (message "Ignoring unknown mode `%s'" mode)
2228 (or (set-auto-mode-0 mode keep-mode-if-same)
2235 (setq mode (save-excursion
2237 (if (looking-at auto-mode-interpreter-regexp)
2240 ;; Map interpreter name to a mode, signalling we're done at the
2242 done (assoc (file-name-nondirectory mode)
2243 interpreter-mode-alist))
2244 ;; If we found an interpreter mode to use, invoke it now.
2246 (set-auto-mode-0 (cdr done) keep-mode-if-same)))
2247 ;; Next try matching the buffer beginning against magic-mode-alist.
2254 (+ (point-min) magic-mode-regexp-match-limit)))
2255 (assoc-default nil magic-mode-alist
2260 (set-auto-mode-0 done keep-mode-if-same)))
2261 ;; Next compare the filename against the entries in auto-mode-alist.
2269 (setq mode
2273 (assoc-default name auto-mode-alist
2279 (assoc-default name auto-mode-alist
2282 (and auto-mode-case-fold
2284 (assoc-default name auto-mode-alist
2286 (if (and mode
2287 (consp mode)
2288 (cadr mode))
2289 (setq mode (car mode)
2292 (when mode
2293 (set-auto-mode-0 mode keep-mode-if-same)
2295 ;; Next try matching the buffer beginning against magic-fallback-mode-alist.
2302 (+ (point-min) magic-mode-regexp-match-limit)))
2303 (assoc-default nil magic-fallback-mode-alist
2308 (set-auto-mode-0 done keep-mode-if-same)))))
2310 ;; When `keep-mode-if-same' is set, we are working on behalf of
2311 ;; set-visited-file-name. In that case, if the major mode specified is the
2314 (defun set-auto-mode-0 (mode &optional keep-mode-if-same)
2317 any aliases and compared to current major mode. If they are the
2319 (unless (and keep-mode-if-same
2320 (eq (indirect-function mode)
2321 (indirect-function major-mode)))
2322 (when mode
2323 (funcall mode)
2324 mode)))
2326 (defun set-auto-mode-1 ()
2353 ;; for mode frobs in the first two
2377 (defvar hack-local-variables-hook nil
2378 "Normal hook run after processing a file's local variables specs.
2401 auto-mode-alist
2420 global-mode-string
2431 minor-mode-alist
2432 minor-mode-map-alist
2433 minor-mode-overriding-map-alist
2434 mode-line-buffer-identification
2435 mode-line-format
2436 mode-line-modes
2437 mode-line-modified
2438 mode-line-mule-info
2439 mode-line-position
2440 mode-line-process
2441 mode-name
2455 vc-mode))
2460 ;; the major mode's file, since that will be loaded before file variables are
2464 ;; file defining the minor mode after the defcustom/defvar using an autoload
2470 ;; minor mode file may not be loaded yet.
2479 (indent-tabs-mode . booleanp) ;; C source code
2575 (defun hack-local-variables-prop-line (&optional mode-only)
2577 Ignore any specification for `mode:' and `coding:';
2578 `set-auto-mode' should already have handled `mode:',
2582 mode is specified, returning t if it is specified. Otherwise,
2587 (let ((end (set-auto-mode-1))
2588 result mode-specified)
2590 ;; Also set MODE-SPECIFIED if we see a spec or `mode'.
2595 (setq mode-specified t)
2612 ;; case when checking for `mode' in set-auto-mode,
2616 (or (and (equal (downcase (symbol-name key)) "mode")
2617 (setq mode-specified t))
2627 (if mode-only
2628 mode-specified
2631 (defun hack-local-variables (&optional mode-only)
2633 If MODE-ONLY is non-nil, all we do is check whether the major mode
2638 (when (or mode-only enable-local-variables)
2639 (setq result (hack-local-variables-prop-line mode-only))
2705 (if mode-only
2706 (if (eq var 'mode)
2718 ;; mode is specified (if MODE-ONLY is non-nil), or set the
2720 (if mode-only
2734 (or (eq var 'mode)
2760 (run-hooks 'hack-local-variables-hook)))))
2781 * Its name ends with \"hook(s)\", \"function(s)\", \"form(s)\", \"map\",
2783 \"mode-alist\", \"font-lock-(syntactic-)keyword*\",
2792 -[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\
2812 (cond ((eq prop 'lisp-indent-hook)
2813 ;; Only allow safe values of lisp-indent-hook;
2846 If VAR is `mode', call `VAL-mode' as a function unless it's
2847 already the major mode."
2848 (cond ((eq var 'mode)
2849 (let ((mode (intern (concat (downcase (symbol-name val))
2850 "-mode"))))
2851 (unless (eq (indirect-function mode)
2852 (indirect-function major-mode))
2853 (funcall mode))))
2866 (defcustom change-major-mode-with-file-name t
2867 "Non-nil means \\[write-file] should set the major mode from the file name.
2868 However, the mode will not be changed if
2869 \(1) a local variables list or the `-*-' line specifies a major mode, or
2870 \(2) the current major mode is a \"special\" mode,
2872 \(3) the new file name does not particularly specify any mode."
2942 ;; Changing to visit an ordinary local file instead should flush the hook.
2949 (if vc-mode
2951 (kill-local-variable 'vc-mode)
2953 ;; Since this is a permanent local, the major mode won't eliminate it.
2964 (auto-save-mode t))
2979 ;; Update the major mode, if the file name determines it.
2981 ;; Don't change the mode if it is special.
2982 (or (not change-major-mode-with-file-name)
2983 (get major-mode 'mode-class)
2984 ;; Don't change the mode if the local variable list specifies it.
2986 (set-auto-mode t))
3035 (vc-find-file-hook))
3581 (defvar auto-save-hook nil
3582 "Normal hook run just before auto-saving.")
3584 (defcustom before-save-hook nil
3585 "Normal hook that is run before a buffer is saved to its file."
3587 :type 'hook
3590 (defcustom after-save-hook nil
3591 "Normal hook that is run after a buffer is saved to its file."
3593 :type 'hook
3613 `before-save-hook' and `after-save-hook', respectively."
3681 (run-hooks 'before-save-hook)
3682 (or (run-hook-with-args-until-success 'write-contents-functions)
3683 (run-hook-with-args-until-success 'local-write-file-hooks)
3684 (run-hook-with-args-until-success 'write-file-functions)
3685 ;; If a hook returned t, file is already "written".
3705 (run-hooks 'after-save-hook))
3793 ;; Change the mode back, after writing.
3810 (defun diff-buffer-with-file (&optional buffer)
3812 This requires the external program `diff' to be in your `exec-path'."
3822 (diff buffer-file-name tempfile nil t)
3846 (diff-buffer-with-file buf))
3862 view the differences using `diff-buffer-with-file'.
3947 If visiting file read-only and `view-read-only' is non-nil, enter view mode."
3955 ((and buffer-read-only view-mode)
3958 (setq view-read-only t)) ; Must leave view mode.
3960 ;; If view-mode is already active, `view-mode-enter' is a nop.
3961 (not view-mode)
3962 (not (eq (get major-mode 'mode-class) 'special)))
3963 (view-mode-enter))
3965 (force-mode-line-update)))
4027 (force-mode-line-update))))
4088 For more information on how this variable is used by Auto Revert mode,
4091 (defvar before-revert-hook nil
4092 "Normal hook for `revert-buffer' to run before reverting.
4094 mechanism, this hook is not used.")
4096 (defvar after-revert-hook nil
4097 "Normal hook for `revert-buffer' to run after reverting.
4098 Note that the hook value that it runs is the value that was in effect
4100 hook functions.
4103 mechanism, this hook is not used.")
4105 (defvar revert-buffer-internal-hook)
4129 the files modes. Normally we reinitialize them using `normal-mode'.
4133 `before-revert-hook' and `after-revert-hook' are run at the beginning
4167 (run-hooks 'before-revert-hook)
4173 ;; Effectively copy the after-revert-hook status,
4175 (let ((global-hook (default-value 'after-revert-hook))
4176 (local-hook (when (local-variable-p 'after-revert-hook)
4177 after-revert-hook))
4238 ;; Run after-revert-hook as it was before we reverted.
4239 (setq-default revert-buffer-internal-hook global-hook)
4240 (if local-hook
4241 (set (make-local-variable 'revert-buffer-internal-hook)
4242 local-hook)
4243 (kill-local-variable 'revert-buffer-internal-hook))
4244 (run-hooks 'revert-buffer-internal-hook))
4323 ;; so that Font Lock mode won't highlight the first character.
4426 (defun auto-save-mode (arg)
4522 ;; mode tends to create a good number of these.)
5199 See also `kill-emacs-hook'.")
5234 (run-hook-with-args-until-failure 'kill-emacs-query-functions)