diff options
| author | David Aspinall | 2003-03-14 10:49:10 +0000 |
|---|---|---|
| committer | David Aspinall | 2003-03-14 10:49:10 +0000 |
| commit | d08a6fb7ed2b8aa52b4c7771a5184899e74689dc (patch) | |
| tree | b703975708b16fc8ef07155067353a7214da9197 | |
| parent | 61d58c7d4511cfff02f9551f48820fc6fde6ecbc (diff) | |
Updated version sent sent by CW
| -rw-r--r-- | x-symbol/lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | x-symbol/lisp/auto-autoloads.el | 4 | ||||
| -rw-r--r-- | x-symbol/lisp/x-symbol-hooks.el | 94 | ||||
| -rw-r--r-- | x-symbol/lisp/x-symbol-vars.el | 20 | ||||
| -rw-r--r-- | x-symbol/lisp/x-symbol.el | 97 |
5 files changed, 114 insertions, 111 deletions
diff --git a/x-symbol/lisp/ChangeLog b/x-symbol/lisp/ChangeLog index 61124e23..1d3d95b0 100644 --- a/x-symbol/lisp/ChangeLog +++ b/x-symbol/lisp/ChangeLog @@ -1,13 +1,17 @@ -2003-03-04 Christoph Wedler <wedler@users.sourceforge.net> +2003-03-06 Christoph Wedler <wedler@users.sourceforge.net> + * Bug fix: would not hightlight subscripts when using + font-lock without any font-lock support mode if X-Symbol + is turned on the first time, but not automatically. * Bug fix, Emacs: would still not work with package crypt/crypt++. + * Bug fix, XEmacs: using C-s = isearch would not always + reveal the full subscript command when necessary. * Make |- and |= electric. * Provide unzipped PDF and PS version of manual on web. * Manual, docstring and Makefile updates. - Report from Felix E. Klee. Suggestion from Gerwin - Klein. + Report from Felix E. Klee, Gerwin Klein. 2003-01-18 Christoph Wedler <wedler@users.sourceforge.net> diff --git a/x-symbol/lisp/auto-autoloads.el b/x-symbol/lisp/auto-autoloads.el index f7b76688..11e61782 100644 --- a/x-symbol/lisp/auto-autoloads.el +++ b/x-symbol/lisp/auto-autoloads.el @@ -130,7 +130,7 @@ VAR's options has been defined with `x-symbol-define-user-options'." nil nil) ;;;*** -;;;### (autoloads (x-symbol-init-input x-symbol-rotate-key x-symbol-modify-key x-symbol-grid x-symbol-read-language x-symbol-init-language-interactive x-symbol-mode-internal x-symbol-auto-8bit-search x-symbol-auto-coding-alist x-symbol-unalias x-symbol-encode x-symbol-encode-recode x-symbol-decode x-symbol-decode-recode x-symbol-encode-all x-symbol-decode-single-token x-symbol-decode-all x-symbol-decode-region x-symbol-package-reply-to-report x-symbol-package-bug x-symbol-package-info x-symbol-package-web x-symbol-translate-to-ascii) "x-symbol" "lisp/x-symbol.el") +;;;### (autoloads (x-symbol-init-input x-symbol-rotate-key x-symbol-modify-key x-symbol-grid x-symbol-read-language x-symbol-init-language-interactive x-symbol-mode-internal x-symbol-auto-8bit-search x-symbol-auto-coding-alist x-symbol-unalias x-symbol-encode x-symbol-encode-recode x-symbol-decode x-symbol-decode-recode x-symbol-encode-all x-symbol-encode-string x-symbol-decode-single-token x-symbol-decode-all x-symbol-decode-region x-symbol-package-reply-to-report x-symbol-package-bug x-symbol-package-info x-symbol-package-web x-symbol-translate-to-ascii) "x-symbol" "lisp/x-symbol.el") (autoload 'x-symbol-translate-to-ascii "x-symbol" "\ Translate STRING to an ascii string. @@ -178,6 +178,8 @@ which defaults to `x-symbol-exec-threshold'. Before decoding, decode (autoload 'x-symbol-decode-single-token "x-symbol" nil nil nil) +(autoload 'x-symbol-encode-string "x-symbol" nil nil nil) + (autoload 'x-symbol-encode-all "x-symbol" "\ Encode all characters in buffer to tokens. Use executables for decoding if buffer is larger than EXEC-THRESHOLD diff --git a/x-symbol/lisp/x-symbol-hooks.el b/x-symbol/lisp/x-symbol-hooks.el index c406b5b1..41540816 100644 --- a/x-symbol/lisp/x-symbol-hooks.el +++ b/x-symbol/lisp/x-symbol-hooks.el @@ -291,16 +291,18 @@ Use \"locale -ck code_set_name charmap\" and search for the value of (t (warn "X-Symbol: cannot deduce default encoding, I'll assume `iso-8859-1'") 'iso-8859-1)) - "Coding used for 8bit characters in buffers. -Also used for a 8bit file codings where `x-symbol-coding' has value nil. -Supported values are `iso-8859-1', `iso-8859-2', `iso-8859-3' and -`iso-8859-9', it should correspond to the normal charset registry of -your `default' face. + "Default coding used for 8bit characters in buffers. +Supported values are `iso-8859-1', `iso-8859-2', `iso-8859-3', +`iso-8859-9', `iso-8859-15', and nil. Value nil is the same as +`iso-8859-1', while disabling some uses of `x-symbol-coding'. + +Without Mule support, the value determines the coding in all buffers +with value nil for `x-symbol-coding'. With Mule support, Emacs +recognizes the coding itself. -WARNING: Under XEmacs/Mule, package x-symbol is only tested with value -`iso-8859-1'! It is assumed that you have not changed any of the -various Mule codings-system variables, i.e., it assumes iso-8859-1. Use -\\[x-symbol-package-bug] to give the author some advice on Mule.") +This value is also used to determine the canoncial character if a +character is supported by various latin charsets, see +\\[x-symbol-unalias].") (unless (or (memq x-symbol-default-coding '(nil iso-8859-1 iso-8859-2 iso-8859-3 iso-8859-9)) @@ -796,7 +798,8 @@ If argument INIT is non-nil, the old mode status is assumed to be off." (x-symbol-auto-set-variable 'x-symbol-coding (cadr style)) (or (local-variable-p 'x-symbol-8bits (current-buffer)) (setq x-symbol-8bits (or (eval (caddr style)) - (x-symbol-auto-8bit-search)) + (x-symbol-auto-8bit-search + x-symbol-auto-8bit-search-limit)) ;; use value `null' to disable 8bit char search x-symbol-8bits (and (not (eq x-symbol-8bits 'null)) x-symbol-8bits))) @@ -858,29 +861,16 @@ Call `x-symbol-mode' with a cons for ARG and a non-nil INIT. Used in "Decode output of comint's process. Used as value in `comint-output-filter-functions'." (and x-symbol-mode x-symbol-language - (save-excursion - (x-symbol-decode-region (if (interactive-p) - comint-last-input-end - comint-last-output-start) - (process-mark (get-buffer-process - (current-buffer))))))) + (x-symbol-decode-region + (if (interactive-p) comint-last-input-end comint-last-output-start) + (process-mark (get-buffer-process (current-buffer)))))) (defun x-symbol-comint-send (proc string) "Encode STRING and send it to process PROC. Used as value of `comint-input-sender', uses `x-symbol-orig-comint-input-sender'." (and x-symbol-mode x-symbol-language - (setq string - (save-excursion - (let ((orig-buffer (current-buffer)) - (selective selective-display)) - (set-buffer (get-buffer-create " x-symbol comint")) - (erase-buffer) - (insert string) - (x-symbol-inherit-from-buffer orig-buffer) - (x-symbol-encode-all) - (setq selective-display selective)) - (buffer-string)))) + (setq string (x-symbol-encode-string string (current-buffer)))) (funcall x-symbol-orig-comint-input-sender proc string)) @@ -1009,30 +999,32 @@ value other than nil or `fast'. Refontifies buffer if (lambda () (x-symbol-encode-all) (continue-save-buffer))) - (let ((buffer-undo-list nil) - ;; Kludge to prevent undo list truncation: - (undo-limit most-positive-fixnum) ; Emacs - (undo-strong-limit most-positive-fixnum) ; Emacs - (undo-high-threshold -1) ; XEmacs - (undo-threshold -1)) ; XEmacs - (unwind-protect - (let ((file-hooks (cdr (memq 'x-symbol-write-file-hook - (default-value - 'write-file-hooks)))) - setmodes) - (x-symbol-encode-all) - (or (run-hook-with-args-until-success 'file-hooks) - (setq setmodes (basic-save-buffer-1))) - ;; See `basic-save-buffer'. TODO: do I also have to set the - ;; coding system and `buffer-file-number'? - (if setmodes - (condition-case () - (set-file-modes buffer-file-name setmodes) - (error nil)))) - (let ((tail buffer-undo-list)) - (setq buffer-undo-list t) - (while tail - (setq tail (primitive-undo (length tail) tail))))))) + ;; not called inside `save-excursion' in Emacs >= 20.3 + (save-excursion + (let ((buffer-undo-list nil) + ;; Kludge to prevent undo list truncation: + (undo-limit most-positive-fixnum) ; Emacs + (undo-strong-limit most-positive-fixnum) ; Emacs + (undo-high-threshold -1) ; XEmacs + (undo-threshold -1)) ; XEmacs + (unwind-protect + (let ((file-hooks (cdr (memq 'x-symbol-write-file-hook + (default-value + 'write-file-hooks)))) + setmodes) + (x-symbol-encode-all) + (or (run-hook-with-args-until-success 'file-hooks) + (setq setmodes (basic-save-buffer-1))) + ;; See `basic-save-buffer'. TODO: do I also have to set the + ;; coding system and `buffer-file-number'? + (if setmodes + (condition-case () + (set-file-modes buffer-file-name setmodes) + (error nil)))) + (let ((tail buffer-undo-list)) + (setq buffer-undo-list t) + (while tail + (setq tail (primitive-undo (length tail) tail)))))))) (and (eq x-symbol-auto-conversion-method 'slowest) font-lock-mode (x-symbol-fontify)) diff --git a/x-symbol/lisp/x-symbol-vars.el b/x-symbol/lisp/x-symbol-vars.el index af34dd80..fae76fb1 100644 --- a/x-symbol/lisp/x-symbol-vars.el +++ b/x-symbol/lisp/x-symbol-vars.el @@ -37,7 +37,7 @@ (require 'x-symbol-hooks) (eval-when-compile (require 'cl)) -(defconst x-symbol-version "4.5" +(defconst x-symbol-version "4.4.5g" "Current development version of package X-Symbol. Check <http://x-symbol.sourceforge.net/> for the newest.") @@ -169,19 +169,19 @@ A value of such a language access looks like If `x-symbol-mode' is not already buffer-local, MODE-ON determines whether to turn the mode on if \\[x-symbol-mode] is called with a cons -as prefix argument. LANGUAGE, CODING, 8BITS, UNIQUE, SUBSCRIPTS and -IMAGE are used to set `x-symbol-language', `x-symbol-coding', -`x-symbol-8bits', `x-symbol-unique', `x-symbol-subscripts' and -`x-symbol-image' if these values are not already buffer-local. +as prefix argument. CODING, 8BITS, UNIQUE, SUBSCRIPTS and IMAGE are +used to set `x-symbol-coding', `x-symbol-8bits', `x-symbol-unique', +`x-symbol-subscripts' and `x-symbol-image' if these values are not +already buffer-local. During evaluation, a non-nil `buffer-file-name' is sans backup versions or strings, and without suffixes in `x-symbol-auto-mode-suffixes', and `x-symbol-mode' is bound to the `eval'ed MODE-ON. Then, the above -mentioned variables are set to the `eval'ed LANGUAGE, CODING, 8BITS, -UNIQUE, SUBSCRIPTS and IMAGE in that order, if the variables is not -already buffer-local. If CODING evaluates to nil, `x-symbol-coding' is -set according to `x-symbol-auto-8bit-search-limit', if CODING evaluates -to `null', `x-symbol-coding' is set to nil. +mentioned variables are set to the `eval'ed CODING, 8BITS, UNIQUE, +SUBSCRIPTS and IMAGE in that order, if the variables is not already +buffer-local. If CODING evaluates to nil, `x-symbol-coding' is set +according to `x-symbol-auto-8bit-search-limit', if CODING evaluates to +`null', `x-symbol-coding' is set to nil. Users might prefer to customize `x-symbol-auto-style-alist' instead.") diff --git a/x-symbol/lisp/x-symbol.el b/x-symbol/lisp/x-symbol.el index 81ca45be..4abb96dd 100644 --- a/x-symbol/lisp/x-symbol.el +++ b/x-symbol/lisp/x-symbol.el @@ -776,12 +776,13 @@ er, I have actually deleted it.") "Decode all tokens between BEG and END. Make sure that X-Symbol characters are correctly displayed under XEmacs/no-Mule even when font-lock is disabled." - (save-restriction - (narrow-to-region beg end) - (x-symbol-decode-all) - ;; Is the following really necessary? Anyway, it doesn't hurt... - (unless (featurep 'mule) (x-symbol-nomule-fontify-cstrings)) - )) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (x-symbol-decode-all) + ;; Is the following really necessary? Anyway, it doesn't hurt... + (unless (featurep 'mule) (x-symbol-nomule-fontify-cstrings)) + (point-max)))) ;;;###autoload (defun x-symbol-decode-all () @@ -888,6 +889,17 @@ which defaults to `x-symbol-exec-threshold'. Before decoding, decode (delete-region beg end)))))) ;;;###autoload +(defun x-symbol-encode-string (string buffer) + (save-excursion + (set-buffer (get-buffer-create " x-symbol string conversion")) + (erase-buffer) + (insert string) + (x-symbol-inherit-from-buffer buffer) + ;;(setq x-symbol-mode t) ; not needed + (x-symbol-encode-all) + (buffer-string))) + +;;;###autoload (defun x-symbol-encode-all (&optional buffer start end) "Encode all characters in buffer to tokens. Use executables for decoding if buffer is larger than EXEC-THRESHOLD @@ -1245,9 +1257,7 @@ where KEY is equal to the MATCH'th regexp group of the match." ;; TODO: quick hack ;;;###autoload -(defun x-symbol-auto-8bit-search (&optional limit) - (or limit (setq limit x-symbol-auto-8bit-search-limit)) - (if (eq limit 'point-max) (setq limit nil)) +(defun x-symbol-auto-8bit-search (limit) (let ((cs (if (featurep 'mule) (cdr (assq (x-symbol-buffer-coding) '((iso-8859-1 . latin-iso8859-1) @@ -1419,7 +1429,7 @@ command `x-symbol-mode' for details." ; valid coding and buffer-fc = default (assq x-symbol-coding x-symbol-fchar-tables)) (setq x-symbol-8bits - (x-symbol-auto-8bit-search 'point-max))) + (x-symbol-auto-8bit-search nil))) (setq x-symbol-8bits nil)) (x-symbol-decode-all)) (x-symbol-encode-all)) @@ -2019,21 +2029,21 @@ the execution of the command. E.g., `forward-char' uses `1+'." (> (caddr x-symbol-invisible-spec) pos)))) (when (buffer-live-p (car x-symbol-invisible-spec)) (x-symbol-ignore-property-changes - (if (eq x-symbol-font-lock-with-extra-props 'invisible) - (progn - (put-text-property (cadr x-symbol-invisible-spec) - (caddr x-symbol-invisible-spec) - 'invisible 'hide) - (unless (eq this-command 'eval-expression) - (setq x-symbol-trace-invisible - (text-properties-at (cadr x-symbol-invisible-spec))))) - (funcall (if (consp (cdddr x-symbol-invisible-spec)) - 'put-text-property - 'put-nonduplicable-text-property) - (cadr x-symbol-invisible-spec) - (caddr x-symbol-invisible-spec) - 'face (cdddr x-symbol-invisible-spec) - (car x-symbol-invisible-spec)))) + (if (eq x-symbol-font-lock-with-extra-props 'invisible) + (progn + (put-text-property (cadr x-symbol-invisible-spec) + (caddr x-symbol-invisible-spec) + 'invisible 'hide) + (unless (eq this-command 'eval-expression) + (setq x-symbol-trace-invisible + (text-properties-at (cadr x-symbol-invisible-spec))))) + (funcall (if (consp (cdddr x-symbol-invisible-spec)) + 'put-text-property + 'put-nonduplicable-text-property) + (cadr x-symbol-invisible-spec) + (caddr x-symbol-invisible-spec) + 'face (cdddr x-symbol-invisible-spec) + (car x-symbol-invisible-spec)))) (setq x-symbol-invisible-spec nil))))) (defun x-symbol-reveal-invisible (after before) @@ -2046,31 +2056,26 @@ with `x-symbol-hide-revealed-at-point'." (iface (if (eq x-symbol-font-lock-with-extra-props 'invisible) 'x-symbol-revealed-face 'x-symbol-invisible-face))) - (when (setq x-symbol-invisible-spec - (or (if (consp faces) - (memq iface faces) - (eq faces iface)) - (and (eq x-symbol-reveal-invisible t) - (setq after before) - (setq faces (get-text-property after 'face)) - (if (consp faces) - (memq iface faces) - (eq faces iface))))) + (setq x-symbol-invisible-spec nil) ; safety (should be precondition) + (when (or (if (consp faces) (memq iface faces) (eq faces iface)) + (and (eq x-symbol-reveal-invisible t) + (setq after before) + (setq faces (get-text-property after 'face)) + (if (consp faces) (memq iface faces) (eq faces iface)))) (let ((start (previous-single-property-change (1+ after) 'face nil (point-at-bol))) - (when (featurep 'xemacs) - ;; `isearch-secondary' face would induce a prop change - (unless (eq x-symbol-font-lock-with-extra-props 'invisible) ; safety - (let (faces2 start2) - (while (and (setq faces2 (get-text-property (1- start) 'face)) - (if (consp faces2) - (memq iface faces2) - (eq faces2 iface)) - (setq start2 (previous-single-property-change - start 'face nil (point-at-bol)))) - (setq start start2))))) (end (next-single-property-change after 'face nil (point-at-eol)))) + (when (featurep 'xemacs) + ;; `isearch-secondary' face would induce a prop change + (unless (eq x-symbol-font-lock-with-extra-props 'invisible) ; safety + (let (faces2 start2) + (while + (and (setq faces2 (get-text-property (1- start) 'face)) + (if (consp faces2) (memq iface faces2) (eq faces2 iface)) + (setq start2 (previous-single-property-change + start 'face nil (point-at-bol)))) + (setq start start2))))) (setq x-symbol-invisible-spec (list* (current-buffer) start end faces)) (x-symbol-ignore-property-changes |
