Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
76386c5a
Commit
76386c5a
authored
Jun 22, 2012
by
Bastien Guerry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug #11726 -- send a message after `toggle-read-only'.
Thanks to Drew Adam for reporting this.
parent
2ee3d7f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/files.el
lisp/files.el
+15
-12
No files found.
lisp/ChangeLog
View file @
76386c5a
2012-06-22 Bastien Guerry <bzg@gnu.org>
* files.el (toggle-read-only): Display a message telling whether
the buffer is read-only or not (bug#11726).
2012-06-22 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/gv.el: New file.
...
...
lisp/files.el
View file @
76386c5a
...
...
@@ -4857,18 +4857,21 @@ properties or buffer state) and make changes, temporarily bind
(
not
buffer-read-only
)))
; If buffer-read-only is set correctly,
nil
; do nothing.
;; Toggle.
(
cond
((
and
buffer-read-only
view-mode
)
(
View-exit-and-edit
)
(
make-local-variable
'view-read-only
)
(
setq
view-read-only
t
))
; Must leave view mode.
((
and
(
not
buffer-read-only
)
view-read-only
;; If view-mode is already active, `view-mode-enter' is a nop.
(
not
view-mode
)
(
not
(
eq
(
get
major-mode
'mode-class
)
'special
)))
(
view-mode-enter
))
(
t
(
setq
buffer-read-only
(
not
buffer-read-only
))
(
force-mode-line-update
)))))
(
progn
(
cond
((
and
buffer-read-only
view-mode
)
(
View-exit-and-edit
)
(
make-local-variable
'view-read-only
)
(
setq
view-read-only
t
))
; Must leave view mode.
((
and
(
not
buffer-read-only
)
view-read-only
;; If view-mode is already active, `view-mode-enter' is a nop.
(
not
view-mode
)
(
not
(
eq
(
get
major-mode
'mode-class
)
'special
)))
(
view-mode-enter
))
(
t
(
setq
buffer-read-only
(
not
buffer-read-only
))
(
force-mode-line-update
))))
(
message
"Read-only %s for this buffer"
(
if
buffer-read-only
"enabled"
"disabled"
))))
(
defun
insert-file
(
filename
)
"Insert contents of file FILENAME into buffer after point.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment