Hi,
APPROVE COMMIT
Tried to get some comments on this patch a few months ago but got no
response. I wrote then:
----------------------------------------------------------------------
I include below a patch for code inspection, review and discussion.
It changes help.el in a few ways:
Two additions from GNU:
- Add link to customize if variable can be customized
- Add :version info when variable was introduced or default value
changed (I figure this can be useful actually!)
Additional changes
- Remove use of button2 completely for following links
- Use activate-function in extents so that the general link support
for button1 kicks in and provides the required link functionality
- Local implementation so that return does the same as button1 click
(Generalizing this is beyond what I can manage and why do it until
we agree it is a good thing!?)
- Jump between "activate-function"-extents with press of the tab key
----------------------------------------------------------------------
So to get some reaction (;-) I now promise to commit it in a
few days if nobody objects.
diff -r dcf9067f26bb -r 41c245aac285 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Jan 27 17:52:33 2014 +0100
+++ b/lisp/ChangeLog Sun Mar 09 00:36:29 2014 +0100
@@ -1,3 +1,10 @@
+2014-03-09 Mats Lidell <matsl(a)xemacs.org>
+
+ * help.el: Sync from GNU - Link to customize if applicable and
+ display version info. Other changes: Remove use of button-2.
+ return and button-1 use activate-function. Move between
+ activate-function-extents with tab.
+
2014-01-27 Michael Sperber <mike(a)xemacs.org>
* font-lock.el (font-lock-regexp-grouping-backslash,
diff -r dcf9067f26bb -r 41c245aac285 lisp/help.el
--- a/lisp/help.el Mon Jan 27 17:52:33 2014 +0100
+++ b/lisp/help.el Sun Mar 09 00:36:29 2014 +0100
@@ -1,6 +1,6 @@
;; help.el --- help commands for XEmacs.
-;; Copyright (C) 1985, 1986, 1992-4, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1992-4, 1997, 2014 Free Software Foundation, Inc.
;; Copyright (C) 2001, 2002, 2003, 2010 Ben Wing.
;; Maintainer: FSF
@@ -56,6 +56,9 @@
map)
"Keymap for characters following the Help key.")
+(defvar help-mode-link-positions nil)
+(make-variable-buffer-local 'help-mode-link-positions)
+
;; global-map definitions moved to keydefs.el
(fset 'help-command help-map)
@@ -142,6 +145,7 @@
Entry to this mode runs the normal hook `help-mode-hook'.
Commands:
\\{help-mode-map}"
+ (help-mode-get-link-positions)
)
(define-key help-mode-map "q" 'help-mode-quit)
@@ -153,8 +157,7 @@
(define-key help-mode-map "c" 'customize-variable)
(define-key help-mode-map [tab] 'help-next-symbol)
(define-key help-mode-map [(shift tab)] 'help-prev-symbol)
-(define-key help-mode-map [return] 'help-find-source-or-scroll-up)
-(define-key help-mode-map [button2] 'help-mouse-find-source-or-track)
+(define-key help-mode-map [return] 'help-activate-function-or-scroll-up)
(define-key help-mode-map "n" 'help-next-section)
(define-key help-mode-map "p" 'help-prev-section)
@@ -185,14 +188,24 @@
(describe-variable symb))))
(defun help-next-symbol ()
- "Move point to the next quoted symbol."
+ "Move point to the next link."
(interactive)
- (search-forward "`" nil t))
+ (let ((p (point))
+ (positions help-mode-link-positions))
+ (while (and positions (>= p (car positions)))
+ (setq positions (cdr positions)))
+ (if positions
+ (goto-char (car positions)))))
(defun help-prev-symbol ()
- "Move point to the previous quoted symbol."
+ "Move point to the previous link."
(interactive)
- (search-backward "'" nil t))
+ (let ((p (point))
+ (positions (reverse help-mode-link-positions)))
+ (while (and positions (<= p (car positions)))
+ (setq positions (cdr positions)))
+ (if positions
+ (goto-char (car positions)))))
(defun help-next-section ()
"Move point to the next quoted symbol."
@@ -227,6 +240,16 @@
(interactive)
nil)
+(defun help-mode-get-link-positions ()
+ "Get the positions of the links in the help buffer"
+ (let ((el (extent-list nil (point-min) (point-max) nil 'activate-function))
+ (positions nil))
+ (while el
+ (setq positions (append positions (list (extent-start-position (car el)))))
+ (setq el (cdr el)))
+ (setq help-mode-link-positions positions)))
+
+
(define-obsolete-function-alias 'deprecated-help-command 'help-for-help)
;;(define-key global-map 'backspace 'deprecated-help-command)
@@ -1283,11 +1306,13 @@
(let ((help-sticky-window
;; if we were called from a help buffer, make sure the new help
;; goes in the same window.
- (if (and (event-buffer ev)
+ (if (and ev
+ (event-buffer ev)
(symbol-value-in-buffer 'help-window-config
(event-buffer ev)))
(event-window ev)
- help-sticky-window)))
+ (if ev help-sticky-window
+ (get-buffer-window (current-buffer))))))
(funcall fun (extent-property ex 'help-symbol))))
(defun help-symbol-run-function (fun)
@@ -1445,7 +1470,8 @@
standard-output))
(set-extent-property e 'face 'hyper-apropos-hyperlink)
(set-extent-property e 'mouse-face 'highlight)
- (set-extent-property e 'find-function-symbol function)))
+ (set-extent-property e 'help-symbol function)
+ (set-extent-property e 'activate-function #'(lambda (ev ex) (help-symbol-run-function-1 ev ex 'find-function)))))
(princ "\"\n"))
(if describe-function-show-arglist
(let ((arglist (function-arglist function)))
@@ -1633,6 +1659,30 @@
(if type "an unknown type of built-in variable?"
"a variable declared in Lisp")))))
+(defun describe-variable-custom-version-info (variable)
+ (let ((custom-version (get variable 'custom-version))
+ (cpv (get variable 'custom-package-version))
+ (output nil))
+ (if custom-version
+ (setq output
+ (format "This variable was introduced, or its default value was changed, in\nversion %s of XEmacs.\n"
+ custom-version))
+ (when cpv
+ (let* ((package (car-safe cpv))
+ (version (if (listp (cdr-safe cpv))
+ (car (cdr-safe cpv))
+ (cdr-safe cpv)))
+ (pkg-versions (assq package customize-package-emacs-version-alist))
+ (emacsv (cdr (assoc version pkg-versions))))
+ (if (and package version)
+ (setq output
+ (format (concat "This variable was introduced, or its default value was changed, in\nversion %s of the %s package"
+ (if emacsv
+ (format " that is part of XEmacs %s" emacsv))
+ ".\n")
+ version package))))))
+ output))
+
(defun describe-variable (variable)
"Display the full documentation of VARIABLE (a symbol)."
(interactive
@@ -1684,7 +1734,8 @@
standard-output))
(set-extent-property e 'face 'hyper-apropos-hyperlink)
(set-extent-property e 'mouse-face 'highlight)
- (set-extent-property e 'find-variable-symbol variable))
+ (set-extent-property e 'help-symbol variable)
+ (set-extent-property e 'activate-function #'(lambda (ev ex) (help-symbol-run-function-1 ev ex 'find-variable))))
(princ"\"\n")))
(princ "\nValue: ")
(if (not (boundp variable))
@@ -1739,6 +1790,33 @@
(frob-help-extents standard-output)
(goto-char newp standard-output))
(princ "not documented as a variable."))))
+ ;; Make a link to customize if this variable can be customized.
+ (when (custom-variable-p variable)
+ (let ((customize-label "customize"))
+ (terpri)
+ (terpri)
+ (princ (concat "You can " customize-label " this variable."))
+ (with-current-buffer standard-output
+ (save-excursion
+ (re-search-backward
+ (concat "\\(" customize-label "\\)") nil t)
+ (let ((opoint (point standard-output))
+ e)
+ (require 'hyper-apropos)
+ ;; (princ variable)
+ (re-search-forward (concat "\\(" customize-label "\\)") nil t)
+ (setq e (make-extent opoint (point standard-output)
+ standard-output))
+ (set-extent-property e 'face 'hyper-apropos-hyperlink)
+ (set-extent-property e 'mouse-face 'highlight)
+ (set-extent-property e 'help-symbol variable)
+ (set-extent-property e 'activate-function #'(lambda (ev ex) (help-symbol-run-function-1 ev ex 'customize-variable)))))))
+ ;; Note variable's version or package version
+ (let ((output (describe-variable-custom-version-info variable)))
+ (when output
+ (terpri)
+ (terpri)
+ (princ output))))
(terpri)))
(format "variable `%s'" variable)))
@@ -1870,33 +1948,13 @@
(with-displaying-help-buffer
(insert string)))))
-(defun help-find-source-or-scroll-up (&optional pos)
+(defun help-activate-function-or-scroll-up (&optional pos)
"Follow any cross reference to source code; if none, scroll up. "
(interactive "d")
- (let ((e (extent-at pos nil 'find-function-symbol)))
- (if (and-fboundp 'find-function e)
- (with-fboundp 'find-function
- (find-function (extent-property e 'find-function-symbol)))
- (setq e (extent-at pos nil 'find-variable-symbol))
- (if (and-fboundp 'find-variable e)
- (with-fboundp 'find-variable
- (find-variable (extent-property e 'find-variable-symbol)))
- (scroll-up 1)))))
-
-(defun help-mouse-find-source-or-track (event)
- "Follow any cross reference to source code under the mouse;
-if none, call mouse-track. "
- (interactive "e")
- (mouse-set-point event)
- (let ((e (extent-at (point) nil 'find-function-symbol)))
- (if (and-fboundp 'find-function e)
- (with-fboundp 'find-function
- (find-function (extent-property e 'find-function-symbol)))
- (setq e (extent-at (point) nil 'find-variable-symbol))
- (if (and-fboundp 'find-variable e)
- (with-fboundp 'find-variable
- (find-variable (extent-property e 'find-variable-symbol)))
- (mouse-track event)))))
+ (let ((e (extent-at pos nil 'activate-function)))
+ (if e
+ (funcall (extent-property e 'activate-function) nil e)
+ (scroll-up 1))))
(define-minor-mode temp-buffer-resize-mode
"Toggle the mode which makes windows smaller for temporary buffers.
diff -r dcf9067f26bb -r 41c245aac285 tests/ChangeLog
--- a/tests/ChangeLog Mon Jan 27 17:52:33 2014 +0100
+++ b/tests/ChangeLog Sun Mar 09 00:36:29 2014 +0100
@@ -1,3 +1,8 @@
+2014-03-09 Mats Lidell <matsl(a)xemacs.org>
+
+ * automated/keymap-tests.el: Use
+ help-activate-function-or-scroll-up.
+
2013-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el:
diff -r dcf9067f26bb -r 41c245aac285 tests/automated/keymap-tests.el
--- a/tests/automated/keymap-tests.el Mon Jan 27 17:52:33 2014 +0100
+++ b/tests/automated/keymap-tests.el Sun Mar 09 00:36:29 2014 +0100
@@ -36,7 +36,7 @@
find-function-at-point Q help-mode-bury button2
help-mouse-find-source-or-track p
help-prev-section n help-next-section return
- help-find-source-or-scroll-up)
+ help-activate-function-or-scroll-up)
by #'cddr
do (define-key map (vector keys) def))
(loop for (keys def) on '(u view-scroll-some-lines-down % view-goto-percent
Yours
--
%% Mats
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
Suggestions for better places to put these welcome ... I'll wait until
the weekend before pushing this.
2014-04-02 Michael Sperber <mike(a)xemacs.org>
* subr-fsf.el (wholenump, declare-function): Two trivial functions
from GNU Emacs.
--
Regards,
Mike
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,6 @@
EXTRA_SOURCES = README
-ELCS = overlay.elc thingatpt.elc timer.elc x-popup-menu.elc goto-addr.elc
+ELCS = overlay.elc thingatpt.elc timer.elc x-popup-menu.elc goto-addr.elc subr-fsf.elc
include ../../XEmacs.rules
diff --git a/subr-fsf.el b/subr-fsf.el
new file mode 100644
--- /dev/null
+++ b/subr-fsf.el
@@ -0,0 +1,29 @@
+;;; subr-fsf.el --- Complement the core basic lisp subroutines for XEmacs
+
+;; Copyright (C) 2014
+;; 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.
+
+;;;###autoload
+(defalias 'wholenump 'natnump)
+
+;;;###autoload
+(defmacro declare-function (fn file &optional arglist fileonly))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
1 new commit in fsf-compat:
https://bitbucket.org/xemacs/fsf-compat/commits/0998c837f4f3/
Changeset: 0998c837f4f3
User: sperber
Date: 2014-04-02 16:40:50
Summary: Add some functions from GNU Emacs's subr.el.
2014-04-02 Michael Sperber <mike(a)xemacs.org>
* subr-fsf.el (wholenump, declare-function): Two trivial functions
from GNU Emacs.
Affected #: 3 files
diff -r 62743319f0c0cdf939832d8d6101c5273b1e8c90 -r 0998c837f4f326480a8d4ea8cff61b1ff3306728 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-02 Michael Sperber <mike(a)xemacs.org>
+
+ * subr-fsf.el (wholenump, declare-function): Two trivial functions
+ from GNU Emacs.
+
2013-12-03 Michael Sperber <mike(a)xemacs.org>
* timer.el (timer-activate-when-idle): Only call `activate-timer'
diff -r 62743319f0c0cdf939832d8d6101c5273b1e8c90 -r 0998c837f4f326480a8d4ea8cff61b1ff3306728 Makefile
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,6 @@
EXTRA_SOURCES = README
-ELCS = overlay.elc thingatpt.elc timer.elc x-popup-menu.elc goto-addr.elc
+ELCS = overlay.elc thingatpt.elc timer.elc x-popup-menu.elc goto-addr.elc subr-fsf.elc
include ../../XEmacs.rules
diff -r 62743319f0c0cdf939832d8d6101c5273b1e8c90 -r 0998c837f4f326480a8d4ea8cff61b1ff3306728 subr-fsf.el
--- /dev/null
+++ b/subr-fsf.el
@@ -0,0 +1,29 @@
+;;; subr-fsf.el --- Complement the core basic lisp subroutines for XEmacs
+
+;; Copyright (C) 2014
+;; 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.
+
+;;;###autoload
+(defalias 'wholenump 'natnump)
+
+;;;###autoload
+(defmacro declare-function (fn file &optional arglist fileonly))
Repository URL: https://bitbucket.org/xemacs/fsf-compat/
--
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
>> "Eli" == Eli Zaretskii <eliz(a)gnu.org> writes:
>> From: Uwe Brauer <oub(a)mat.ucm.es>
>> Cc: Uwe Brauer <uwe.brauer(a)xemacs.org>, xemacs-patches(a)xemacs.org
>> Date: Tue, 01 Apr 2014 18:42:19 +0200
>>
>> However in the hebrew.el file itself there is no author mentioned.
> Then I probably should ask you where did you get the file you
> modified. The author _is_ mentioned in the file that is in the GNU
> Emacs repository, since July 2011. Since you submitted the file to
> XEmacs much later, I wonder where did you find the file without that
> note.
I checked hebrew.el in my GNU emacs24 installation and you are right the
author is there. I don't remember exactly, but I think one problem was
the coding. I was advised to use iso-2022-7bit, encoding and there was
an incompatibility between GNU emacs and Xemacs. So I think I ended up
copying code of the GNU emacs hebrew.el into an older hebrew.el file I
had in my Xemacs directory (obviously without the author in the
header). Whether this version is also from GNU emacs or corresponds to
an older Xemacs version from 21.4 I do not remember, most likely it was
an old GNU emacs version.
>> May I suggest to add it right there and not bury it in some
>> ChangeLog files? That would avoid these sort of misunderstandings.
> This file does have the attribution inside it. However, in many other
> cases, certainly when only a few functions are copied, the credits are
> only in the ChangeLogs. My suggestion was to also grep those in order
> to find the original contributor(s).
Well but then you would not name these authors in the corresponding
files but want use to do so?
> Thanks.
I submit a changed hebrew file.
Uwe
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
Hi
It was pointed out to me that the file I submitted did not
include the original author. So I just added Yair Friedman.
I hope the encoding is fine (I have the feeling that iso-2022-jp
sucks...
Uwe Brauer
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
>> "Eli" == Eli Zaretskii <eliz(a)gnu.org> writes:
Hello Eli,
> Hello, Uwe and the rest of XEmacs developers,
> By sheer chance I was glancing through this list's archives, and was
> unpleasantly surprised to find the following commit log:
> 2014-01-21 Aidan Kehoe <kehoea(a)parhasard.net>
> Import GNU's Hebrew input methods, thank you GNU, thank you Uwe
> Brauer!
First of all:sorry and my apologies for any inconvenience
caused. Secondly let me ensure you that it was not my intention not to
give the credit the people who deserve t.
I just took the file modified it a bit, changed the encoding system and
sent it to xemacs-patches, Aidan just submitted this file into the
system.
However in the hebrew.el file itself there is no author mentioned. May I
suggest to add it right there and not bury it in some ChangeLog files?
That would avoid these sort of misunderstandings.
I propose to add Yair Friedman is the main author in the hebrew.el file.
I hope this is ok with him and you.
> I hope this is the right one).
> This is not the only case like that, so I guess this is some kind of
> policy.
I don't think there is any intention in this direction, but I can only
speak for myself, of course.
regards
Uwe
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
Hello, Uwe and the rest of XEmacs developers,
By sheer chance I was glancing through this list's archives, and was
unpleasantly surprised to find the following commit log:
2014-01-21 Aidan Kehoe <kehoea(a)parhasard.net>
Import GNU's Hebrew input methods, thank you GNU, thank you Uwe
Brauer!
* leim-list.el:
Make the Hebrew input methods available here.
* Makefile:
* Makefile (EXTRA_SOURCES):
Install hebrew.el uncompiled, since it's not computationally
intensive (compiling it doesn't bring much) and 21.4, which
compiles the packages, chokes on it.
* quail/hebrew.el:
* quail/hebrew.el ("hebrew"):
Update.
* quail/hebrew.el ("hebrew-new"): New.
* quail/hebrew.el ("hebrew-lyx"): New.
* quail/hebrew.el ("hebrew-full"): New.
* quail/hebrew.el ("hebrew-biblical-tiro"): New.
* quail/hebrew.el ("hebrew-biblical-sil"): New.
* quail/hebrew.el ("yiddish-royal"): New.
* quail/hebrew.el ("yiddish-keyman"): New.
* quail/hebrew.el ("hebrew-phonetic-xkb"): New.
* quail/hebrew.el ("hebrew-phonetic-qwerty"): New.
Most of these input methods (excluding the 1st and the last 2) were
written by Yair Friedman, as can be readily seen from the GNU Emacs
ChangeLog entries. Moreover, to recognize Yair's unique and
outstanding contribution to that file, hebrew.el in GNU Emacs has this
prominent note:
;; Many input methods in this file provided
;; by Yair Friedman <yair.f.lists(a)gmail.com>
This note is absent from the file I found in the XEmacs Leim
repository
(https://bitbucket.org/xemacs/leim/src/3e31b3d13c100a9bae06a7feead54480dd8...,
I hope this is the right one).
This is not the only case like that, so I guess this is some kind of
policy.
I think it's unfair to not credit people who worked on the code. They
deserve to be credited, and "thank you GNU" somehow doesn't cut it. I
don't think it's hard to find in the GNU Emacs logs the first entry
for a file or a feature or even a function, and give those who labored
on them credit they deserve.
May I suggest that you reconsider this policy in favor of better
crediting those who wrote the code you are using?
TIA
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches