3 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/1d6995b6986e/
changeset: 1d6995b6986e
user: sperber
date: 2013-02-20 11:09:08
summary: Add and use `font-lock-extend-region-functions'.
2013-02-20 Michael Sperber <mike(a)xemacs.org>
* font-lock.el (font-lock-beg)
(font-lock-extend-region-functions)
(font-lock-extend-region-multiline)
(font-lock-extend-region-wholelines)
(font-lock-default-fontify-region): Add and use
`font-lock-extend-region-functions' from GNU Emacs.
affected #: 2 files
diff -r e32ce9c59c23cbeed381b4248642720749aef344 -r
1d6995b6986e282d45a376b0848a174757aac791 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
+2013-02-20 Michael Sperber <mike(a)xemacs.org>
+
+ * font-lock.el (font-lock-beg)
+ (font-lock-extend-region-functions)
+ (font-lock-extend-region-multiline)
+ (font-lock-extend-region-wholelines)
+ (font-lock-default-fontify-region): Add and use
+ `font-lock-extend-region-functions' from GNU Emacs.
+
2013-02-08 Michael Sperber <mike(a)xemacs.org>
* font-lock.el (font-lock-set-defaults-1):
diff -r e32ce9c59c23cbeed381b4248642720749aef344 -r
1d6995b6986e282d45a376b0848a174757aac791 lisp/font-lock.el
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1371,6 +1371,61 @@
(font-lock-unfontify-region (point-min) (point-max))
(set (make-local-variable 'font-lock-fontified) nil))
+(defvar font-lock-beg) (defvar font-lock-end)
+(defvar font-lock-extend-region-functions
+ '(font-lock-extend-region-wholelines
+ ;; This use of font-lock-multiline property is unreliable but is just
+ ;; a handy heuristic: in case you don't have a function that does
+ ;; /identification/ of multiline elements, you may still occasionally
+ ;; discover them by accident (or you may /identify/ them but not in all
+ ;; cases), in which case the font-lock-multiline property can help make
+ ;; sure you will properly *re*identify them during refontification.
+ font-lock-extend-region-multiline)
+ "Special hook run just before proceeding to fontify a region.
+This is used to allow major modes to help font-lock find safe buffer positions
+as beginning and end of the fontified region. Its most common use is to solve
+the problem of /identification/ of multiline elements by providing a function
+that tries to find such elements and move the boundaries such that they do
+not fall in the middle of one.
+Each function is called with no argument; it is expected to adjust the
+dynamically bound variables `font-lock-beg' and `font-lock-end'; and return
+non-nil if it did make such an adjustment.
+These functions are run in turn repeatedly until they all return nil.
+Put first the functions more likely to cause a change and cheaper to compute.")
+;; Mark it as a special hook which doesn't use any global setting
+;; (i.e. doesn't obey the element t in the buffer-local value).
+(make-variable-buffer-local 'font-lock-extend-region-functions)
+
+(defun font-lock-extend-region-multiline ()
+ "Move fontification boundaries away from any `font-lock-multiline'
property."
+ (let ((changed nil))
+ (when (and (> font-lock-beg (point-min))
+ (get-text-property (1- font-lock-beg) 'font-lock-multiline))
+ (setq changed t)
+ (setq font-lock-beg (or (previous-single-property-change
+ font-lock-beg 'font-lock-multiline)
+ (point-min))))
+ ;;
+ (when (get-text-property font-lock-end 'font-lock-multiline)
+ (setq changed t)
+ (setq font-lock-end (or (text-property-any font-lock-end (point-max)
+ 'font-lock-multiline nil)
+ (point-max))))
+ changed))
+
+(defun font-lock-extend-region-wholelines ()
+ "Move fontification boundaries to beginning of lines."
+ (let ((changed nil))
+ (goto-char font-lock-beg)
+ (unless (bolp)
+ (setq changed t font-lock-beg (line-beginning-position)))
+ (goto-char font-lock-end)
+ (unless (bolp)
+ (unless (eq font-lock-end
+ (setq font-lock-end (line-beginning-position 2)))
+ (setq changed t)))
+ changed))
+
;; This used to be `font-lock-fontify-region', and before that,
;; `font-lock-fontify-region' used to be the name used for what is now
;; `font-lock-fontify-syntactically-region'.
@@ -1383,6 +1438,19 @@
(progn
;; Use the fontification syntax table, if any.
(if font-lock-syntax-table (set-syntax-table font-lock-syntax-table))
+ (let ((funs font-lock-extend-region-functions)
+ (font-lock-beg beg)
+ (font-lock-end end))
+ (while funs
+ (setq funs (if (or (not (funcall (car funs)))
+ (eq funs font-lock-extend-region-functions))
+ (cdr funs)
+ ;; If there's been a change, we should go through
+ ;; the list again since this new position may
+ ;; warrant a different answer from one of the fun
+ ;; we've already seen.
+ font-lock-extend-region-functions)))
+ (setq beg font-lock-beg end font-lock-end))
;; Now do the fontification.
(font-lock-unfontify-region beg end)
(when font-lock-syntactic-keywords
https://bitbucket.org/xemacs/xemacs/commits/cc852bdbdbaa/
changeset: cc852bdbdbaa
user: sperber
date: 2013-02-20 11:15:25
summary: Remove obsolete legacy code in `file-remote-p'.
2013-02-20 Michael Sperber <mike(a)xemacs.org>
* files.el (file-remote-p): Remove an ancient piece of obsolete
legacy code that looks at `efs-ftp-path'.
affected #: 2 files
diff -r 1d6995b6986e282d45a376b0848a174757aac791 -r
cc852bdbdbaab6c6ea04badff35fb8e3c643b704 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-20 Michael Sperber <mike(a)xemacs.org>
+
+ * files.el (file-remote-p): Remove an ancient piece of obsolete
+ legacy code that looks at `efs-ftp-path'.
+
2013-02-20 Michael Sperber <mike(a)xemacs.org>
* font-lock.el (font-lock-beg)
diff -r 1d6995b6986e282d45a376b0848a174757aac791 -r
cc852bdbdbaab6c6ea04badff35fb8e3c643b704 lisp/files.el
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4459,22 +4459,6 @@
(cond
(handler
(funcall handler 'file-remote-p file identification connected))
- ;; legacy code; can probably go by mid-2008
- ((fboundp 'efs-ftp-path)
- (let ((parsed (declare-fboundp (efs-ftp-path file))))
- (and parsed
- (let ((host (nth 0 parsed))
- (user (nth 1 parsed)))
- (and (or (not connected)
- (let ((proc (get-process (declare-fboundp (efs-ftp-process-buffer host user)))))
- (and proc (processp proc)
- (memq (process-status proc) '(run open)))))
- (cond
- ((eq identification 'method) (and parsed "ftp"))
- ((eq identification 'user) user)
- ((eq identification 'host) host)
- (t
- (concat "/" user "@" host ":/"))))))))
(t nil))))
https://bitbucket.org/xemacs/xemacs/commits/fffa15138019/
changeset: fffa15138019
user: sperber
date: 2013-02-22 16:18:37
summary: Don't complain about throws out of `post-command-hook'.
2013-02-22 Michael Sperber <mike(a)xemacs.org>
* event-stream.c (post_command_hook): Don't complain about throws
out of `post-command-hook'. This is quite common, for example to
exit the minibuffer.
affected #: 2 files
diff -r cc852bdbdbaab6c6ea04badff35fb8e3c643b704 -r
fffa151380192308e890528ce556f70a19da6e93 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-22 Michael Sperber <mike(a)xemacs.org>
+
+ * event-stream.c (post_command_hook): Don't complain about throws
+ out of `post-command-hook'. This is quite common, for example to
+ exit the minibuffer.
+
2013-02-04 Vin Shelton <acs(a)xemacs.org>
* syswindows.h: Fix the cygwin build by supporting win32api 3.14
diff -r cc852bdbdbaab6c6ea04badff35fb8e3c643b704 -r
fffa151380192308e890528ce556f70a19da6e93 src/event-stream.c
--- a/src/event-stream.c
+++ b/src/event-stream.c
@@ -4364,7 +4364,7 @@
safe_run_hook_trapping_problems
(Qcommand, Qpost_command_hook,
- 0);
+ NO_INHIBIT_THROWS);
#if 0 /* FSF Emacs */
if (!NILP (current_buffer->mark_active))
Repository URL:
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches