[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: configure permissions (1.2.6) (non-member post) (non-member post)
Katsumi Yamaoka writes:
>Kevin Rodgers wrote:
>> Would you be interested in an Emacs 19 compatibility add-on or a
>> patch, if I can get it to run?
>
>Since I need to read and write Japanese text, I personally won't
>use the plain (no-Mule) Emacs 19.34. But I'm very interested in
>the technical side because I and a few developers maintain
>emacs-w3m work under non-Mule XEmacs (unofficially). Please
>post your work if you could do it. :-)
OK, I've gotten emacs-w3m 1.2.6 to compile cleanly (with only warnings
about w3m-* symbols) and it seems to be working (except for customizing
the coding system variables and the Japanese URLs in w3m-weather.el) on
Emacs 19.34.
To compile emacs-w3m 1.2.6 on Emacs 19.34:
1. Apply the following 4 small patches and save the attached w3m-e19.el
file in the same directory.
2. make ADDITIONAL_LOAD_PATH=../custom
where ../custom is the directory where custom-1.9962 is installed.
To run emacs-w3m 1.2.6 on Emacs 19.34, just make sure the directories
where custom-1.9962 and w3m-1.2.6 are installed are in `load-path'.
Here is a summary of the patches:
* w3m.el: Require w3m-e19 instead of w3m-e20 for Emacs 19.
(w3m-key-binding): Specify `const' widget instead of `other' as
the Lynx-like choice.
* w3mhack.el (w3mhack-examine-modules): Add "w3m-e19.el" to the
version specific modules.
* Makefile (FLAGS): -q is redundant w.r.t. -batch.
* README: custom and regexp-opt are required on Emacs 19 (as
well as Mule 2.3).
Here are the patches, followed by w3m-e19.el:
*** w3m.el.orig Mon Mar 11 21:50:00 2002
--- w3m.el Wed May 29 17:27:44 2002
***************
*** 92,99 ****
(require 'w3m-e21))
((boundp 'MULE)
(require 'w3m-om))
(t
! (require 'w3m-e20))))
(require 'w3m-hist)
(require 'timezone)
--- 92,102 ----
(require 'w3m-e21))
((boundp 'MULE)
(require 'w3m-om))
+ ((and (boundp 'emacs-major-version)
+ (= emacs-major-version 20))
+ (require 'w3m-e20))
(t
! (require 'w3m-e19))))
(require 'w3m-hist)
(require 'timezone)
***************
*** 373,379 ****
:group 'w3m
:type '(choice
(const :tag "Use Info-like key mapping." info)
! (other :tag "Use Lynx-like key mapping." nil)))
(defcustom w3m-use-cygdrive (eq system-type 'windows-nt)
"*If non-nil, use /cygdrive/ rule when expand-file-name."
--- 376,382 ----
:group 'w3m
:type '(choice
(const :tag "Use Info-like key mapping." info)
! (const :tag "Use Lynx-like key mapping." nil)))
(defcustom w3m-use-cygdrive (eq system-type 'windows-nt)
"*If non-nil, use /cygdrive/ rule when expand-file-name."
*** w3mhack.el.orig Tue Feb 26 06:00:42 2002
--- w3mhack.el Wed May 29 16:34:11 2002
***************
*** 56,62 ****
(defun w3mhack-examine-modules ()
"Examine w3m modules should be byte-compile'd."
(let* ((modules (directory-files default-directory nil "^[^#]+\\.el$"))
! (version-specific-modules '("w3m-e20.el" "w3m-e21.el"
"w3m-om.el" "w3m-xmas.el"))
(ignores (delete (cond
((featurep 'xemacs)
--- 56,62 ----
(defun w3mhack-examine-modules ()
"Examine w3m modules should be byte-compile'd."
(let* ((modules (directory-files default-directory nil "^[^#]+\\.el$"))
! (version-specific-modules '("w3m-e19.el" "w3m-e20.el" "w3m-e21.el"
"w3m-om.el" "w3m-xmas.el"))
(ignores (delete (cond
((featurep 'xemacs)
***************
*** 66,74 ****
(push "w3m-fsf.el" version-specific-modules)
"w3m-om.el")
((boundp 'emacs-major-version)
! (if (>= emacs-major-version 21)
! "w3m-e21.el"
! "w3m-e20.el")))
(append version-specific-modules
(list "w3mhack.el"
w3mhack-colon-keywords-file))))
--- 66,76 ----
(push "w3m-fsf.el" version-specific-modules)
"w3m-om.el")
((boundp 'emacs-major-version)
! (cond ((>= emacs-major-version 21)
! "w3m-e21.el")
! ((= emacs-major-version 20)
! "w3m-e20.el")
! (t "w3m-e19.el"))))
(append version-specific-modules
(list "w3mhack.el"
w3mhack-colon-keywords-file))))
*** Makefile.orig Thu May 16 16:50:26 2002
--- Makefile Thu May 30 09:02:03 2002
***************
*** 12,18 ****
EMACS = emacs
! FLAGS = -q -no-site-file -batch -l w3mhack.el $(ADDITIONAL_LOAD_PATH)
PACKAGE = w3m_el
TARBALL = $(PACKAGE)-$(VERSION).tar.gz
--- 12,18 ----
EMACS = emacs
! FLAGS = -no-site-file -batch -l w3mhack.el $(ADDITIONAL_LOAD_PATH)
PACKAGE = w3m_el
TARBALL = $(PACKAGE)-$(VERSION).tar.gz
*** README.orig Mon Mar 11 07:46:50 2002
--- README Wed May 29 16:48:12 2002
***************
*** 30,43 ****
ftp://ftp.m17n.org/pub/mule/apel/
! Also, Emacs-w3m requires "new custom". If you use Mule-2.3, you
! have to install it before installing emacs-w3m. For more detail,
! see README.en distributed with APEL.
! d) Emacs-w3m requires the module regexp-opt.el(c) which might not
! be provided in the old Emacsen (e.g. Mule 2). If you are using
! such versions of Emacs, you have to install the module regexp-
! opt.el(c) before installing emacs-w3m as follows:
% cp attic/regexp-opt.el /usr/local/share/mule/site-lisp
% cd /usr/local/share/mule/site-lisp
--- 30,44 ----
ftp://ftp.m17n.org/pub/mule/apel/
! Also, Emacs-w3m requires "new custom". If you use Emacs 19 or
! Mule-2.3, you have to install it before installing emacs-w3m. For
! more detail, see http://www.dina.kvl.dk/~abraham/custom/ (for
! Emacs 19) or README.en distributed with APEL (for Mule 2-3).
! d) Emacs-w3m requires the module regexp-opt.el(c) which might not be
! provided in the old Emacsen (e.g. Emacs 19 and Mule 2). If you
! are using such versions of Emacs, you have to install the module
! regexp-opt.el(c) before installing emacs-w3m as follows:
% cp attic/regexp-opt.el /usr/local/share/mule/site-lisp
% cd /usr/local/share/mule/site-lisp
;;; w3m-e19.el --- Emacs 19 specific functions for w3m
;;; Commentary:
;; This module provides Emacs 19 specific functions. Visit
;; <URL:http://emacs-w3m.namazu.org/> for more details of emacs-w3m.
;;; Code:
(require 'w3m-fsf)
;; Emacs 19 libraries:
(require 'cl)
;; 3rd party libraries.
(require 'custom) ; Version: 1.9962
(require 'regexp-opt)
;; src/editfns.c
;; (defalias 'save-current-buffer 'save-excursion) ; with-current-buffer
(defmacro save-current-buffer (&rest body)
"Save the current buffer; execute BODY; restore the current buffer.
Executes BODY just like `progn'."
`(save-excursion
,@body))
;; lisp/simple.el
(defmacro with-current-buffer (buffer &rest body)
"Execute the forms in BODY with BUFFER as the current buffer.
The value returned is the value of the last form in BODY.
See also `with-temp-buffer'."
`(save-current-buffer
(set-buffer ,buffer)
,@body))
;; lisp/simple.el
(defmacro with-temp-buffer (&rest body)
"Create a temporary buffer, and evaluate BODY there like `progn'.
See also `with-temp-file' and `with-output-to-string'."
(let ((temp-buffer (make-symbol "temp-buffer")))
`(let ((,temp-buffer
(get-buffer-create (generate-new-buffer-name " *temp*"))))
(unwind-protect
(with-current-buffer ,temp-buffer
,@body)
(and (buffer-name ,temp-buffer)
(kill-buffer ,temp-buffer))))))
;; src/coding.c
(defun coding-system-p (obj)
nil)
;; src/coding.c
(defun decode-coding-string (string coding-system &optional nocopy)
(if nocopy
string
(substring string 0)))
;; src/coding.c
(defun encode-coding-string (string coding-system &optional nocopy)
(if nocopy
string
(substring string 0)))
;; src/fns.c
(defalias 'string-as-multibyte 'identity)
;; src/coding.c
(defun decode-coding-region (start end coding-system)
(- end start))
;; src/coding.c
(defun encode-coding-region (start end coding-system)
(- end start))
;; src/buffer.c
(defalias 'set-buffer-multibyte 'identity)
;; lisp/international/mule.el
(defalias 'set-buffer-file-coding-system 'ignore)
;; lisp/international/mule.el
(defun coding-system-list (&optional base-only)
nil)
;; lisp/international/mule.el
(defun coding-system-category (coding-system)
nil)
;; lisp/international/mule.el
(defun make-char (charset &optional c1 c2)
(or c1 ?\000))
;; lisp/international/mule-util.el
;; (defalias 'detect-coding-with-priority 'ignore)
(defmacro detect-coding-with-priority (from to priority-list)
nil)
;; charset.c
(defun string (&rest characters)
;; (mapconcat 'char-to-string characters "")
(let ((string (make-string (length characters) ?\000))
(c 0))
(while characters
(aset string c (car characters))
(setq characters (cdr characters)
c (1+ c)))
string))
;; src/charset.c
(defun string-width (string)
(length string))
;; src/charset.c
(defun char-width (char)
1)
;; lisp/international/mule-util.el
(defun truncate-string-to-width (str end-column &optional start-column padding)
"Truncate string STR to end at column END-COLUMN.
The optional 3rd arg START-COLUMN, if non-nil, specifies
the starting column; that means to return the characters occupying
columns START-COLUMN ... END-COLUMN of STR.
The optional 4th arg PADDING, if non-nil, specifies a padding character
to add at the end of the result if STR doesn't reach column END-COLUMN,
or if END-COLUMN comes in the middle of a character in STR.
PADDING is also added at the beginning of the result
if column START-COLUMN appears in the middle of a character in STR.
If PADDING is nil, no padding is added in these cases, so
the resulting string may be narrower than END-COLUMN."
(or start-column
(setq start-column 0))
(let ((len (length str))
(idx 0)
(column 0)
(head-padding "") (tail-padding "")
ch last-column last-idx from-idx)
(condition-case nil
(while (< column start-column)
(setq ch (aref str idx)
column (+ column (char-width ch))
idx (1+ idx)))
(args-out-of-range (setq idx len)))
(if (< column start-column)
(if padding (make-string end-column padding) "")
(if (and padding (> column start-column))
(setq head-padding (make-string (- column start-column) padding)))
(setq from-idx idx)
(if (< end-column column)
(setq idx from-idx)
(condition-case nil
(while (< column end-column)
(setq last-column column
last-idx idx
ch (aref str idx)
column (+ column (char-width ch))
idx (1+ idx)))
(args-out-of-range (setq idx len)))
(if (> column end-column)
(setq column last-column idx last-idx))
(if (and padding (< column end-column))
(setq tail-padding (make-string (- end-column column) padding))))
(setq str (substring str from-idx idx))
(if padding
(concat head-padding str tail-padding)
str))))
;; lisp/international/mule-util.el
(defalias 'truncate-string 'truncate-string-to-width)
(make-obsolete 'truncate-string 'truncate-string-to-width)
;; lisp/international/ccl.el
(defmacro define-ccl-program (name ccl-program &optional doc)
nil)
;; lisp/subr.el
(defun split-string (string &optional separators)
"Splits STRING into substrings where there are matches for SEPARATORS.
Each match for SEPARATORS is a splitting point.
The substrings between the splitting points are made into a list
which is returned.
If SEPARATORS is absent, it defaults to \"[ \\f\\t\\n\\r\\v]+\".
If there is match for SEPARATORS at the beginning of STRING, we do not
include a null substring for that. Likewise, if there is a match
at the end of STRING, we don't include a null substring for that."
(let ((rexp (or separators "[ \f\t\n\r\v]+"))
(start 0)
notfirst
(list nil))
(while (and (string-match rexp string
(if (and notfirst
(= start (match-beginning 0))
(< start (length string)))
(1+ start) start))
(< (match-beginning 0) (length string)))
(setq notfirst t)
(or (eq (match-beginning 0) 0)
(and (eq (match-beginning 0) (match-end 0))
(eq (match-beginning 0) start))
(setq list
(cons (substring string start (match-beginning 0))
list)))
(setq start (match-end 0)))
(or (eq start (length string))
(setq list
(cons (substring string start)
list)))
(nreverse list)))
;; lisp/subr.el
(defalias 'read-passwd 'ange-ftp-read-passwd)
;; src/minibuf.c
(defadvice read-string (after
default-value
(prompt &optional initial-input history default-value)
activate)
"Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used
for history commands, and as the value to return if the user enters
the empty string."
(if (and (equal ad-return-value "")
(ad-get-arg 3)) ; DEFAULT-VALUE
(setq ad-return-value default-value)
ad-return-value))
;; Dummy functions.
(defalias 'w3m-create-image 'ignore)
(defalias 'w3m-display-graphic-p 'ignore)
(defalias 'w3m-display-inline-image-p 'ignore)
(defalias 'w3m-image-type-available-p 'ignore)
(defalias 'w3m-insert-image 'ignore)
(defalias 'w3m-make-ccl-coding-system 'ignore)
(defalias 'w3m-setup-toolbar 'ignore)
(defalias 'w3m-update-toolbar 'ignore)
;; Keywords.
(defconst :bool ':bool)
(defconst :case-ignore ':case-ignore)
(defconst :decode-entity ':decode-entity)
(defconst :forms ':forms)
(defconst :integer ':integer)
(defconst :position ':position)
(defconst :post-data ':post-data)
(defconst :referer ':referer)
(defconst :title ':title)
(defconst :value-from ':value-from)
(defconst :window-start ':window-start)
(provide 'w3m-e19)
;;; w3m-e19.el ends here
--
Kevin Rodgers <kevinr@ihs.com>