[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/outline a34cf43 12/15: lisp/outline.el (outline-hi
From: |
Oleh Krehel |
Subject: |
[Emacs-diffs] scratch/outline a34cf43 12/15: lisp/outline.el (outline-hide-sublevels): Rename from `hide-sublevels'. |
Date: |
Wed, 28 Jan 2015 11:44:26 +0000 |
branch: scratch/outline
commit a34cf433cf82abf31deb751d7d7589dfb3608b6f
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
lisp/outline.el (outline-hide-sublevels): Rename from `hide-sublevels'.
---
lisp/ChangeLog | 6 ++++++
lisp/outline.el | 41 ++++++++++++++++++++++-------------------
2 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d4e0720..710e353 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
2015-01-28 Oleh Krehel <address@hidden>
+ * outline.el (outline-hide-sublevels): Rename from
+ `hide-sublevels'.
+ (hide-sublevels): Declare as obsolete.
+
+2015-01-28 Oleh Krehel <address@hidden>
+
* outline.el (outline-show-subtree): Rename from `show-subtree'.
(show-subtree): Declare as obsolete.
diff --git a/lisp/outline.el b/lisp/outline.el
index 248eeb9..4685245 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -74,7 +74,7 @@ in the file it applies to.")
(define-key map "\C-e" 'outline-show-entry)
(define-key map "\C-l" 'outline-hide-leaves)
(define-key map "\C-k" 'show-branches)
- (define-key map "\C-q" 'hide-sublevels)
+ (define-key map "\C-q" 'outline-hide-sublevels)
(define-key map "\C-o" 'hide-other)
(define-key map "\C-^" 'outline-move-subtree-up)
(define-key map "\C-v" 'outline-move-subtree-down)
@@ -89,8 +89,8 @@ in the file it applies to.")
(define-key map [hide hide-other]
'(menu-item "Hide Other" hide-other
:help "Hide everything except current body and parent and top-level
headings"))
- (define-key map [hide hide-sublevels]
- '(menu-item "Hide Sublevels" hide-sublevels
+ (define-key map [hide outline-hide-sublevels]
+ '(menu-item "Hide Sublevels" outline-hide-sublevels
:help "Hide everything but the top LEVELS levels of headers, in whole
buffer"))
(define-key map [hide outline-hide-subtree]
'(menu-item "Hide Subtree" outline-hide-subtree
@@ -848,22 +848,22 @@ Show the heading too, if it is currently invisible."
(defun outline-show-heading ()
"Show the current heading and move to its end."
(outline-flag-region (- (point)
- (if (bobp) 0
- (if (and outline-blank-line
+ (if (bobp) 0
+ (if (and outline-blank-line
(eq (char-before (1- (point))) ?\n))
- 2 1)))
- (progn (outline-end-of-heading) (point))
- nil))
+ 2 1)))
+ (progn (outline-end-of-heading) (point))
+ nil))
-(defun hide-sublevels (levels)
+(defun outline-hide-sublevels (levels)
"Hide everything but the top LEVELS levels of headers, in whole buffer."
(interactive (list
- (cond
- (current-prefix-arg (prefix-numeric-value current-prefix-arg))
- ((save-excursion (beginning-of-line)
- (looking-at outline-regexp))
- (funcall outline-level))
- (t 1))))
+ (cond
+ (current-prefix-arg (prefix-numeric-value
current-prefix-arg))
+ ((save-excursion (beginning-of-line)
+ (looking-at outline-regexp))
+ (funcall outline-level))
+ (t 1))))
(if (< levels 1)
(error "Must keep at least one level of headers"))
(save-excursion
@@ -878,14 +878,14 @@ Show the heading too, if it is currently invisible."
;; Keep empty last line, if available.
(if (bolp) (1- (point)) (point)))))
(if (< end beg)
- (setq beg (prog1 end (setq end beg))))
+ (setq beg (prog1 end (setq end beg))))
;; First hide everything.
(outline-flag-region beg end t)
;; Then unhide the top level headers.
(outline-map-region
(lambda ()
- (if (<= (funcall outline-level) levels)
- (outline-show-heading)))
+ (if (<= (funcall outline-level) levels)
+ (outline-show-heading)))
beg end)
;; Finally unhide any trailing newline.
(goto-char (point-max))
@@ -893,10 +893,13 @@ Show the heading too, if it is currently invisible."
(outline-flag-region (1- (point)) (point) nil))))
(run-hooks 'outline-view-change-hook))
+(define-obsolete-function-alias
+ 'hide-sublevels 'outline-hide-sublevels "25.1")
+
(defun hide-other ()
"Hide everything except current body and parent and top-level headings."
(interactive)
- (hide-sublevels 1)
+ (outline-hide-sublevels 1)
(let (outline-view-change-hook)
(save-excursion
(outline-back-to-heading t)
- [Emacs-diffs] scratch/outline 89d218c 04/15: * outline.el (outline-hide-entry): Rename from `hide-entry'., (continued)
- [Emacs-diffs] scratch/outline 89d218c 04/15: * outline.el (outline-hide-entry): Rename from `hide-entry'., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline 834612f 03/15: lisp/outline.el (outline-mode): Clean up docstring, Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline d262f73 06/15: lisp/outline.el (outline-hide-body): Rename from `hide-body'., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline ada4428 08/15: lisp/outline.el (outline-show-all): Rename from `show-all'., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline 2046e5a 07/15: lisp/outline.el (outline-hide-region-body): Rename., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline a88ca2b 09/15: lisp/outline.el (outline-hide-subtree): Rename from `hide-subtree'., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline 7ecd5ee 05/15: lisp/outline.el (outline-show-entry): rename from `show-entry', Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline f898942 10/15: lisp/outline.el (outline-hide-leaves): Rename from `hide-leaves'., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline 18467f2 11/15: lisp/outline.el (outline-show-subtree): Rename from `show-subtree'., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline ef1267e 13/15: lisp/outline.el (outline-hide-other): Rename from `hide-other'., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline a34cf43 12/15: lisp/outline.el (outline-hide-sublevels): Rename from `hide-sublevels'.,
Oleh Krehel <=
- [Emacs-diffs] scratch/outline 4ad2134 14/15: lisp/outline.el (outline-show-children): Rename from `show-children'., Oleh Krehel, 2015/01/28
- [Emacs-diffs] scratch/outline 8fc5ca4 15/15: lisp/outline.el (outline-show-branches): Rename from `show-branches'., Oleh Krehel, 2015/01/28