auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-devel] Re: AUCTeX tool-bar and icons


From: Reiner Steib
Subject: [AUCTeX-devel] Re: AUCTeX tool-bar and icons
Date: Thu, 15 May 2008 23:58:17 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2.50 (gnu/linux)

On Thu, May 15 2008, Ralf Angeli wrote:

> * Reiner Steib (2008-05-14) writes:
>> The difference is that menu-find-file-existing tries to ensure that
>> only existing file can be selected
> Yes, this is what felt artificial to me.  Why would I want to restrict
> myself to a file dialog which offers only part of the functionality of
> another one while giving me no advantages?

I don't remember the reasoning, but AUCTeX should behave as close as
reasonably possible to the rest of Emacs in this regard.

>> But with plain Emacs (i.e. w/o toolbar-x or stuff like in Gnus'
>> gmm-utils.el), there's no simple way to make the tool bar
>> customizable.
> In this case we'd probably need a simple replacement.  Or we drop tool
> bar support for Emacs 21 as well which I would not like to do at the
> current stage.

WRT to non-customization of the tool bar, there's no difference
between Emacs 21 and Emacs 22, so I don't quite get your point here.

>> If you don't object, I can commit the following patch.  But as said
>> before, it's not tested with Emacs 21 or XEmacs, so someone else (you
>> ;-)) might have to modify/fix it for those.
>
> Problem is that Emacs 21 and Emacs 22 use the "open" icon for different
> things.  Emacs 21 for "Open directory" and Emacs 22 for "Open existing
> file".  So applying the change will likely lead to confusion for Emacs
> 21 users.  

D'uh.  Now I see: `toolbarx-default-toolbar-meaning-alist' just wasn't
updated for Emacs 22.

> How about defining parts of `toolbarx-default-toolbar-meaning-alist'
> differently depending on the Emacs version?

Yes, this seems necessary.

Something along this line.  WDYT?

--- toolbar-x.el        10 May 2008 22:03:00 +0200      1.18
+++ toolbar-x.el        15 May 2008 23:46:37 +0200      
@@ -1973,15 +1973,30 @@
 
 
 (defconst toolbarx-default-toolbar-meaning-alist
-  '((separator :image "sep" :command t :enable nil :help "")
-    (open-file :image ["new" toolbar-file-icon]
-              :command [find-file toolbar-open]
-              :enable [(not (window-minibuffer-p
-                             (frame-selected-window menu-updating-frame)))
-                       t]
-              :help ["Read a file into an Emacs buffer" "Open a file"])
+  `((separator :image "sep" :command t :enable nil :help "")
 
-    (dired :image ["open" toolbar-folder-icon]
+    (,(if (and (not (featurep 'xemacs)) (>= emacs-major-version 22))
+         'open-file
+       'new-file)
+     :image ["new" toolbar-file-icon]
+     :command [find-file toolbar-open]
+     :enable [(not (window-minibuffer-p
+                   (frame-selected-window menu-updating-frame)))
+             t]
+     :help ["Specify a new file's name, to edit the file" "Visit new file"])
+
+    ,(when (and (not (featurep 'xemacs)) (>= emacs-major-version 22))
+       '(open-file :image ["open" toolbar-file-icon]
+                  :command [menu-find-file-existing toolbar-open]
+                  :enable [(not (window-minibuffer-p
+                                 (frame-selected-window menu-updating-frame)))
+                           t]
+                  :help ["Read a file into an Emacs buffer" "Open a file"]))
+
+    (dired :image [,(if (and (not (featurep 'xemacs)) (>= emacs-major-version 
22))
+                       'diropen
+                     'open)
+                  toolbar-folder-icon]
           :command [dired toolbar-dired]
           :help ["Read a directory, operate on its files" "Edit a directory"])
 
@@ -2112,11 +2127,11 @@
 The following buttons are available:
 
 * Both Emacs and XEmacs: `open-file', `dired', `save-buffer',
-`undo', `cut', `copy', `paste', `search-replace', `print-buffer',
-`spell-buffer', `info'.
+  `undo', `cut', `copy', `paste', `search-replace', `print-buffer',
+  `spell-buffer', `info'.
 
-* Emacs only: `write-file', `search-forward', `customize', `help',
-`kill-buffer', `exit-emacs'.
+* Emacs only: `new-file' (Emacs 22+) `write-file', `search-forward',
+  `customize', `help', `kill-buffer', `exit-emacs'.
 
 * XEmacs only: `mail', `compile', `debug', `news'.
 
Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]