GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    PuercoPop (puercopop@mastodon.social)'s status on Thursday, 03-Apr-2025 20:57:21 JST PuercoPop PuercoPop

    #emacs doesn't ship a goto-line function. M-x apropos goto-line shows several implementations. But I was surprised to see avy's implementation https://github.com/abo-abo/avy/blob/933d1f36cca0f71e4acb5fac707e9ae26c536264/avy.el#L1750-L1784

    In conversation about a month ago from mastodon.social permalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: opengraph.githubassets.com
      avy/avy.el at 933d1f36cca0f71e4acb5fac707e9ae26c536264 · abo-abo/avy
      Jump to things in Emacs tree-style. Contribute to abo-abo/avy development by creating an account on GitHub.
    • Embed this notice
      PuercoPop (puercopop@mastodon.social)'s status on Thursday, 03-Apr-2025 20:57:19 JST PuercoPop PuercoPop
      in reply to
      • Harald

      @HaraldKi It is not riddles, it is a mistake as acknowledged in https://mastodon.social/@PuercoPop/114269945473188483

      That said, that point about people re-implementing still stands. ej.
      avy-goto-line, org-goto-line[0], sly-goto-line[1], go--goto-line[2], etc.

      [0]: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-macs.el#n867
      [1]: https://github.com/joaotavora/sly/blob/c48defcf58596e035d473f3a125fdd1485593146/sly.el#L4141
      [2]: https://github.com/dominikh/go-mode.el/blob/0ed3c5227e7f622589f1411b4939c3ee34711ebd/go-mode.el#L2400C8-L2400C21

      In conversation about a month ago permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        PuercoPop (@PuercoPop@mastodon.social)
        from PuercoPop
        scratch that. simple.el does implement goto-line. Why do people re-implement it? compatibility with old emacs versions?
      2. Domain not in remote thumbnail source whitelist: git.savannah.gnu.org
        org-macs.el\lisp - emacs/org-mode.git - Emacs Org mode
      3. Domain not in remote thumbnail source whitelist: opengraph.githubassets.com
        sly/sly.el at c48defcf58596e035d473f3a125fdd1485593146 · joaotavora/sly
        Sylvester the Cat's Common Lisp IDE. Contribute to joaotavora/sly development by creating an account on GitHub.
      4. Domain not in remote thumbnail source whitelist: opengraph.githubassets.com
        go-mode.el/go-mode.el at 0ed3c5227e7f622589f1411b4939c3ee34711ebd · dominikh/go-mode.el
        Emacs mode for the Go programming language. Contribute to dominikh/go-mode.el development by creating an account on GitHub.
    • Embed this notice
      Alfred M. Szmidt (amszmidt@mastodon.social)'s status on Thursday, 03-Apr-2025 20:57:19 JST Alfred M. Szmidt Alfred M. Szmidt
      in reply to
      • Harald

      @PuercoPop Correct, because using goto-line in a Lisp program is not the right thing. goto-char/forward-line is the preferred method there.

      All the implementations you cited are exactly that .. for use in Lisp code (and not interactive usage).

      @HaraldKi

      In conversation about a month ago permalink
    • Embed this notice
      Harald (haraldki@nrw.social)'s status on Thursday, 03-Apr-2025 20:57:21 JST Harald Harald
      in reply to

      @PuercoPop You are speaking in riddles. It is even called goto-line.

      https://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-Point.html#index-M_002dg-M_002dg

      In conversation about a month ago permalink
    • Embed this notice
      PuercoPop (puercopop@mastodon.social)'s status on Thursday, 03-Apr-2025 20:58:03 JST PuercoPop PuercoPop
      in reply to

      Takes dedication to implement something more complex that
      (defun goto-line (lnum)
      (save-restriction
      (widen)
      (goto-char (point-min))
      (forward-line (1- lnum))))

      In conversation about a month ago permalink
    • Embed this notice
      PuercoPop (puercopop@mastodon.social)'s status on Thursday, 03-Apr-2025 20:58:03 JST PuercoPop PuercoPop
      in reply to

      scratch that. simple.el does implement goto-line. Why do people re-implement it? compatibility with old emacs versions?

      In conversation about a month ago permalink
    • Embed this notice
      Alfred M. Szmidt (amszmidt@mastodon.social)'s status on Thursday, 03-Apr-2025 20:58:03 JST Alfred M. Szmidt Alfred M. Szmidt
      in reply to

      @PuercoPop From the doc-string:

      This function is usually the wrong thing to use in a Lisp program.
      What you probably want instead is something like:
      (goto-char (point-min))
      (forward-line (1- N))
      If at all possible, an even better solution is to use char counts
      rather than line counts.

      In conversation about a month ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.