[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111417: * lisp/view.el (view--enable
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111417: * lisp/view.el (view--enable, view--disable): Rename from view-mode-enable |
Date: |
Thu, 03 Jan 2013 21:53:48 -0500 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111417
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2013-01-03 21:53:48 -0500
message:
* lisp/view.el (view--enable, view--disable): Rename from view-mode-enable
and view-mode-disable and assume it's called from view-mode.
(view-mode-enable, view-mode-disable): Redefine as obsolete
compatibility layer above view-mode.
(view-mode-enter): Call `view-mode'.
* lisp/files.el (after-find-file): Call `view-mode'.
modified:
lisp/ChangeLog
lisp/files.el
lisp/view.el
src/ChangeLog
src/fns.c
test/indent/shell.sh
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-01-04 02:45:59 +0000
+++ b/lisp/ChangeLog 2013-01-04 02:53:48 +0000
@@ -1,5 +1,13 @@
2013-01-04 Stefan Monnier <address@hidden>
+ * view.el (view--enable, view--disable): Rename from view-mode-enable
+ and view-mode-disable and assume it's called from view-mode.
+ (view-mode-enable, view-mode-disable): Redefine as obsolete
+ compatibility layer above view-mode.
+ (view-mode-enter): Call `view-mode'.
+
+ * files.el (after-find-file): Call `view-mode'.
+
* doc-view.el (doc-view-scale-internally): New var.
(doc-view-enlarge, doc-view-insert-image): Obey it.
@@ -348,6 +356,8 @@
(lm-homepage): New function.
(lm-with-file): Don't be confused if narrowing is in effect.
+2012-12-19 Stefan Monnier <address@hidden>
+
* vc/diff-mode.el (diff-post-command-hook): Don't ignore changes at the
very beginning of a hunk (e.g. killing the first line).
=== modified file 'lisp/files.el'
--- a/lisp/files.el 2013-01-02 16:13:04 +0000
+++ b/lisp/files.el 2013-01-04 02:53:48 +0000
@@ -209,7 +209,6 @@
(declare-function dired-unmark "dired" (arg))
(declare-function dired-do-flagged-delete "dired" (&optional nomessage))
(declare-function dos-8+3-filename "dos-fns" (filename))
-(declare-function view-mode-disable "view" ())
(declare-function dosified-file-name "dos-fns" (file-name))
(defvar file-name-invalid-regexp
@@ -2125,7 +2124,7 @@
(setq buffer-read-only t))
(unless nomodes
(when (and view-read-only view-mode)
- (view-mode-disable))
+ (view-mode -1))
(normal-mode t)
;; If requested, add a newline at the end of the file.
(and (memq require-final-newline '(visit visit-save))
=== modified file 'lisp/view.el'
--- a/lisp/view.el 2013-01-02 16:13:04 +0000
+++ b/lisp/view.el 2013-01-04 02:53:48 +0000
@@ -461,16 +461,13 @@
Entry to view-mode runs the normal hook `view-mode-hook'."
:lighter " View" :keymap view-mode-map
- (if view-mode (view-mode-enable) (view-mode-disable)))
+ (if view-mode (view--enable) (view--disable)))
-(defun view-mode-enable (&optional run-view-mode-hook)
- "Turn on View mode.
-Run `view-mode-hook' when RUN-VIEW-MODE-HOOK is non-nil."
+(defun view--enable ()
;; Always leave view mode before changing major mode.
;; This is to guarantee that the buffer-read-only variable is restored.
- (add-hook 'change-major-mode-hook 'view-mode-disable nil t)
- (setq view-mode t
- view-page-size nil
+ (add-hook 'change-major-mode-hook 'view--disable nil t)
+ (setq view-page-size nil
view-half-page-size nil
view-old-buffer-read-only buffer-read-only
buffer-read-only t)
@@ -481,16 +478,18 @@
(format "continue viewing %s"
(if (buffer-file-name)
(file-name-nondirectory (buffer-file-name))
- (buffer-name)))))
- (force-mode-line-update)
- (when run-view-mode-hook
- (run-hooks 'view-mode-hook)))
-
+ (buffer-name))))))
+
+
+(define-obsolete-function-alias 'view-mode-enable 'view-mode "24.4")
(defun view-mode-disable ()
"Turn off View mode."
- (remove-hook 'change-major-mode-hook 'view-mode-disable t)
+ (declare (obsolete view-mode "24.4"))
+ (view-mode -1))
+
+(defun view--disable ()
+ (remove-hook 'change-major-mode-hook 'view--disable t)
(and view-overlay (delete-overlay view-overlay))
- (force-mode-line-update)
;; Calling toggle-read-only while View mode is enabled
;; sets view-read-only to t as a buffer-local variable
;; after exiting View mode. That arranges that the next toggle-read-only
@@ -499,7 +498,6 @@
;; so that View mode stays off if toggle-read-only is called.
(if (local-variable-p 'view-read-only)
(kill-local-variable 'view-read-only))
- (setq view-mode nil)
(if (boundp 'Helper-return-blurb)
(setq Helper-return-blurb view-old-Helper-return-blurb))
(if buffer-read-only
@@ -562,8 +560,7 @@
(setq view-exit-action exit-action))
(unless view-mode
- (view-mode-enable t)
- (force-mode-line-update)
+ (view-mode 1)
(unless view-inhibit-help-message
(message "%s"
(substitute-command-keys "\
@@ -590,7 +587,7 @@
(when view-mode
(let ((buffer (window-buffer)))
(unless view-no-disable-on-exit
- (view-mode-disable))
+ (view-mode -1))
(unless exit-only
(cond
@@ -601,8 +598,7 @@
(quit-window)))
(when exit-action
- (funcall exit-action buffer))
- (force-mode-line-update)))))
+ (funcall exit-action buffer))))))
(defun View-exit ()
"Exit View mode but stay in current buffer."
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-01-04 02:42:08 +0000
+++ b/src/ChangeLog 2013-01-04 02:53:48 +0000
@@ -261,7 +261,7 @@
* xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
(redisplay_internal): Don't bother selecting the frame to get the
- proper value of frame-local variables.
+ proper value of frame-local variables (bug#13225).
2012-12-20 Dmitry Antipov <address@hidden>
=== modified file 'src/fns.c'
--- a/src/fns.c 2013-01-03 02:37:57 +0000
+++ b/src/fns.c 2013-01-04 02:53:48 +0000
@@ -86,7 +86,7 @@
before it's time to do a QUIT. This must be a power of 2. */
enum { QUIT_COUNT_HEURISTIC = 1 << 16 };
-/* Random data-structure functions */
+/* Random data-structure functions. */
DEFUN ("length", Flength, Slength, 1, 1, 0,
doc: /* Return the length of vector, list or string SEQUENCE.
=== modified file 'test/indent/shell.sh'
--- a/test/indent/shell.sh 2012-10-31 03:10:25 +0000
+++ b/test/indent/shell.sh 2013-01-04 02:53:48 +0000
@@ -5,6 +5,18 @@
# adsgsdg
+case $X in
+ foo)
+ do_something
+ ;;
+ arg=*) # bug#12953
+ do_something_else_based_on_arg
+ ;;
+ *)
+ default
+ ;;
+esac
+
echo -n $(( 5 << 2 ))
# This should not be treated as a heredoc (bug#12770).
2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111417: * lisp/view.el (view--enable, view--disable): Rename from view-mode-enable,
Stefan Monnier <=