From a5d38e349aab01f93468fe950e6f4ecbd0fee1e0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 13 Oct 2013 16:21:56 -0700 Subject: [PATCH] * lisp/progmodes/sh-script.el (sh-mark-line, sh-learn-buffer-indent): Occur buffers are read-only. http://bugs.debian.org/720775 --- lisp/ChangeLog | 3 ++ lisp/progmodes/sh-script.el | 55 ++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e47360b6cfc..1f74b3b2d1f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-10-13 Glenn Morris + * progmodes/sh-script.el (sh-mark-line, sh-learn-buffer-indent): + Occur buffers are read-only. http://bugs.debian.org/720775 + * emacs-lisp/authors.el (authors-fixed-entries): Comment out old alpha stuff. diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index dfd3fc0026c..ec73a06955c 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -3438,26 +3438,23 @@ so that `occur-next' and `occur-prev' will work." ) (goto-char (point-max)) (setq start (point)) - (insert line) - (if occur-point - (setq occur-point (point))) - (insert message) - (if point - (add-text-properties - start (point) - '(mouse-face highlight - help-echo "mouse-2: go to the line where I learned this"))) - (insert "\n") - (if point - (progn - (put-text-property start (point) 'occur-target m1) - (if occur-point - (put-text-property start occur-point - 'occur-match t)) - )) - ))) - - + (let ((inhibit-read-only t)) + (insert line) + (if occur-point + (setq occur-point (point))) + (insert message) + (if point + (add-text-properties + start (point) + '(mouse-face highlight + help-echo "mouse-2: go to the line where I learned this"))) + (insert "\n") + (when point + (put-text-property start (point) 'occur-target m1) + (if occur-point + (put-text-property start occur-point + 'occur-match t)) + ))))) ;; Is this really worth having? (defvar sh-learned-buffer-hook nil @@ -3689,15 +3686,15 @@ This command can often take a long time to run." (nth 2 learned-var) out-buffer))) (with-current-buffer out-buffer (goto-char (point-min)) - (insert - (format "Indentation values for buffer %s.\n" name) - (format "%d indentation variable%s different values%s\n\n" - num-diffs - (if (= num-diffs 1) - " has" "s have") - (if (zerop num-diffs) - "." ":")) - ))) + (let ((inhibit-read-only t)) + (insert + (format "Indentation values for buffer %s.\n" name) + (format "%d indentation variable%s different values%s\n\n" + num-diffs + (if (= num-diffs 1) + " has" "s have") + (if (zerop num-diffs) + "." ":")))))) ;; Are abnormal hooks considered bad form? (run-hook-with-args 'sh-learned-buffer-hook learned-var-list) (and (called-interactively-p 'any) -- 2.39.2