unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4032: (no subject)
@ 2009-08-04 19:56 Bostjan Vilfan
  0 siblings, 0 replies; only message in thread
From: Bostjan Vilfan @ 2009-08-04 19:56 UTC (permalink / raw)
  To: 4032


[-- Attachment #1.1: Type: text/plain, Size: 460 bytes --]

Hello,
Some additional information re this bug: 
1) After submitting my report I noticed that I left a (sit-for 5) evaluation in my example.el file, which caused an unnecessary delay (it remained after debugging). I have now removed this, and the fixed example.el is attached.

2) Note that in order for all toolbar icons to appear one has to exercise the slider several times . Often moving it only once will not produce the result.
Regards,
bostjanv


      

[-- Attachment #1.2: Type: text/html, Size: 679 bytes --]

[-- Attachment #2: example.el --]
[-- Type: application/octet-stream, Size: 3791 bytes --]

;;-*-coding: utf-8-*-
;;
;; INSTRUCTIONS
;; - Unzip example.zip in home directory (~/...);
;; - call emacs with option --no-init-file (just in case)
;; - go to scratch buffer
;; - evaluate (setq load-path (cons "~/emacs-tool-bar-example" load-path)) ;
;; - evaluate (load "example")
;; - evaluate (run-example)

(defun example-of-extend-find-file-hook () "extend hook"
   (interactive nil)
   (setq find-file-hook (append find-file-hook (list 'toolbar-example)))
)


(defun toolbar-example-message () "a message"
   (interactive nil)
   (message "yoohoo")
)

;; member of find-file-hook

(defun toolbar-example () "add items to local toolbar for file example.txt"
   (interactive nil)
       (if (string= (file-name-nondirectory (buffer-file-name)) "example.txt")
          (progn
            (if (not (local-variable-p 'tool-bar-map))
              (let (temp)
                (setq temp (copy-sequence tool-bar-map))
                (make-local-variable 'tool-bar-map)
                (setq tool-bar-map temp)
              )
            )
            (define-key global-map [tool-bar example1] 'toolbar-example-message)
            (tool-bar-local-item  "example1" 'toolbar-example-message
                    'example1 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example2] 'toolbar-example-message)
            (tool-bar-local-item  "example2" 'toolbar-example-message
                    'example2 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example3] 'toolbar-example-message)
            (tool-bar-local-item  "example3" 'toolbar-example-message
                    'example3 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example4] 'toolbar-example-message)
            (tool-bar-local-item  "example4" 'toolbar-example-message
                    'example4 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example5] 'toolbar-example-message)
            (tool-bar-local-item  "example5" 'toolbar-example-message
                    'example5 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example6] 'toolbar-example-message)
            (tool-bar-local-item  "example6" 'toolbar-example-message
                    'example6 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example7] 'toolbar-example-message)
            (tool-bar-local-item  "example7" 'toolbar-example-message
                    'example7 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example8] 'toolbar-example-message)
            (tool-bar-local-item  "example8" 'toolbar-example-message
                    'example8 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example9] 'toolbar-example-message)
            (tool-bar-local-item  "example9" 'toolbar-example-message
                    'example9 tool-bar-map 
                    :help "New todo item in org file")
            (define-key global-map [tool-bar example10] 'toolbar-example-message)
            (tool-bar-local-item  "example10" 'toolbar-example-message
                    'example10 tool-bar-map 
                    :help "New todo item in org file")
          )
       (message "file is not \"example.txt\"")
       )
)

(defun run-example () "run the tool-bar problem example"
   (interactive nil)
   
   (example-of-extend-find-file-hook)
   (find-file "~/emacs-tool-bar-example/example.txt")
)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-04 19:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-04 19:56 bug#4032: (no subject) Bostjan Vilfan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).