Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"We shall reach greater and greater platitudes of achievement." -- Richard J. Daley


computers / gnu.emacs.help / Help required with regexp in auto-mode-alist

SubjectAuthor
* Help required with regexp in auto-mode-alistLoris Bennett
`- Re: Help required with regexp in auto-mode-aliststeve

1
Help required with regexp in auto-mode-alist

<87ttt2uhl3.fsf@zedat.fu-berlin.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=7&group=gnu.emacs.help#7

  copy link   Newsgroups: gnu.emacs.help
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: loris.bennett@fu-berlin.de (Loris Bennett)
Newsgroups: gnu.emacs.help
Subject: Help required with regexp in auto-mode-alist
Date: Mon, 14 Aug 2023 10:57:28 +0200
Organization: ZEDAT, Freie Universität Berlin
Lines: 22
Message-ID: <87ttt2uhl3.fsf@zedat.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: news.uni-berlin.de U2ynQD7ltjzSB4Vkb0PBKQ7DRa1YLVgB/f+fSPYnRSzudu
Cancel-Lock: sha1:jUrjRjmh+tFHEY8thL9Zc7sUHX8= sha1:ch7vY5as095NnV81Qym/yYuYbuE= sha256:AMfanGnmrVAGrSeuMxtAZM9bukdFFFA4pugdNiFBsgc=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
 by: Loris Bennett - Mon, 14 Aug 2023 08:57 UTC

Hi,

I edit pages of a wiki (FOSWiki), which, when opened in Emacs via the
Firefox extension "Edit with Emacs", end up in buffers with names like
the following:

wiki.zedat.fu-berlin.de/bin/edit/SCS/ScsProtokoll20230816?t=1692000848;nowysiwyg=1

I would like to associate these with a specific mode and therefore have

(add-to-list 'auto-mode-alist '("wiki\\.zedat\\.fu-berlin\\.de/bin/edit/SCS/.*" . erin-mode))

in my setup. However, the mode is not selected. What is wrong with my
regexp?

Cheers,

Loris

--
--
This signature is currently under constuction.

Re: Help required with regexp in auto-mode-alist

<87r0f19ft3.fsf@gmail.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55&group=gnu.emacs.help#55

  copy link   Newsgroups: gnu.emacs.help
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.giganews.com!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 19 Apr 2024 21:57:13 +0000
From: sgonedes1977@gmail.com (steve)
Newsgroups: gnu.emacs.help
Subject: Re: Help required with regexp in auto-mode-alist
References: <87ttt2uhl3.fsf@zedat.fu-berlin.de>
Date: Fri, 19 Apr 2024 17:57:12 -0400
Message-ID: <87r0f19ft3.fsf@gmail.com>
Organization: 
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:MPR9iwFiTDnKQigPF3eql97jSTU=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 62
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-LVY4Yqo1c4DHLKCZKgC5AkTNA3maaE+Qd37ehj0lUozTNNcr9f8BdXLjoZ9fUrM1ldwHF8xn9urCQ4/!SPqLMlfIKDZhSoLfKsYWEv+CW421O3ypSUxvTmJ8Pyvkhw==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: steve - Fri, 19 Apr 2024 21:57 UTC

"Loris Bennett" <loris.bennett@fu-berlin.de> writes:

< Hi,

< I edit pages of a wiki (FOSWiki), which, when opened in Emacs via the
< Firefox extension "Edit with Emacs", end up in buffers with names like
< the following:
>
< wiki.zedat.fu-berlin.de/bin/edit/SCS/ScsProtokoll20230816?t=1692000848;nowysiwyg=1
>
< I would like to associate these with a specific mode and therefore have
>
< (add-to-list 'auto-mode-alist '("wiki\\.zedat\\.fu-berlin\\.de/bin/edit/SCS/.*" . erin-mode))

Your regexp is probably off. auto-mode-alist is a regexp for the type of
file. that would be everything after the `.'

i just downloaded the extension and it works great. Try and run M-x
server-start first.

from my emacs file:

;; .emacs.el

;; start emacs server mode
(server-start)

;; append paths to auto-mode-alist
;; check for duplicates with rassoc
(unless (rassoc 'html-mode auto-mode-alist)
(setq auto-mode-alist
(append auto-mode-alist
'(("\\.txt\\'" . rst-mode)
("\\.html?\\'" . html-mode)
("\\.rest\\'" . rst-mode)
("\\.md\\'" . rst-mode)
("^README.*" . rst-mode)
("\\.\\(pp\\|dpr\\|dpk\\|inc\\)\\'" . pascal-mode)
("\\.fpc\\'" . makefile-gmake-mode)
("\\.cl\\'" . lisp-mode )
("\\.asd\\'" . lisp-mode)))))

;; hook function to modify html-mode
(defun si::html-mode-hook ()
"Function to run when new HTML buffer is created."
(setq sgml-basic-offset 2)
(message "Editing a HTML file: %s" (buffer-file-name (current-buffer))))

(add-hook 'html-mode-hook 'si::html-mode-hook)

< in my setup. However, the mode is not selected. What is wrong with my
< regexp?

the regexp should be looking for *.html$ that means ending with .html.

hope this helps


computers / gnu.emacs.help / Help required with regexp in auto-mode-alist

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor