A lot of 3rd-party code uses `move-beginning-of-line' and
`move-end-of-line'. (org-mode in particular, which I'm working on.)
So I've created a new file in xemacs-base to define them. Will push
Thursday if nobody objects.
fsf-compat package:
2013-12-03 Michael Sperber <mike(a)xemacs.org>
* timer.el (timer-activate-when-idle): Only call `activate-timer'
on non-active-timers.
xemacs-base package:
2013-12-03 Michael Sperber <mike(a)xemacs.org>
* simple-more.el:
(move-beginning-of-line, move-end-of-line): New file, with some
FSF functions.
* field.el (field): Add a provide, needed for simple-more.el.
--
Regards,
Mike
diff --git a/timer.el b/timer.el
--- a/timer.el
+++ b/timer.el
@@ -114,7 +114,8 @@
"Arrange to activate TIMER whenever Emacs is next idle.
DONT-WAIT is for Emacs compatibility and is currently ignored."
(set-itimer-is-idle timer t)
- (activate-itimer timer))
+ (if (not (itimer-live-p timer))
+ (activate-itimer timer)))
;; can't do this, different kind of timer
;;(defalias 'disable-timeout 'cancel-timer)
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@
chistory.elc comint.elc comint-xemacs.elc compile.elc debug.elc \
easy-mmode.elc ebuff-menu.elc echistory.elc ehelp.elc edmacro.elc \
electric.elc enriched.elc env.elc facemenu.elc ffap.elc field.elc \
- file-util.elc subr-more.elc \
+ file-util.elc subr-more.elc simple-more.elc \
helper.elc imenu.elc iso-syntax.elc macros.elc novice.elc outline.elc \
passwd.elc pp.elc regexp-opt.elc regi.elc ring.elc shell.elc \
skeleton.elc sort.elc thing.elc time-stamp.elc timer-funcs.elc \
diff --git a/compile.el b/compile.el
--- a/compile.el
+++ b/compile.el
@@ -153,6 +153,7 @@
nil))
compilation-error-regexp-alist-alist))))
+;;;###autoload
(defvar compilation-error-regexp-alist-alist
'(
;; NOTE! See also grep-regexp-alist, below.
diff --git a/field.el b/field.el
--- a/field.el
+++ b/field.el
@@ -59,6 +59,8 @@
;;; Code:
+(provide 'field)
+
(defgroup field nil
"Text fields."
:group 'editing)
diff --git a/simple-more.el b/simple-more.el
new file mode 100644
--- /dev/null
+++ b/simple-more.el
@@ -0,0 +1,103 @@
+;;; subr-more.el --- Complement the basic editing commands for XEmacs
+
+;; Copyright (C) 1985-1987, 1993-2012 Free Software Foundation, Inc.
+
+;; Maintainer: XEmacs Development Team
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+(require 'field)
+
+;;;###autoload
+(defun move-beginning-of-line (arg)
+ "Move point to beginning of current line as displayed.
+\(If there's an image in the line, this disregards newlines
+which are part of the text that the image rests on.)
+
+With argument ARG not nil or 1, move forward ARG - 1 lines first.
+If point reaches the beginning or end of buffer, it stops there.
+To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
+ (interactive "p")
+ (or arg (setq arg 1))
+
+ (let ((orig (point))
+ first-vis first-vis-field-value)
+
+ ;; Move by lines, if ARG is not 1 (the default).
+ (if (/= arg 1)
+ (line-move (1- arg)))
+
+ ;; Move to beginning-of-line, ignoring fields and invisible text.
+ (skip-chars-backward "^\n")
+ (let (invisible-extent)
+ (while (and (not (bobp)) (setq invisible-extent (extent-at (1- (point)) nil
'invisible)))
+ (goto-char (extent-end-position (previous-extent invisible-extent)))
+ (skip-chars-backward "^\n"))
+
+ ;; Now find first visible char in the line
+ (while (and (not (eobp)) (setq invisible-extent (extent-at (point) nil
'invisible)))
+ (goto-char (extent-start-position (next-extent invisible-extent))))
+ (setq first-vis (point)))
+
+ ;; See if fields would stop us from reaching FIRST-VIS.
+ (setq first-vis-field-value
+ (constrain-to-field first-vis orig (/= arg 1) t nil))
+
+ (goto-char (if (/= first-vis-field-value first-vis)
+ ;; If yes, obey them.
+ first-vis-field-value
+ ;; Otherwise, move to START with attention to fields.
+ ;; (It is possible that fields never matter in this case.)
+ (constrain-to-field (point) orig
+ (/= arg 1) t nil)))))
+
+
+;;;###autoload
+(defun move-end-of-line (arg)
+ "Move point to end of current line as displayed.
+With argument ARG not nil or 1, move forward ARG - 1 lines first.
+If point reaches the beginning or end of buffer, it stops there."
+ (interactive "p")
+ (or arg (setq arg 1))
+ (let (done)
+ (while (not done)
+ (let ((newpos
+ (save-excursion
+ (let ((goal-column 0))
+ (and (line-move arg)
+ ;; With bidi reordering, we may not be at bol,
+ ;; so make sure we are.
+ (skip-chars-backward "^\n")
+ (not (bobp))
+ (let (invisible-extent)
+ (while (and (not (bobp)) (setq invisible-extent (extent-at (1- (point)) nil
'invisible)))
+ (goto-char (extent-end-position (previous-extent invisible-extent))))
+ (backward-char 1)))
+ (point)))))
+ (goto-char newpos)
+ (if (and (> (point) newpos)
+ (eq (preceding-char) ?\n))
+ (backward-char 1)
+ (if (and (> (point) newpos) (not (eobp))
+ (not (eq (following-char) ?\n)))
+ ;; If we skipped something intangible and now we're not
+ ;; really at eol, keep going.
+ (setq arg 1)
+ (setq done t)))))))
+
+;;; simple-more.el ends here
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches