From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Sanest way to make emacs behave on a Solaris OS Date: Thu, 08 Aug 2013 17:36:21 +0200 Organization: Aioe.org NNTP Server Message-ID: <877gfwqjnu.fsf@VLAN-3434.student.uu.se> References: <87d2pzj4m2.fsf@VLAN-3434.student.uu.se> <87ob9izk9k.fsf@VLAN-3434.student.uu.se> <87fvusw968.fsf@newsguy.com> <87mwoz2gzr.fsf@VLAN-3434.student.uu.se> <87zjsuv7vn.fsf@VLAN-3434.student.uu.se> <8738qliu38.fsf@VLAN-3434.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1375976417 2701 80.91.229.3 (8 Aug 2013 15:40:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Aug 2013 15:40:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 08 17:40:20 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V7SK2-0008Fk-TR for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Aug 2013 17:40:19 +0200 Original-Received: from localhost ([::1]:57371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7SK2-0000Sy-HC for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Aug 2013 11:40:18 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 63 Original-NNTP-Posting-Host: SWN/nubmpQxYKwY7hPy4YA.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:galQMH/APZhlCkAsgPOV+MU+sCw= Original-Xref: usenet.stanford.edu gnu.emacs.help:200513 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92780 Archived-At: Emanuel Berg writes: > Another solution ... It wasn't a good idea to call the files (for example) .xterm, because that is the norm of config files (that are not related to Xresouces: for example, couldn't be used for Emacs). So invented the .xr extension for this purpose. Some "extra material" - haven't tested that much, but seems to work. Comments are always welcome. ;;; Xresources etc. (add-to-list 'magic-mode-alist '("! conf-xd" . conf-xdefaults-mode)) (add-to-list 'auto-mode-alist '("\\.xr\\'" . conf-xdefaults-mode)) ;; get resource file by tool name (defun x-conf (tool) (interactive "s tool: ") (find-file (format "~/.%s.xr" tool)) ) ;; get resource file by placing the cursor at an #include line; ;; haven't tested (for that), but could be useful ;; for C and C++ with some adjustments (defun follow-x-conf () (interactive) (save-excursion ; I was hesitant to add this, ; because `goto-conf' does it, but ; for the possibility of direct invocation (beginning-of-line) (forward-word 1) ; get by #include (forward-char 2) ; get by WS and DQM (find-file (thing-at-point 'filename)) )) ;; umbrella function that will invoke one of the above (defun goto-conf () (interactive) (save-excursion (beginning-of-line) (if (< (point) (point-max)) ; not to break on EOB ; (is there such a predicate?) (progn (forward-char 1) ; get by hash; (if (string= (thing-at-point 'word) "include") (follow-x-conf) (call-interactively 'x-conf) )) (call-interactively 'x-conf) ))) ;; shortcut as you see fit ; (define-key (current-global-map) (kbd "...") 'goto-conf) ;; as always, my method to get to config files ;; (not just X config files), fast: ; (global-set-key (kbd "C-j") 'jump-to-register) ; (set-register ?X (cons 'file "~/.Xresources")) -- Emanuel Berg - programmer (hire me! CV below) computer projects: http://user.it.uu.se/~embe8573 internet activity: http://home.student.uu.se/embe8573