summaryrefslogtreecommitdiff
path: root/kotl
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2019-08-14 04:29:57 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2019-08-14 04:29:57 -0400
commit6e555e763567c66ad8e50724a7dd5e286dbb1e65 (patch)
tree86fb29daa274d8007063babec826719154bf087e /kotl
parent98a5ecb3bf80f2b53523c769459d1a1a49491125 (diff)
parent332ef336a7ad87e25c0563bfeaf0e6758d52c59c (diff)
Merge remote-tracking branch 'hyperbole/master' into externals/hyperbolescratch/hyperbole-lexbind
Diffstat (limited to 'kotl')
-rw-r--r--kotl/kexport.el14
-rw-r--r--kotl/kfill.el9
-rw-r--r--kotl/kmenu.el12
-rw-r--r--kotl/kotl-autoloads.el45
-rw-r--r--kotl/kotl-mode.el44
-rw-r--r--kotl/kproperty.el2
-rw-r--r--kotl/kview.el58
-rw-r--r--kotl/kvspec.el79
8 files changed, 120 insertions, 143 deletions
diff --git a/kotl/kexport.el b/kotl/kexport.el
index d0a0de3..501a5d4 100644
--- a/kotl/kexport.el
+++ b/kotl/kexport.el
@@ -89,10 +89,10 @@
;; make klinks into hyperlinks
(cons (concat "&lt;\\s-*@\\s-*" kexport:kcell-reference-regexp
"[^&>]*&gt;")
- "<A HREF=\"#\\1\">\\0</A>")
+ "<A HREF=\"#k\\1\">\\0</A>")
(cons (format "&lt;\\s-*@\\s-*\\(%s\\)[^=&>]*&gt;"
kexport:kcell-partial-reference-regexp)
- "<A HREF=\"#\\1\">\\0</A>")
+ "<A HREF=\"#k\\1\">\\0</A>")
(cons (format "&lt;\\s-*\\([^ \t\n\r,<>]+\\)\\s-*,\\s-*%s[^=&>]*&gt;"
kexport:kcell-reference-regexp)
'kexport:html-file-klink)
@@ -185,7 +185,7 @@ STILL TODO:
title)))
(princ "<HTML><HEAD>\n\n")
- (princ "<A ID=\"top\"></A><A ID=\"0\"></A>\n")
+ (princ "<A ID=\"top\"></A><A ID=\"k0\"></A>\n")
(princ (format "<TITLE>%s</TITLE>\n" title))
(if kexport:html-description
(princ (format "<META ID=\"description\" CONTENT=\"%s\">\n"
@@ -211,8 +211,8 @@ STILL TODO:
(setq i (1- i)))
(princ "<TABLE><TR>\n")
(setq label (kcell-view:label))
- (princ (format "<A ID=\"%s\"></A>" label))
- (princ (format "<A ID=\"%s\"></A>\n" (kcell-view:idstamp)))
+ (princ (format "<A ID=\"k%s\"></A>" label))
+ (princ (format "<A ID=\"k%s\"></A>\n" (kcell-view:idstamp)))
(princ "<TD WIDTH=2% VALIGN=top><PRE>\n")
(princ (format
"<FONT %s>%s%s</FONT></PRE></TD>\n"
@@ -251,8 +251,8 @@ Works exclusively within a call to `hypb:replace-match-string'."
(match-end 1))))
(if (equal filename (file-name-nondirectory
kexport:input-filename))
- "<A HREF=\"#\\2\">\\0</A>"
- (format "<A HREF=\"file://%s#\\2\">\\0</A>"
+ "<A HREF=\"#k\\2\">\\0</A>"
+ (format "<A HREF=\"file://%s#k\\2\">\\0</A>"
(expand-file-name filename
(if kexport:input-filename
(file-name-directory
diff --git a/kotl/kfill.el b/kotl/kfill.el
index 238d7f5..27a8b6c 100644
--- a/kotl/kfill.el
+++ b/kotl/kfill.el
@@ -4,7 +4,7 @@
;;
;; Orig-Date: 23-Jan-94
;;
-;; Copyright (C) 1994-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2019 Free Software Foundation, Inc.
;; See the "../HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
@@ -95,7 +95,7 @@ number of lines that could not be moved, otherwise 0."
(forward-visible-line n)
(if (< n 0)
nil
- (skip-chars-forward "[\n\r]"))
+ (skip-chars-forward "\n\r"))
; (- (abs n) (count-matches "\n" opoint (point)))
0))
@@ -106,6 +106,7 @@ number of lines that could not be moved, otherwise 0."
;; Need this or Emacs ignores fill-prefix when inside a
;; comment.
(comment-multi-line t)
+ (fill-paragraph-handle-comment t)
fill-prefix)
(kfill:adapt nil)
(do-auto-fill))
@@ -150,8 +151,8 @@ number of lines that could not be moved, otherwise 0."
(if (not (derived-mode-p 'kotl-mode))
(apply orig-fun args)
(setq prior-fill-prefix fill-prefix)
- (if (equal prior-fill-prefix "")
- (setq prior-fill-prefix nil))
+ (when (equal prior-fill-prefix "")
+ (setq prior-fill-prefix nil))
(apply orig-fun args)
(cond (fill-prefix
(message "fill-prefix: \"%s\"; prior-fill-prefix: \"%s\""
diff --git a/kotl/kmenu.el b/kotl/kmenu.el
index cee1760..344868a 100644
--- a/kotl/kmenu.el
+++ b/kotl/kmenu.el
@@ -4,7 +4,7 @@
;;
;; Orig-Date: 28-Mar-94 at 11:22:09
;;
-;; Copyright (C) 1994-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2019 Free Software Foundation, Inc.
;; See the "../HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
@@ -197,16 +197,10 @@
(cond ((fboundp 'popup-mode-menu)
(defvar mode-popup-menu)
(setq mode-popup-menu id-popup-kotl-menu))
- ((featurep 'xemacs)
- (define-key kotl-mode-map 'button3 'kotl-popup-menu))
- (t ;; (not (featurep 'xemacs))
+ (t
(define-key kotl-mode-map [C-down-mouse-3] 'kotl-popup-menu)
(define-key kotl-mode-map [C-mouse-3] nil)))
- (unless (cond ((not (featurep 'xemacs))
- (global-key-binding [menu-bar Koutline]))
- ((boundp 'current-menubar)
- (car (find-menu-item current-menubar '("Koutline")))))
- (if (featurep 'xemacs) (set-buffer-menubar (copy-sequence current-menubar)))
+ (unless (global-key-binding [menu-bar Koutline])
(easy-menu-define nil kotl-mode-map "Koutline Menubar Menu" id-popup-kotl-menu)
;; Force a menu-bar update.
(force-mode-line-update)))
diff --git a/kotl/kotl-autoloads.el b/kotl/kotl-autoloads.el
index 287ece2..daf4bc0 100644
--- a/kotl/kotl-autoloads.el
+++ b/kotl/kotl-autoloads.el
@@ -3,7 +3,7 @@
;;; Code:
-;;;### (autoloads nil "kexport" "kexport.el" (23052 38385 0 0))
+;;;### (autoloads nil "kexport" "kexport.el" (0 0 0 0))
;;; Generated autoloads from kexport.el
(autoload 'kexport:html "kexport" "\
@@ -16,6 +16,8 @@ STILL TODO:
\(fn EXPORT-FROM OUTPUT-TO &optional SOFT-NEWLINES-FLAG)" t nil)
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kexport" '("kexport:")))
+
;;;***
;;;### (autoloads nil "kfile" "kfile.el" (22412 20800 0 0))
@@ -39,7 +41,14 @@ View an existing kotl version-2 file FILE-NAME in a read-only mode.
;;;***
-;;;### (autoloads nil "kimport" "kimport.el" (23052 38368 0 0))
+;;;### (autoloads nil "kfill" "kfill.el" (0 0 0 0))
+;;; Generated autoloads from kfill.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kfill" '("fill-paragraph" "kfill:" "prior-fill-prefix" "set-fill-prefix")))
+
+;;;***
+
+;;;### (autoloads nil "kimport" "kimport.el" (0 0 0 0))
;;; Generated autoloads from kimport.el
(defvar kimport:mode-alist '((t . kimport:text) (outline-mode . kimport:star-outline)) "\
@@ -124,6 +133,8 @@ The variable, `paragraph-start,' is used to determine paragraphs.
\(fn IMPORT-FROM OUTPUT-TO &optional CHILDREN-P)" t nil)
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kimport" '("kimport:")))
+
;;;***
;;;### (autoloads nil "klink" "klink.el" (22481 28335 0 0))
@@ -138,7 +149,14 @@ See documentation for `kcell:ref-to-id' for valid cell-ref formats.
;;;***
-;;;### (autoloads nil "kotl-mode" "kotl-mode.el" (23052 38304 0 0))
+;;;### (autoloads nil "kmenu" "kmenu.el" (0 0 0 0))
+;;; Generated autoloads from kmenu.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kmenu" '("id-" "kotl-")))
+
+;;;***
+
+;;;### (autoloads nil "kotl-mode" "kotl-mode.el" (0 0 0 0))
;;; Generated autoloads from kotl-mode.el
(autoload 'kotl-mode "kotl-mode" "\
@@ -187,11 +205,26 @@ Signal an error if current buffer is not a Hyperbole outline, else return t.
\(fn)" nil nil)
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kotl-mode" '("delete-selection-pre-hook" "kotl-mode" "yank-")))
+
+;;;***
+
+;;;### (autoloads nil "kview" "kview.el" (0 0 0 0))
+;;; Generated autoloads from kview.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kview" '("kcell-view:" "kview:")))
+
+;;;***
+
+;;;### (autoloads nil "kvspec" "kvspec.el" (0 0 0 0))
+;;; Generated autoloads from kvspec.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kvspec" '("kvspec:")))
+
;;;***
-;;;### (autoloads nil nil ("kcell.el" "kfill.el" "klabel.el" "kmenu.el"
-;;;;;; "knode.el" "kprop-em.el" "kprop-xe.el" "kproperty.el" "kview.el"
-;;;;;; "kvspec.el") (23052 38356 0 0))
+;;;### (autoloads nil nil ("kcell.el" "klabel.el" "knode.el" "kprop-em.el"
+;;;;;; "kprop-xe.el" "kproperty.el") (0 0 0 0))
;;;***
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index 7e2f70c..72e5761 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -4,7 +4,7 @@
;;
;; Orig-Date: 6/30/93
;;
-;; Copyright (C) 1993-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1993-2019 Free Software Foundation, Inc.
;; See the "../HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
@@ -257,8 +257,10 @@ It provides the following keys:
(set-syntax-table text-mode-syntax-table)
;; Turn off filladapt minor mode if on, so that it does not interfere with
;; the filling code in "kfill.el".
- (and (bound-and-true-p 'filladapt-mode)
- (fboundp 'filladapt-mode) (filladapt-mode 0))
+ ;; FIXME: Is it still needed now that they all use advice?
+ (and (fboundp 'filladapt-mode)
+ (bound-and-true-p 'filladapt-mode)
+ (filladapt-mode 0))
;; Ensure that outline structure data is saved when save-buffer is called
;; from save-some-buffers, {C-x s}.
(add-hook (if (featurep 'xemacs)
@@ -325,7 +327,7 @@ It provides the following keys:
(kvspec:activate))))
;; We have been converting a buffer from a foreign format to a koutline.
;; Now that it is converted, ensure that `kotl-previous-mode' is set to
- ;; koutline now.
+ ;; koutline.
(setq kotl-previous-mode 'kotl-mode)
(add-hook 'change-major-mode-hook #'kotl-mode:show-all nil t)
;; Always run the mode-hook last.
@@ -392,10 +394,7 @@ Direction is determined from the value of `delete-key-deletes-forward' or
whether the Backspace key exists on the keyboard. If there is no Backspace
key, the delete key should always delete backward one character."
(interactive "*p")
- (if (not (featurep 'xemacs))
- (kotl-mode:delete-char (if normal-erase-is-backspace arg (- arg)) nil)
- ;; XEmacs
- (kotl-mode:delete-char (if (delete-forward-p) arg (- arg)) nil)))
+ (kotl-mode:delete-char (if normal-erase-is-backspace arg (- arg)) nil))
(defun kotl-mode:center-line ()
"Center the line point is on, within the width specified by `fill-column'.
@@ -848,15 +847,17 @@ too long."
With arg N, insert N newlines."
(interactive "*p")
(let* ((bolp (and (kotl-mode:bolp) (not (kotl-mode:bocp))))
- (indent (kcell-view:indent)))
+ (indent (kcell-view:indent))
+ (add-prefix (and (stringp fill-prefix)
+ (not (string-empty-p fill-prefix)))))
(while (> arg 0)
(save-excursion
(insert ?\n)
- (if (and (not bolp) fill-prefix)
+ (if (and (not bolp) add-prefix)
(insert fill-prefix)
(insert-char ?\ indent)))
(setq arg (1- arg)))
- (if (and bolp fill-prefix)
+ (if (and bolp add-prefix)
(progn (delete-horizontal-space)
(insert fill-prefix)))))
@@ -1441,20 +1442,6 @@ doc string for `insert-for-yank-1', which see."
(defalias 'kotl-mode:scroll-down-command 'kotl-mode:scroll-down)
(defalias 'kotl-mode:scroll-up-command 'kotl-mode:scroll-up)
-;;; Cursor and keypad key functions aliases for XEmacs.
-(if (featurep 'xemacs)
- (progn
- (defalias 'kotl-mode:backward-char-command 'kotl-mode:backward-char)
- (defalias 'kotl-mode:forward-char-command 'kotl-mode:forward-char)
- (defalias 'kotl-mode:fkey-backward-char 'kotl-mode:backward-char)
- (defalias 'kotl-mode:fkey-forward-char 'kotl-mode:forward-char)
- (defalias 'kotl-mode:fkey-next-line 'kotl-mode:next-line)
- (defalias 'kotl-mode:fkey-previous-line 'kotl-mode:previous-line)
- (defalias 'kotl-mode:deprecated-scroll-down 'kotl-mode:scroll-down)
- (defalias 'kotl-mode:deprecated-scroll-up 'kotl-mode:scroll-up)
- (defalias 'kotl-mode:deprecated-bob 'kotl-mode:beginning-of-buffer)
- (defalias 'kotl-mode:deprecated-eob 'kotl-mode:end-of-buffer)))
-
(defun kotl-mode:back-to-indentation ()
"Move point to the first non-read-only non-whitespace character on this line."
(interactive)
@@ -2145,7 +2132,7 @@ If key is pressed:
otherwise hide it;
(3) between cells or within the read-only indentation region to the left of
a cell, then move point to prior location and begin creation of a
- klink to some other outline cell; hit the Action Key twice to select the
+ klink to some other outline cell; press the Action Key twice to select the
link referent cell;
(4) anywhere else, invoke `action-key-eol-function', typically to scroll up
a windowful."
@@ -2180,7 +2167,7 @@ If assist-key is pressed:
each cell in tree beginning at point;
(3) between cells or within the read-only indentation region to the left of
a cell, then move point to prior location and prompt to move one tree to
- a new location in the outline; hit the Action Key twice to select the
+ a new location in the outline; press the Action Key twice to select the
tree to move and where to move it;
(4) anywhere else, invoke `assist-key-eol-function', typically to scroll down
a windowful."
@@ -2737,7 +2724,8 @@ With optional prefix ARG, toggle display of blank lines between cells."
(kview:set-attr kview 'lines-to-show 0)
(outline-flag-region (point-min) (point-max) nil)
(if arg (kvspec:toggle-blank-lines))
- (kvspec:update t))))
+ (if (called-interactively-p 'interactive)
+ (kvspec:update t)))))
;;;###autoload
(defun kotl-mode:top-cells (&optional arg)
diff --git a/kotl/kproperty.el b/kotl/kproperty.el
index 134e737..3734548 100644
--- a/kotl/kproperty.el
+++ b/kotl/kproperty.el
@@ -4,7 +4,7 @@
;;
;; Orig-Date: 7/27/93
;;
-;; Copyright (C) 1993-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1993-2019 Free Software Foundation, Inc.
;; See the "../HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
diff --git a/kotl/kview.el b/kotl/kview.el
index 14954a4..ff0ddf9 100644
--- a/kotl/kview.el
+++ b/kotl/kview.el
@@ -4,7 +4,7 @@
;;
;; Orig-Date: 6/30/93
;;
-;; Copyright (C) 1993-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1993-2019 Free Software Foundation, Inc.
;; See the "../HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
@@ -689,43 +689,25 @@ the lines displayed, since it has hidden branches."
(save-excursion (and (kcell-view:next nil label-sep-len)
(kcell-view:invisible-p (point) label-sep-len))))
-(cond ((not (featurep 'xemacs))
- (defun kview:goto-cell-id (id-string)
- "Move point to start of cell with idstamp ID-STRING and return t, else nil."
- (let ((cell-id (string-to-number id-string))
- (opoint (point))
- pos kcell)
- (goto-char (point-min))
- (while (and (setq pos (kproperty:next-single-change (point) 'kcell))
- (goto-char pos)
- (or (null (setq kcell (kproperty:get pos 'kcell)))
- (/= (kcell:idstamp kcell) cell-id))
- ;; Skip to the end of this kcell property
- (setq pos (kproperty:next-single-change (point) 'kcell))
- (goto-char pos)))
- (if pos
- (progn
- (forward-char (kview:label-separator-length kview))
- t)
- (goto-char opoint)
- nil))))
- ;;
- ;; XEmacs
- (t (defun kview:goto-cell-id (id-string)
- "Move point to start of cell with idstamp ID-STRING and return t, else nil."
- (let ((cell-id (string-to-number id-string))
- label-end kcell)
- (setq label-end
- (map-extents
- (lambda (extent _)
- (setq kcell (extent-property extent 'kcell))
- (and kcell (= (kcell:idstamp kcell) cell-id)
- (extent-end-position extent)))
- nil nil nil nil nil 'kcell))
- (if (null label-end)
- nil
- (goto-char label-end)
- t)))))
+(defun kview:goto-cell-id (id-string)
+ "Move point to start of cell with idstamp ID-STRING and return t, else nil."
+ (let ((cell-id (string-to-number id-string))
+ (opoint (point))
+ pos kcell)
+ (goto-char (point-min))
+ (while (and (setq pos (kproperty:next-single-change (point) 'kcell))
+ (goto-char pos)
+ (or (null (setq kcell (kproperty:get pos 'kcell)))
+ (/= (kcell:idstamp kcell) cell-id))
+ ;; Skip to the end of this kcell property
+ (setq pos (kproperty:next-single-change (point) 'kcell))
+ (goto-char pos)))
+ (if pos
+ (progn
+ (forward-char (kview:label-separator-length kview))
+ t)
+ (goto-char opoint)
+ nil)))
(defun kview:id-counter (kview)
"Return the highest current idstamp (an integer) used by KVIEW."
diff --git a/kotl/kvspec.el b/kotl/kvspec.el
index a9e5354..d6c111d 100644
--- a/kotl/kvspec.el
+++ b/kotl/kvspec.el
@@ -4,7 +4,7 @@
;;
;; Orig-Date: 21-Oct-95 at 15:17:07
;;
-;; Copyright (C) 1995-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2019 Free Software Foundation, Inc.
;; See the "../HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
@@ -116,16 +116,15 @@ display all levels of cells."
(kview:set-attr kview 'levels-to-show levels-to-keep))
(defun kvspec:show-lines-per-cell (num)
- "Show NUM lines per cell."
+ "Show NUM lines per visible cell; 0 means show all lines in each visible cell."
(if (or (not (integerp num)) (< num 0))
(error "(kvspec:show-lines-per-cell): Invalid lines per cell, `%d'" num))
(kview:set-attr kview 'lines-to-show num)
- (if (not (zerop num))
- ;; Now show NUM lines in cells.
- (kview:map-tree (lambda (_kview)
- (kcell-view:expand (point))
- (kvspec:show-lines-this-cell num))
- kview t t)))
+ ;; Now show NUM lines in cells.
+ (kview:map-tree (lambda (_kview)
+ (kcell-view:expand (point))
+ (kvspec:show-lines-this-cell num))
+ kview t t))
(defun kvspec:toggle-blank-lines ()
"Toggle blank lines between cells on or off."
@@ -251,32 +250,25 @@ characters at run-time.")
;; "l" means use value of kview:default-levels-to-show.
;; "l0" means show all levels.
(let (levels)
- (if (not (string-match "l\\([0-9]+\\)?" kvspec:current))
- ;; Don't change the view if no view spec is given but note that
- ;; all levels should be shown in the future.
- (kview:set-attr kview 'levels-to-show 0)
- (if (match-beginning 1)
- (setq levels (string-to-number (match-string 1 kvspec:current)))
- (setq levels kview:default-levels-to-show))
- (kvspec:levels-to-show levels))))
+ (if (and (string-match "l\\([0-9]+\\)?" kvspec:current)
+ (match-beginning 1))
+ (setq levels (string-to-number (match-string 1 kvspec:current)))
+ (setq levels kview:default-levels-to-show))
+ (kvspec:levels-to-show levels)))
(defun kvspec:lines-to-show ()
"Show a set number of lines per cell according to `kvspec:current'."
- ;; "c" means use value of kview:default-lines-to-show.
+ ;; "c" or no "c" means use value of kview:default-lines-to-show.
;; "c0" means show all lines.
- (cond ((not (string-match "c\\([0-9]+\\)?" kvspec:current))
- ;; Don't change the view if no view spec is given but note that all
- ;; lines should be shown in the future.
- (kview:set-attr kview 'lines-to-show 0))
- ((match-beginning 1)
- (kvspec:show-lines-per-cell
- (string-to-number (match-string 1 kvspec:current))))
- (t (kvspec:show-lines-per-cell kview:default-lines-to-show))))
+ (if (and (string-match "c\\([0-9]+\\)?" kvspec:current)
+ (match-beginning 1))
+ (kvspec:show-lines-per-cell
+ (string-to-number (match-string 1 kvspec:current)))
+ (kvspec:show-lines-per-cell kview:default-lines-to-show)))
(defun kvspec:numbering ()
"Set the type of numbering (label) display according to `kvspec:current'."
- (if (not (string-match "n\\([.*~0-2]\\)?" kvspec:current))
- nil
+ (when (string-match "n\\([.*~0-2]\\)?" kvspec:current)
;; "n" means use value of kview:default-label-type.
;; "n0" means display idstamps.
;; "n1" means display alpha labels.
@@ -286,23 +278,22 @@ characters at run-time.")
;; "n~" means no labels.
(let (spec type)
(if (match-beginning 1)
- (setq spec (string-to-char
- (substring kvspec:current
- (match-beginning 1) (match-end 1)))
+ (setq spec (string-to-char (match-string 1 kvspec:current))
type (cdr (assq spec kvspec:label-type-alist)))
(setq type kview:default-label-type))
(kview:set-label-type kview type))))
(defun kvspec:show-lines-this-cell (num)
"Assume the current cell is fully expanded and collapse to show NUM lines within it.
-If NUM is greater than the number of lines available, the cell remains fully expanded."
+If NUM is less than 1 or greater than the number of lines available, the cell remains fully expanded."
;; Use free variable label-sep-len bound in kview:map-* for speed.
- (defvar label-sep-len)
- (goto-char (kcell-view:start (point) label-sep-len))
- (let ((end (kcell-view:end-contents)))
- ;; Hide all but num lines of the cell.
- (and (> num 0) (search-forward "\n" end t num)
- (outline-flag-region (1- (point)) end t))))
+ (unless (< num 1)
+ (defvar label-sep-len)
+ (goto-char (kcell-view:start (point) label-sep-len))
+ (let ((end (kcell-view:end-contents)))
+ ;; Hide all but num lines of the cell.
+ (and (search-forward "\n" end t num)
+ (outline-flag-region (1- (point)) end t)))))
(defun kvspec:update-modeline ()
"Setup or update display of the current kview spec in the modeline."
@@ -315,19 +306,7 @@ If NUM is greater than the number of lines available, the cell remains fully exp
(memq 'modeline-buffer-identification
mode-line-format))))
(if elt
- (setcdr elt (cons 'kvspec:string (cdr elt)))
- ;;
- ;; XEmacs 19.14 introduced extents into the modeline that we
- ;; must work around. Assume any XEmacs is at least that new.
- (if (featurep 'xemacs)
- (let ((mf modeline-format)
- elt)
- (while mf
- (setq elt (car mf))
- (if (and (consp elt) (eq (cdr elt) 'modeline-buffer-identification))
- (progn (setcdr mf (cons 'kvspec:string (cdr mf)))
- (setq mf nil)))
- (setq mf (cdr mf)))))))))
+ (setcdr elt (cons 'kvspec:string (cdr elt)))))))
(defun kvspec:update-view ()
"Update view according to current setting of local `kvspec:current' variable."