Commit 0bf36cbf authored by David Byers's avatar David Byers

Hopefully fixed menus in all emacs versions.

Allow emacs 22.1 to follow links on mouse-1
parent 3c6f9e2a
2007-06-09 <David Byers@GULAG>
* language.el (lyskom-language-keymap-internal): Let Emacs 22.1
follow links with mouse-1.
* filter.el (lyskom-copy-filter): Renamed from copy-filter.
(lyskom-filter-p): Renamed from filter-p.
(lyskom-make-filter): Renamed from make-filter.
* lyskom-rest.el (kom-backward-text): Renamed backward-text to
kom-backward-text. Renamed forward-text to kom-forward-text.
(lyskom-silent-read): Renamed silent-read to lyskom-silent-read.
* parse.el: Renamed apply-parser lyskom-apply-parser.
* review.el: Replaced all calls to nfirst with lyskom-nfirst.
* lyskom-rest.el (lyskom-startup-check-recommended-memberships):
Use lyskom-filter-list, not filter-list.
* faqs.el (lyskom-get-unread-faqs): Same.
* completing-read.el (lyskom-read-conf-guess-initial): Same.
* utilities.el (lyskom-filter-list): Renamed from filter-list.
(lyskom-nfirst): Renamed from nfirst.
Fix menu display in Gnu Emacs 22.1:
* menus.el (lyskom-define-menu-gnu-title-encoding-type): New
variable used to encode top-level menu titles differently from
nested menus.
* language.el (lyskom-get-menu-string): Don't encode the menu
strings here, since encoding needs to be different in different
places.
* menus.el (lyskom-menu-encoding-rules): New variable.
(lyskom-menu-encode): New function.
(lyskom-define-menu-xemacs): Encode menu strings.
(lyskom-define-menu-gnu): Encode menu strings.
2007-06-08 <David Byers@TAMIZDAT>
Compatibility fixes for Gnu Emacs 22.1:
* lyskom-rest.el (lyskom-sentinel): Check that proc is a process
before using it as such. Call lyskom-remove-unread-buffer with the
right argument (the buffer, not the process).
......
......@@ -140,7 +140,7 @@ return non-nil if the item is to be included in the list."
in ADDED added."
(let ((new-nos (nconc (mapcar 'aux-item->aux-no deleted)
(mapcar 'aux-item->aux-no added))))
(nconc (filter-list (lambda (el) (not (memq (aux-item->aux-no el) new-nos)))
(nconc (lyskom-filter-list (lambda (el) (not (memq (aux-item->aux-no el) new-nos)))
item-list)
added)))
......
......@@ -2448,9 +2448,9 @@ person you need either the old password for the person, or have
administrative privileges enabled."
(interactive)
(let ((pers-no (lyskom-read-conf-no 'whos-passwd '(pers) nil nil t))
(old-pw (silent-read (lyskom-get-string 'old-passwd)))
(new-pw1 (silent-read (lyskom-get-string 'new-passwd)))
(new-pw2 (silent-read (lyskom-get-string 'new-passwd-again))))
(old-pw (lyskom-silent-read (lyskom-get-string 'old-passwd)))
(new-pw1 (lyskom-silent-read (lyskom-get-string 'new-passwd)))
(new-pw2 (lyskom-silent-read (lyskom-get-string 'new-passwd-again))))
(if (lyskom-string= new-pw1 new-pw2)
(progn
......
......@@ -267,7 +267,7 @@ See lyskom-read-conf for a description of the parameters."
(uconf-stat->name
(car
(filter-list
(lyskom-filter-list
(lambda (uconf-stat)
(and uconf-stat
(not (memq nil
......
......@@ -2873,8 +2873,8 @@ Change privileges for %#1P (%#1p)...")
;; Running in) buffer
(define-key lyskom-en-mode-map (kbd "M-p") 'backward-text)
(define-key lyskom-en-mode-map (kbd "M-n") 'forward-text)
(define-key lyskom-en-mode-map (kbd "M-p") 'kom-backward-text)
(define-key lyskom-en-mode-map (kbd "M-n") 'kom-forward-text)
(define-key lyskom-en-mode-map (kbd "C-M-p") 'kom-prev-prompt)
(define-key lyskom-en-mode-map (kbd "C-M-n") 'kom-next-prompt)
(define-key lyskom-en-mode-map (kbd "s a") 'kom-save-text)
......
......@@ -426,7 +426,7 @@ create a new FAQ."
(conf-stat->aux-items conf-stat)
(server-info->aux-item-list lyskom-server-info)))
(faq-list
(filter-list
(lyskom-filter-list
(lambda (faq)
(not (lyskom-faq-is-read conf-no faq)))
(delq nil
......
......@@ -43,11 +43,11 @@
(defvar filter-edit-list-start nil)
(defvar filter-edit-list-end nil)
(defun copy-filter-list (l)
(defun lyskom-copy-filter-list (l)
"Copy the filter list L"
(cond ((null l) nil)
(t (cons (copy-filter (car l))
(copy-filter-list (cdr l))))))
(t (cons (lyskom-copy-filter (car l))
(lyskom-copy-filter-list (cdr l))))))
(defun lyskom-reverse-pairs (l)
"Reverse the pairs in the assoc list L"
......@@ -85,7 +85,7 @@
"Return non-nil if FILTER is a valid filter list"
(cond ((null filter) t)
((not (listp filter)) nil)
((not (filter-p (car filter))) nil)
((not (lyskom-filter-p (car filter))) nil)
(t (and (lyskom-verify-filter-pattern
(filter->pattern (car filter)))
(lyskom-verify-filter-list (cdr filter))))))
......@@ -447,7 +447,7 @@ If NEWLINE is non-nil, insert a newline after the header."
t))
(setq permanent
(lyskom-j-or-n-p (lyskom-get-string 'filter-permanent)))
(setq filter (make-filter nil
(setq filter (lyskom-make-filter nil
(list (cons 'action
(cdr (assoc action rev-actions)))
(cons 'expire (not permanent)))))
......@@ -759,7 +759,7 @@ If NOERROR is non-nil, return nil instead of signaling an error."
(delete-region filter-edit-list-start filter-edit-list-end)
(goto-char filter-edit-list-start)
(insert "\n")
(lyskom-format-filter-list (copy-filter-list filter-edit-filter-list))
(lyskom-format-filter-list (lyskom-copy-filter-list filter-edit-filter-list))
(set-marker filter-edit-list-end (point))
(setq filter-edit-change-flag nil)
(lyskom-filter-edit-beginning-of-list))))
......@@ -894,7 +894,7 @@ undesired filters and to create complex filters."
server-name))
(setq filter-edit-list-start (point-marker))
(insert "\n")
(lyskom-format-filter-list (copy-filter-list filter-edit-filter-list))
(lyskom-format-filter-list (lyskom-copy-filter-list filter-edit-filter-list))
(setq filter-edit-list-end (point-max-marker))
(insert (make-string (1- (window-width)) ?=)
(format (lyskom-get-string 'filter-edit-footer))))
......
......@@ -57,7 +57,7 @@
;;; expire -- When the filter expires. Not used.
;;;
(defun make-filter (&optional p a)
(defun lyskom-make-filter (&optional p a)
"Creates and returns a filter structure.
Optional P and A initialize pattern and attributes, respectively."
(lyskom-create-filter p a (lyskom-create-compile-filter-function p)))
......@@ -71,12 +71,12 @@ Optional P and A initialize pattern and attributes, respectively."
(lyskom-create-compile-filter-function
(filter->pattern filter))))
(defun copy-filter (f)
(defun lyskom-copy-filter (f)
"Create a copy of the filter F"
(make-filter (copy-tree (filter->pattern f))
(lyskom-make-filter (copy-tree (filter->pattern f))
(copy-tree (filter->attribute-list f))))
(defun filter-p (f)
(defun lyskom-filter-p (f)
"Returns T if f looks like a filter"
(and (listp f)
(eq 'filter (car f))))
......@@ -469,7 +469,7 @@ To change existing filters, use `kom-filter-edit'."
(setq perm (lyskom-filter-read-permanent))
(lyskom-add-filter
(make-filter filter
(lyskom-make-filter filter
(list (cons 'action action)
(cons 'expire (not perm))))))))
......@@ -498,7 +498,7 @@ To change existing filters, use `kom-filter-edit'."
(setq action (lyskom-filter-read-action))
(setq permanent (lyskom-filter-read-permanent))
(lyskom-add-filter
(make-filter filter
(lyskom-make-filter filter
(list (cons 'action action)
(cons 'expire (not permanent)))))))
......@@ -514,7 +514,7 @@ To change existing filters, use `kom-filter-edit'."
(permanent (lyskom-filter-read-permanent)))
(cond ((and conf-no (not (zerop conf-no)))
(lyskom-add-filter
(make-filter (list (cons 'recipient-no conf-no))
(lyskom-make-filter (list (cons 'recipient-no conf-no))
(list (cons 'action action)
(cons 'expire (not permanent)))))
))))
......@@ -592,7 +592,7 @@ This command accepts text number prefix arguments \(see
(when (string-match "^\\s-*$" lyskom-current-subject) (setq text ""))
(lyskom-add-filter
(make-filter (list
(lyskom-make-filter (list
(cons 'subject-re
(concat (if (string-equal text "") "^" "")
"\\([rR][eE]: *\\|[Ff][Ww][Dd]: *\\)*"
......@@ -639,7 +639,7 @@ To change existing filters, use `kom-filter-edit'."
(setq action (lyskom-filter-read-action))
(setq perm (lyskom-filter-read-permanent))
(lyskom-add-filter
(make-filter filter
(lyskom-make-filter filter
(list (cons 'action action)
(cons 'expire (not perm))))))))
......
......@@ -103,7 +103,8 @@ sessions."
;; If the "real" keymap has no value, set it to an empty keymap
(if (eval keymap)
nil
(set keymap (make-sparse-keymap)))
(set keymap (make-sparse-keymap))
(define-key (symbol-value keymap) [follow-link] 'mouse-face))
;; Add it to the list of keymaps
(or (memq keymap lyskom-language-keymaps)
(setq lyskom-language-keymaps
......@@ -252,11 +253,9 @@ lyskom-define-language."
Looks for the 'lyskom-menu category, or 'lyskom-command
if 'lyskom-menu is not found."
(lyskom-encode-coding-string
(or (lyskom-try-get-string symbol 'lyskom-menu)
(or (lyskom-try-get-string symbol 'lyskom-menu)
(lyskom-try-get-string symbol 'lyskom-command)
(lyskom-get-string-error 'lyskom-get-menu-string symbol 'lyskom-menu))
'iso-8859-1))
(lyskom-get-string-error 'lyskom-get-menu-string symbol 'lyskom-menu)))
(defun lyskom-define-language (language coding &rest names)
(let ((match (assq language lyskom-languages)))
......
......@@ -954,7 +954,7 @@ by PERS-NO"
(defun lyskom-startup-check-recommended-memberships ()
"Create invitations for new membership recommendations"
(let ((recommendations
(filter-list
(lyskom-filter-list
(lambda (rec)
(not (lyskom-recommendation-already-rejected (car rec))))
(mapcar (lambda (aux)
......@@ -3046,13 +3046,13 @@ A list of pairs means OPTARG will be used as a key to look up the real
(defun backward-text (&optional arg)
(defun kom-backward-text (&optional arg)
"Searches backwards for a text start and recenters with that text at the top."
(interactive "p")
(lyskom-prev-area (or arg 1) 'lyskom-text-start t)
(beginning-of-line))
(defun forward-text (&optional arg)
(defun kom-forward-text (&optional arg)
"Searches forward for a text start and recenters with that text at the top."
(interactive "p")
(lyskom-next-area (or arg 1) 'lyskom-text-start t))
......@@ -3130,7 +3130,7 @@ See `kom-save-text-body' for an alternative to this command."
(let ((name nil))
(save-excursion
(while (and arg (> arg 0))
(backward-text 1)
(kom-backward-text 1)
(if (looking-at "\\([0-9]+\\)\\s-")
(setq list-of-texts (cons (lyskom-string-to-number (match-string 1))
list-of-texts)
......@@ -4069,7 +4069,7 @@ Returns the selected alternative (a symbol)"
(elt (assq input-char alts) 2))))
(defun impl ()
(defun lyskom-not-implemented ()
(error "Not implemented"))
......@@ -4429,12 +4429,12 @@ Other objects are converted correctly."
;;;; Utility routines.
;;; silent-read was
;;; lyskom-silent-read was
;; Written by Lars Willf|r <willfor@lysator.liu.se>
;; Copyright and copyleft Lars Willf|r.
;; Last modified jun 93 by Linus Tolke
(defun silent-read (prompt-str)
(defun lyskom-silent-read (prompt-str)
"Read a string in the minibuffer without echoing.
One parameter - the prompt string."
(interactive "sPrompt string: ")
......
......@@ -438,6 +438,38 @@
keymap)
result)
;;; ============================================================
;;; Creating menus
(defvar lyskom-menu-encoding-rules
(lyskom-xemacs-or-gnu
'((title . iso-8859-1)
(item . iso-8859-1)
(keys . iso8859-1))
(cond ((< emacs-major-version 22) '((title . iso-8859-1)
(item . iso-8859-1)
(keys . iso8859-1)))
((boundp 'gtk-version-string) '((title . utf-8)
(item . utf-8)
(keys . utf-8)))
((memq window-system '(win32 mswindows w32)) '((title . utf-8)
(item . nil)
(keys . utf-8)))
(t '((title . iso-8859-1) (item . iso-8859-1) (keys . iso8859-1)))))
"Rules for encoding menu strings")
(defun lyskom-menu-encode (string what)
"Encode a string for use in menus.
STRING is the string to encode
WHAT is one of title, item or keys"
(let ((coding (cdr (assq what lyskom-menu-encoding-rules))))
(cond ((and coding (coding-system-p coding))
(lyskom-encode-coding-string string coding))
((functionp coding)
(funcall coding string))
(t string))))
(defun lyskom-build-menus ()
"Create menus according to LYSKOM-MENUS"
(lyskom-xemacs-or-gnu (lyskom-build-menus-xemacs)
......@@ -476,7 +508,8 @@
((eq (car menus) 'menu) ; A menu
(let ((menu-title (car (cdr menus)))
(menu-items (car (cdr (cdr menus)))))
(cons (lyskom-get-menu-string menu-title)
(cons (lyskom-menu-encode
(lyskom-get-menu-string menu-title) 'title)
(mapcar
(lambda (item)
(let ((type (car item))
......@@ -500,11 +533,16 @@
(car (cdr (assq symbol specials)))
" "))))
(if shortcut
(vector (lyskom-get-menu-string symbol)
(vector (lyskom-menu-encode
(lyskom-get-menu-string symbol)
'item)
symbol
':active t
':keys shortcut)
(vector (lyskom-get-menu-string symbol) symbol ':active t))))
':keys (lyskom-menu-encode
shortcut 'keys))
(vector (lyskom-menu-encode
(lyskom-get-menu-string symbol)
'item) symbol ':active t))))
((eq type 'hline)
"--:shadowEtchedIn")
((eq type 'menu)
......@@ -514,6 +552,7 @@
(t nil))))
(defvar lyskom-define-menu-gnu-title-encoding-type 'title)
(defun lyskom-define-menu-gnu (map menus &optional specials)
(let ((specials (or specials
(when (current-local-map)
......@@ -525,8 +564,11 @@
(cond ((eq 'hline type)
(define-key map (vector (lyskom-gensym)) '("--")))
((eq 'menu type)
(let* ((name (lyskom-get-menu-string symbol))
(submap (make-sparse-keymap name)))
(let* ((name (lyskom-menu-encode
(lyskom-get-menu-string symbol)
lyskom-define-menu-gnu-title-encoding-type))
(submap (make-sparse-keymap name))
(lyskom-define-menu-gnu-title-encoding-type 'item))
(define-key map (vector symbol)
(cons name submap))
(lyskom-define-menu-gnu submap
......@@ -551,13 +593,13 @@
(car (cdr (assq symbol specials)))
" "))))
(if shortcut
(progn (when (memq window-system '(win32 mswindows w32))
(setq shortcut (lyskom-encode-coding-string shortcut 'iso-8859-1)))
(define-key map (vector symbol)
`(menu-item ,(lyskom-get-menu-string symbol) ,symbol
:keys ,shortcut)))
(define-key map (vector symbol)
`(menu-item ,(lyskom-menu-encode
(lyskom-get-menu-string symbol)
'item) ,symbol
:keys ,(lyskom-menu-encode shortcut 'keys)))
(define-key map (vector symbol)
(cons (lyskom-get-menu-string symbol) symbol)))))
(cons (lyskom-menu-encode (lyskom-get-menu-string symbol) 'item) symbol)))))
(t (error "Menu description invalid in lyskom-define-menu")))))))
......
......@@ -1202,7 +1202,7 @@ i.e creates the buffer, sets all markers and pointers."
(call-info (lyskom-locate-ref-no kom-queue ref-no)))
(set-buffer lyskom-unparsed-buffer)
(if call-info
(apply-parser call-info))
(lyskom-apply-parser call-info))
(set-buffer buffer)
(lyskom-decrease-pending-calls)
(setq lyskom-pending-calls
......@@ -1239,7 +1239,7 @@ car is equal to ELT."
(cdr head)))
(defun apply-parser (call-info)
(defun lyskom-apply-parser (call-info)
"Try to parse a reply from the server.
CALL-INFO looks like this: (See lyskom-call-data).
('CALL REF-NO PARSER PARSER-DATA HANDLER HANDLER-DATA)
......
......@@ -652,12 +652,12 @@ Cannot be called from a callback."
(if (> num 0)
(progn
(setq lyskom-last-review-saved-result-list
(nfirst (- (length result) num) result))
(lyskom-nfirst (- (length result) num) result))
(nthcdr (max 0 (- (length result) num)) result))
(progn
(setq lyskom-last-review-saved-result-list
(nthcdr (- num) result))
(nfirst (- num) result))))))
(lyskom-nfirst (- num) result))))))
......@@ -928,7 +928,7 @@ Args: persno confno num &optional again pstart cstart"
(if (> num 0)
(progn
(setq lyskom-last-review-saved-result-list
(nfirst (- (length result-list) num) result-list))
(lyskom-nfirst (- (length result-list) num) result-list))
(setq lyskom-last-review-saved-result-size
(length lyskom-last-review-saved-result-list))
(setq lyskom-last-review-saved-result-list
......@@ -944,7 +944,7 @@ Args: persno confno num &optional again pstart cstart"
(setq lyskom-last-review-saved-result-list
(cons lyskom-last-review-saved-result-list
(make-list (- (length by-list) 1) nil)))
(nfirst (- num) result-list))))))))
(lyskom-nfirst (- num) result-list))))))))
......@@ -1055,12 +1055,12 @@ Cannot be called from a callback."
(if (> num 0)
(progn
(setq lyskom-last-review-saved-result-list
(nfirst (- (length result) num) result))
(lyskom-nfirst (- (length result) num) result))
(nthcdr (max 0 (- (length result) num)) result))
(progn
(setq lyskom-last-review-saved-result-list
(nthcdr (- num) result))
(nfirst (- num) result))))))
(lyskom-nfirst (- num) result))))))
(defun lyskom-get-texts-to (confno num &optional again cstart)
"From CONFNO get NUM texts."
......@@ -1122,12 +1122,12 @@ Cannot be called from a callback."
(if (> num 0)
(progn
(setq lyskom-last-review-saved-result-list
(nfirst (- (length result) num) result))
(lyskom-nfirst (- (length result) num) result))
(nthcdr (max 0 (- (length result) num)) result))
(progn
(setq lyskom-last-review-saved-result-list
(nthcdr (- num) result))
(nfirst (- num) result))))))
(lyskom-nfirst (- num) result))))))
......@@ -1743,7 +1743,7 @@ all review-related functions."
(list
(lyskom-read-number (lyskom-get-string 'read-normally-read) 1)))
(lyskom-tell-internat 'kom-tell-review)
(let* ((text-nos (nreverse (nfirst no lyskom-normally-read-texts))))
(let* ((text-nos (nreverse (lyskom-nfirst no lyskom-normally-read-texts))))
(if text-nos
(progn
(lyskom-format-insert 'review-text-no (car text-nos))
......@@ -1765,7 +1765,7 @@ After marking a number of texts unread, this will mark the N texts
read prior to that."
(interactive
(list (lyskom-read-number (lyskom-get-string 'read-normally-read) 1)))
(let* ((text-nos (nreverse (nfirst no lyskom-normally-read-texts))))
(let* ((text-nos (nreverse (lyskom-nfirst no lyskom-normally-read-texts))))
(if text-nos
(lyskom-traverse text-no text-nos
(lyskom-format-insert 'marking-text-unread text-no)
......
......@@ -455,7 +455,7 @@ clients of the event. See lyskom-mode for details on lyskom."
(cond ((match-string 1)
(process-send-string
proc
(concat (silent-read (match-string 1)) "\n"))
(concat (lyskom-silent-read (match-string 1)) "\n"))
(delete-region (match-beginning 0)
(match-end 0)))
(t (error (lyskom-get-string 'ssh-cant-connect)
......@@ -592,7 +592,7 @@ shown to other users."
;; the person when loggin in new
;; users
(or lyskom-is-new-user
(silent-read
(lyskom-silent-read
(lyskom-get-string 'password)))))
(if invisiblep 1 0))
(progn
......@@ -755,10 +755,10 @@ This is called at login and after prioritize and set-unread."
(lyskom-scroll)
(cond
((ja-or-nej-p (lyskom-format 'is-name-correct name))
(let ((password (silent-read (lyskom-get-string 'personal-password))))
(let ((password (lyskom-silent-read (lyskom-get-string 'personal-password))))
(cond
((not (equal password
(silent-read (lyskom-get-string 'repeat-password))))
(lyskom-silent-read (lyskom-get-string 'repeat-password))))
;; Failed to enter the same password twice
(lyskom-insert-string 'repeat-failure)
nil)
......
......@@ -2774,9 +2774,9 @@ Nuvarande r
(define-key lyskom-sv-mode-map (kbd "M-m") 'kom-toggle-mark-as-read-prefix)
(define-key lyskom-sv-mode-map (kbd "M-c") 'kom-toggle-cache-prefix)
(define-key lyskom-sv-mode-map (kbd (lyskom-keys 'button2)) 'kom-button-click)
(define-key lyskom-sv-mode-map (kbd (lyskom-keys 'button2)) 'kom-mouse-null)
(define-key lyskom-sv-mode-map (kbd (lyskom-keys 'button2up)) 'kom-button-click)
(define-key lyskom-sv-mode-map (kbd (lyskom-keys 'button3)) 'kom-popup-menu)
(define-key lyskom-sv-mode-map (kbd (lyskom-keys 'button2up)) 'kom-mouse-null)
(define-key lyskom-sv-mode-map (kbd (lyskom-keys 'button3up)) 'kom-mouse-null)
(define-key lyskom-sv-mode-map (kbd "*") 'kom-button-press)
(define-key lyskom-sv-mode-map (kbd "=") 'kom-menu-button-press)
......@@ -3025,8 +3025,8 @@ Nuvarande r
;; Running in buffer
(define-key lyskom-sv-mode-map (kbd "M-p") 'backward-text)
(define-key lyskom-sv-mode-map (kbd "M-n") 'forward-text)
(define-key lyskom-sv-mode-map (kbd "M-p") 'kom-backward-text)
(define-key lyskom-sv-mode-map (kbd "M-n") 'kom-forward-text)
(define-key lyskom-sv-mode-map (kbd "C-M-p") 'kom-prev-prompt)
(define-key lyskom-sv-mode-map (kbd "C-M-n") 'kom-next-prompt)
......
......@@ -83,7 +83,7 @@
"Turn VECTOR into a list"
(append vector nil))
(defun nfirst (n list)
(defun lyskom-nfirst (n list)
"Return a list of the N first elements of LIST."
(let ((result nil))
(while (and (> n 0) list)
......@@ -146,7 +146,7 @@ If BEFORE is not in the list, then insert EL at the end of the list."
(if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil))
x))))
(defun filter-list (test list)
(defun lyskom-filter-list (test list)
(let ((result nil))
(lyskom-traverse el list
(when (funcall test el)
......@@ -640,11 +640,11 @@ non-negative integer and 0 means the given text-no."
(defun lyskom-get-text-above-point (arg)
(save-excursion
(let ((former-point (point)))
(backward-text (+ 1 arg))
(kom-backward-text (+ 1 arg))
(if (looking-at "\\([0-9]+\\)\\s-")
(lyskom-string-to-number (match-string 1))
(progn ;; we probably ended up above the first message in the buffer
(forward-text)
(kom-forward-text)
(if (and (< (point) former-point)
(looking-at "\\([0-9]+\\)\\s-"))
(lyskom-string-to-number (match-string 1))
......@@ -655,11 +655,11 @@ non-negative integer and 0 means the given text-no."
arg
(save-excursion
(let ((former-point (point)))
(forward-text arg)
(kom-forward-text arg)
(if (looking-at "\\([0-9]+\\)\\s-")
(lyskom-string-to-number (match-string 1))
(progn ;; we probably ended up below the final message in the buffer
(backward-text)
(kom-backward-text)
(if (and (> (point) former-point)
(looking-at "\\([0-9]+\\)\\s-"))
(lyskom-string-to-number (match-string 1))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment