Browse files

use toggle-read-only function instead of inhibit-read-only variable

setting inhibit-read-only is a bad idea.  it globally affects all buffers and
basically makes it so read-only is completely ignored.  it's better to turn off
read-only mode locally, make the changes, then turn it back on again.
  • Loading branch information...
1 parent d87072c commit 8f1c1e4fddf4a19ec3f1f1c5c052f6e04d5e9331 @pheaver committed Oct 7, 2010
Showing with 6 additions and 5 deletions.
  1. +2 −3 breadcrumb-site-file.el
  2. +4 −2 breadcrumb.el
View
5 breadcrumb-site-file.el
@@ -1,7 +1,7 @@
;;;### (autoloads (bc-list bc-clear bc-goto-current bc-local-next
;;;;;; bc-local-previous bc-next bc-previous bc-set) "breadcrumb"
-;;;;;; "breadcrumb.el" (19613 29079))
+;;;;;; "breadcrumb.el" (19630 22935))
;;; Generated autoloads from breadcrumb.el
(autoload 'bc-set "breadcrumb" "\
@@ -48,8 +48,7 @@ other buffer in other window.
;;;***
-;;;### (autoloads nil nil ("breadcrumb-test.el" "breadcrumb.el")
-;;;;;; (19619 749 359000))
+;;;### (autoloads nil nil ("breadcrumb-test.el") (19630 22937 609000))
;;;***
View
6 breadcrumb.el 100644 → 100755
@@ -452,7 +452,7 @@ It's the position (point) for normal buffer and (info-node-name point) for Info
(save-excursion
(save-window-excursion
(let ((index 0))
- (setq inhibit-read-only t)
+ (toggle-read-only 0)
(erase-buffer)
(insert "*Breadcrumb Bookmarks*\n\n")
(insert "Bookmarks listed in most recently set order. Press '?' for help.\n")
@@ -469,6 +469,7 @@ It's the position (point) for normal buffer and (info-node-name point) for Info
(setq index (1+ index))
)
*bc-bookmarks*)
+ (toggle-read-only 1)
)))
)
@@ -525,11 +526,12 @@ It's the position (point) for normal buffer and (info-node-name point) for Info
(defun bc-menu-mark-char (mark-char)
"Set a mark char on the bookmark line at cursor."
(when (bc-menu-valid-bookmark)
- (setq inhibit-read-only t)
+ (toggle-read-only 0)
(beginning-of-line)
(delete-char 1)
(insert mark-char)
(bc-menu-advance-cursor)
+ (toggle-read-only 1)
))
(defun bc-menu-mark-all-char (mark-char)

0 comments on commit 8f1c1e4

Please sign in to comment.