Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] X titlebar & iconname

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] X titlebar & iconname


Chronological Thread 
  • From: Brian Keck <address@hidden>
  • To: Joris van der Hoeven <address@hidden>
  • Cc: address@hidden
  • Subject: Re: [TeXmacs] X titlebar & iconname
  • Date: Thu, 26 Aug 2004 11:28:48 +1000

On Mon, 23 Aug 2004 15:05:23 +0200, Joris van der Hoeven wrote:
>Currently, the window name and the name of the corresponding menu
>item in the "Go" menu coincide. They are determined by buf->abbr,
>for a buffer buf. The menu name is computed from the url of the buffer
>in tm_data_rep::new_menu_name. So that is where you have to do something.

That helped. I've got it working, making set-abbr-buffer by copying
set-name-buffer with slight adjustments.

Thanks for your patience. Would you consider using the patch below?

The usage in my-init-buffer.scm is (not that anyone else has the tpr
command) ...
(use-modules (ice-9 popen))
(define path (url-concretize (get-name-buffer)))
(define ref (read-line (open-input-pipe (string-append "tpr " path))))
(set-abbr-buffer (string-append ">" ref))

Thanks anyway,
Brian Keck

----------------------------------------------------------------------

diff -urN TeXmacs-1.0.4-R2-src TeXmacs-1.0.4-R2-bwk || true
diff -urN TeXmacs-1.0.4-R2-src/src/Guile/Glue/build-glue-server.scm
TeXmacs-1.0.4-R2-bwk/src/Guile/Glue/build-glue-server.scm
--- TeXmacs-1.0.4-R2-src/src/Guile/Glue/build-glue-server.scm 2004-08-04
01:56:29.000000000 +1000
+++ TeXmacs-1.0.4-R2-bwk/src/Guile/Glue/build-glue-server.scm 2004-08-25
21:12:16.000000000 +1000
@@ -53,6 +53,7 @@
(pretend-save-buffer pretend_save_buffer (void))
(get-name-buffer get_name_buffer (url))
(set-name-buffer set_name_buffer (void url))
+ (set-abbr-buffer set_abbr_buffer (void string))
(new-buffer new_buffer (void))
(switch-to-buffer switch_to_buffer (void url))
(switch-to-active-buffer switch_to_active_buffer (void url))
diff -urN TeXmacs-1.0.4-R2-src/src/Guile/Glue/glue_server.cpp
TeXmacs-1.0.4-R2-bwk/src/Guile/Glue/glue_server.cpp
--- TeXmacs-1.0.4-R2-src/src/Guile/Glue/glue_server.cpp 2004-08-04
01:56:29.000000000 +1000
+++ TeXmacs-1.0.4-R2-bwk/src/Guile/Glue/glue_server.cpp 2004-08-25
21:16:44.000000000 +1000
@@ -399,6 +399,19 @@
}

SCM
+tmg_set_abbr_buffer (SCM arg1) {
+ SCM_ASSERT_URL (arg1, SCM_ARG1, "set-abbr-buffer");
+
+ string in1= scm_to_string (arg1);
+
+ // SCM_DEFER_INTS;
+ get_server()->set_abbr_buffer (in1);
+ // SCM_ALLOW_INTS;
+
+ return SCM_UNSPECIFIED;
+}
+
+SCM
tmg_new_buffer () {
// SCM_DEFER_INTS;
get_server()->new_buffer ();
@@ -889,6 +902,7 @@
gh_new_procedure ("pretend-save-buffer", (FN) tmg_pretend_save_buffer, 0,
0, 0);
gh_new_procedure ("get-name-buffer", (FN) tmg_get_name_buffer, 0, 0, 0);
gh_new_procedure ("set-name-buffer", (FN) tmg_set_name_buffer, 1, 0, 0);
+ gh_new_procedure ("set-abbr-buffer", (FN) tmg_set_abbr_buffer, 1, 0, 0);
gh_new_procedure ("new-buffer", (FN) tmg_new_buffer, 0, 0, 0);
gh_new_procedure ("switch-to-buffer", (FN) tmg_switch_to_buffer, 1, 0, 0);
gh_new_procedure ("switch-to-active-buffer", (FN)
tmg_switch_to_active_buffer, 1, 0, 0);
diff -urN TeXmacs-1.0.4-R2-src/src/Texmacs/Data/tm_data.cpp
TeXmacs-1.0.4-R2-bwk/src/Texmacs/Data/tm_data.cpp
--- TeXmacs-1.0.4-R2-src/src/Texmacs/Data/tm_data.cpp 2004-08-04
01:56:29.000000000 +1000
+++ TeXmacs-1.0.4-R2-bwk/src/Texmacs/Data/tm_data.cpp 2004-08-25
21:19:38.000000000 +1000
@@ -186,6 +186,20 @@
}
}

+void
+tm_data_rep::set_abbr_buffer (string abbr) {
+ int i;
+ tm_buffer buf= get_buffer ();
+ if (buf->abbr == abbr) return;
+ buf->abbr= abbr;
+ update_menu ();
+ for (i=0; i<N(buf->vws); i++) {
+ tm_view vw2= buf->vws[i];
+ if (vw2->win != NULL)
+ vw2->win->win->set_name (buf->abbr);
+ }
+}
+
url
tm_data_rep::get_name_buffer () {
tm_buffer buf= get_buffer ();
diff -urN TeXmacs-1.0.4-R2-src/src/Texmacs/server.hpp
TeXmacs-1.0.4-R2-bwk/src/Texmacs/server.hpp
--- TeXmacs-1.0.4-R2-src/src/Texmacs/server.hpp 2004-08-04 01:56:29.000000000
+1000
+++ TeXmacs-1.0.4-R2-bwk/src/Texmacs/server.hpp 2004-08-25 21:17:05.000000000
+1000
@@ -70,6 +70,7 @@
virtual tm_buffer get_buf (int i) = 0;
virtual url get_name_buffer () = 0;
virtual void set_name_buffer (url name) = 0;
+ virtual void set_abbr_buffer (string abbr) = 0;
virtual void new_buffer () = 0;
virtual void switch_to_buffer (url name) = 0;
virtual void switch_to_active_buffer (url name) = 0;
diff -urN TeXmacs-1.0.4-R2-src/src/Texmacs/tm_data.hpp
TeXmacs-1.0.4-R2-bwk/src/Texmacs/tm_data.hpp
--- TeXmacs-1.0.4-R2-src/src/Texmacs/tm_data.hpp 2004-08-04
01:56:29.000000000 +1000
+++ TeXmacs-1.0.4-R2-bwk/src/Texmacs/tm_data.hpp 2004-08-25
21:17:23.000000000 +1000
@@ -34,6 +34,7 @@
tm_buffer new_buffer (url name, tree t);
void delete_buffer (tm_buffer buf);
void set_name_buffer (url name);
+ void set_abbr_buffer (string abbr);
url get_name_buffer ();

/* Low level view manipulation */




Archive powered by MHonArc 2.6.19.

Top of Page