]> git.eshelyaron.com Git - emacs.git/commitdiff
Small fixes
authorJuri Linkov <juri@linkov.net>
Mon, 28 Jan 2019 21:17:04 +0000 (23:17 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 28 Jan 2019 21:17:04 +0000 (23:17 +0200)
* lisp/generic-x.el (etc-passwd-generic-mode): Add comment.  (Bug#34225)

* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): Set overlay
property 'diff-mode to 'syntax.  (Bug#33567)
(diff-syntax-fontify-props): Reset buffer-file-name to nil.

lisp/generic-x.el
lisp/vc/diff-mode.el

index dd614020153ed11d3892482238a4da96ec161282..47dfd2822d49ade2eb2815da56707fdb7bebbe3a 100644 (file)
@@ -1490,6 +1490,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
      '("^\\([^:]+\\):\\([^:]*\\):\\([0-9]+\\):\\(.*\\)$"
        (1 font-lock-type-face)
        (4 font-lock-variable-name-face))))
+  ;; /etc/passwd- is a backup file for /etc/passwd, so is group- and shadow-
   '("/etc/passwd-?\\'" "/etc/group-?\\'" "/etc/shadow-?\\'")
   (list
    (function
index 5d6cc6f38fb6905521fdef7d0f3e875dbd44163b..158489c97fe98460d22b6ced109672253e551bab 100644 (file)
@@ -2488,6 +2488,7 @@ When OLD is non-nil, highlight the hunk from the old source."
                   (let ((ol (make-overlay (+ bol (nth 0 prop))
                                           (+ bol (nth 1 prop))
                                           nil 'front-advance nil)))
+                    (overlay-put ol 'diff-mode 'syntax)
                     (overlay-put ol 'evaporate t)
                     (overlay-put ol 'face (nth 2 prop))))))))))))
 
@@ -2502,6 +2503,7 @@ hunk text is not found in the source file."
   (unless no-init
     (buffer-disable-undo)
     (font-lock-mode -1)
+    (setq buffer-file-name nil)
     (let ((enable-local-variables :safe) ;; to find `mode:'
           (buffer-file-name file))
       (set-auto-mode)