Re[2]: [CEDET-devel] add-to-list XEmacs incompatibility in semantic
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2003-09-12 14:25:27
|
That does seem like a better mechanism. Good idea. Unless you come up with something else, please check it in. Eric >>> David PONCE <dav...@wa...> seems to think that: >Here is a new patch that now works (tested on GNU Emacs 20.7 and >21.3.50.1, and XEmacs 21.4.13). > >Index: semantic-tag.el >=================================================================== >RCS file: /cvsroot/cedet/cedet/semantic/semantic-tag.el,v >retrieving revision 1.18 >diff -c -r1.18 semantic-tag.el >*** semantic-tag.el 16 Jul 2003 14:07:32 -0000 1.18 >--- semantic-tag.el 12 Sep 2003 08:45:49 -0000 >*************** >*** 670,699 **** > ;; Semantic may want to provide special hooks when specific operations > ;; are about to happen on a given tag. These routines allow for hook > ;; maintenance on a tag. >- (defun semantic-tag-add-hook (tag hook value &optional append) >- "Add onto TAG a HOOK with VALUE." >- (let ((pl (semantic--tag-get-property tag hook))) >- (setq pl (add-to-list 'pl value append)) >- (semantic--tag-put-property tag hook pl))) > >! (defun semantic-tag-remove-hook (tag hook value) >! "Remove from TAG the HOOK with VALUE." >! (let ((pl (semantic--tag-get-property tag hook))) >! (setq pl (delete value pl)) >! (semantic--tag-put-property tag hook pl))) > > (defun semantic--tag-run-hooks (tag hook &rest args) > "Run for TAG all expressions saved on the property HOOK. > Each hook expression must take at least one argument, the TAG. > For any given situation, additional ARGS may be passed." >! (let ((pl (semantic--tag-get-property tag hook)) > (arglist (cons tag args))) > (condition-case err > ;; If a hook bombs, ignore it! Usually this is tied into > ;; some sort of critical system. >! (apply 'run-hook-with-args 'pl arglist) > (error (message "Error: %S" err))))) >- > > ;;; Tags and Overlays > ;; >--- 670,715 ---- > ;; Semantic may want to provide special hooks when specific operations > ;; are about to happen on a given tag. These routines allow for hook > ;; maintenance on a tag. > >! ;; Internal global variable used to manage tag hooks. For example, >! ;; some implementation of `remove-hook' checks that the hook variable >! ;; is `default-boundp'. >! (defvar semantic--tag-hook-value) >! >! (defun semantic-tag-add-hook (tag hook function &optional append) >! "Onto TAG, add to the value of HOOK the function FUNCTION. >! FUNCTION is added (if necessary) at the beginning of the hook list >! unless the optional argument APPEND is non-nil, in which case >! FUNCTION is added at the end. >! HOOK should be a symbol, and FUNCTION may be any valid function. >! See also the function `add-hook'." >! (let ((semantic--tag-hook-value (semantic--tag-get-property tag hook))) >! (add-hook 'semantic--tag-hook-value function append) >! (semantic--tag-put-property tag hook semantic--tag-hook-value) >! semantic--tag-hook-value)) >! >! (defun semantic-tag-remove-hook (tag hook function) >! "Onto TAG, remove from the value of HOOK the function FUNCTION. >! HOOK should be a symbol, and FUNCTION may be any valid function. If >! FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in >! the list of hooks to run in HOOK, then nothing is done. >! See also the function `remove-hook'." >! (let ((semantic--tag-hook-value (semantic--tag-get-property tag hook))) >! (remove-hook 'semantic--tag-hook-value function) >! (semantic--tag-put-property tag hook semantic--tag-hook-value) >! semantic--tag-hook-value)) > > (defun semantic--tag-run-hooks (tag hook &rest args) > "Run for TAG all expressions saved on the property HOOK. > Each hook expression must take at least one argument, the TAG. > For any given situation, additional ARGS may be passed." >! (let ((semantic--tag-hook-value (semantic--tag-get-property tag hook)) > (arglist (cons tag args))) > (condition-case err > ;; If a hook bombs, ignore it! Usually this is tied into > ;; some sort of critical system. >! (apply 'run-hook-with-args 'semantic--tag-hook-value arglist) > (error (message "Error: %S" err))))) > > ;;; Tags and Overlays > ;; > > |